Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorashatilov2015-08-03 06:43:08 +0000
committerGerrit Code Review @ Eclipse.org2015-08-03 12:11:17 +0000
commit215cf8bf2ac0407d5630ec5b010f692bc4e76bd5 (patch)
tree6507c01134ce35b82cd5304d1422e8b7092497ef
parentc8cf5a77c863a794ea11a45f908997e7c9f721bb (diff)
downloadorg.eclipse.papyrus-215cf8bf2ac0407d5630ec5b010f692bc4e76bd5.tar.gz
org.eclipse.papyrus-215cf8bf2ac0407d5630ec5b010f692bc4e76bd5.tar.xz
org.eclipse.papyrus-215cf8bf2ac0407d5630ec5b010f692bc4e76bd5.zip
Composite Diagram regeneration.
- formatting (Papyrus formatter) Change-Id: Id2b65c0a97161bd9456b3c3c5a31db9a7148c955 Signed-off-by: ashatilov <shatilov@montages.com>
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/AbstractionAppliedStereotypeEditPart.java66
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/AbstractionEditPart.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/AbstractionNameEditPart.java66
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActivityCompositeCompartmentEditPart.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActivityCompositeCompartmentEditPartCN.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActivityCompositeEditPart.java15
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActivityCompositeEditPartCN.java91
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActivityCompositeFloatingLabelEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActivityCompositeFloatingLabelEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActivityCompositeNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActivityCompositeNameEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActorEditPart.java44
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActorEditPartCN.java44
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActorFloatingLabelEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActorFloatingLabelEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActorNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActorNameEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/AnyReceiveEventEditPart.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/AnyReceiveEventFloatingLabelEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/AnyReceiveEventNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ArtifactEditPart.java44
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ArtifactEditPartCN.java44
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ArtifactFloatingLabelEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ArtifactFloatingLabelEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ArtifactNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ArtifactNameEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/BehaviorPortEditPart.java34
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/BehaviorPortFloatingLabelEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/BehaviorPortLinkEditPart.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CallEventEditPart.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CallEventFloatingLabelEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CallEventNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ChangeEventEditPart.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ChangeEventFloatingLabelEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ChangeEventNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ClassCompositeCompartmentEditPart.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ClassCompositeCompartmentEditPartCN.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ClassCompositeEditPart.java11
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ClassCompositeEditPartCN.java77
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ClassCompositeFloatingLabelEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ClassCompositeFloatingLabelEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ClassCompositeNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ClassCompositeNameEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationCompositeCompartmentEditPart.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationCompositeCompartmentEditPartCN.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationCompositeEditPart.java63
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationCompositeEditPartCN.java63
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationCompositeFloatingLabelEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationCompositeFloatingLabelEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationCompositeNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationCompositeNameEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationRoleEditPartCN.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationRoleFloatingLabelEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationRoleNameEditPartCN.java265
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationUseEditPartCN.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationUseFloatingLabelEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationUseNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CommentAnnotatedElementEditPart.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CommentBodyEditPart.java262
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CommentBodyEditPartCN.java262
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CommentEditPart.java40
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CommentEditPartCN.java40
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentCompositeCompartmentEditPart.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentCompositeCompartmentEditPartCN.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentCompositeEditPart.java77
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentCompositeEditPartCN.java77
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentCompositeFloatingLabelEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentCompositeFloatingLabelEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentCompositeNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentCompositeNameEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentRealizationAppliedStereotypeEditPart.java66
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentRealizationEditPart.java20
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentRealizationNameEditPart.java66
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CompositeStructureDiagramEditPart.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConnectorAppliedStereotypeEditPart.java66
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConnectorEditPart.java34
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConnectorMultiplicitySourceEditPart.java66
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConnectorMultiplicityTargetEditPart.java66
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConnectorNameEditPart.java69
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConstraintConstrainedElementEditPart.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConstraintEditPart.java46
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConstraintEditPartCN.java46
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConstraintNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConstraintNameEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConstraintSpecificationEditPart.java262
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConstraintSpecificationEditPartCN.java262
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeAttributeCompartmentEditPart.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeAttributeCompartmentEditPartCN.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeEditPart.java86
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeEditPartCN.java86
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeFloatingLabelEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeFloatingLabelEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeNameEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeOperationCompartmentEditPart.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeOperationCompartmentEditPartCN.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DependencyAppliedStereotypeEditPart.java66
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DependencyEditPart.java20
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DependencyNameEditPart.java66
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentAppliedStereotypeEditPart.java66
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentEditPart.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentNameEditPart.java66
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentSpecificationEditPart.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentSpecificationEditPartCN.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentSpecificationFloatingLabelEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentSpecificationFloatingLabelEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentSpecificationNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentSpecificationNameEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeviceCompositeCompartmentEditPart.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeviceCompositeCompartmentEditPartCN.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeviceCompositeEditPart.java77
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeviceCompositeEditPartCN.java77
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeviceCompositeFloatingLabelEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeviceCompositeFloatingLabelEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeviceCompositeNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeviceCompositeNameEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationConstraintEditPart.java46
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationConstraintEditPartCN.java46
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationConstraintNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationConstraintNameEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationConstraintSpecificationEditPart.java262
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationConstraintSpecificationEditPartCN.java262
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationEditPart.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationFloatingLabelEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationIntervalEditPart.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationIntervalFloatingLabelEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationIntervalNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationObservationEditPart.java37
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationObservationEventEditPart.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationObservationNameEditPart.java69
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationObservationStereotypeLabelEditPart.java69
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationEditPart.java71
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationEditPartCN.java71
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationEnumerationLiteralCompartmentEditPart.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationEnumerationLiteralCompartmentEditPartCN.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationFloatingLabelEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationFloatingLabelEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationLiteralEditPartCLN.java269
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationNameEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExecutionEnvironmentCompositeCompartmentEditPart.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExecutionEnvironmentCompositeCompartmentEditPartCN.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExecutionEnvironmentCompositeEditPart.java77
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExecutionEnvironmentCompositeEditPartCN.java77
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExecutionEnvironmentCompositeFloatingLabelEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExecutionEnvironmentCompositeFloatingLabelEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExecutionEnvironmentCompositeNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExecutionEnvironmentCompositeNameEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExpressionEditPart.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExpressionFloatingLabelEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExpressionNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/FunctionBehaviorCompositeCompartmentEditPart.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/FunctionBehaviorCompositeCompartmentEditPartCN.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/FunctionBehaviorCompositeEditPart.java91
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/FunctionBehaviorCompositeEditPartCN.java91
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/FunctionBehaviorCompositeFloatingLabelEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/FunctionBehaviorCompositeFloatingLabelEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/FunctionBehaviorCompositeNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/FunctionBehaviorCompositeNameEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/GeneralizationAppliedStereotypeEditPart.java66
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/GeneralizationEditPart.java13
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationFlowAppliedStereotypeEditPart.java66
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationFlowConveyedLabelEditPart.java66
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationFlowEditPart.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationItemEditPart.java45
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationItemEditPartCN.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationItemFloatingLabelEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationItemFloatingLabelEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationItemNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationItemNameEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InstanceValueEditPart.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InstanceValueFloatingLabelEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InstanceValueNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionCompositeCompartmentEditPart.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionCompositeCompartmentEditPartCN.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionCompositeEditPart.java15
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionCompositeEditPartCN.java91
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionCompositeFloatingLabelEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionCompositeFloatingLabelEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionCompositeNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionCompositeNameEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionConstraintEditPart.java46
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionConstraintEditPartCN.java46
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionConstraintNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionConstraintNameEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionConstraintSpecificationEditPart.java262
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionConstraintSpecificationEditPartCN.java262
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceEditPart.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceEditPartCN.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceFloatingLabelEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceFloatingLabelEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceNameEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceRealizationAppliedStereotypeEditPart.java66
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceRealizationEditPart.java20
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceRealizationNameEditPart.java66
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalConstraintEditPart.java46
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalConstraintEditPartCN.java46
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalConstraintNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalConstraintNameEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalConstraintSpecificationEditPart.java262
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalConstraintSpecificationEditPartCN.java262
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalEditPart.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalFloatingLabelEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LinkDescriptorEditPart.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralBooleanEditPart.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralBooleanFloatingLabelEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralBooleanNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralIntegerEditPart.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralIntegerFloatingLabelEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralIntegerNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralNullEditPart.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralNullFloatingLabelEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralNullNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralStringEditPart.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralStringFloatingLabelEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralStringNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralUnlimitedNaturalEditPart.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralUnlimitedNaturalFloatingLabelEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralUnlimitedNaturalNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ManifestationAppliedStereotypeEditPart.java66
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ManifestationEditPart.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ManifestationNameEditPart.java66
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/NodeCompositeCompartmentEditPart.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/NodeCompositeCompartmentEditPartCN.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/NodeCompositeEditPart.java77
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/NodeCompositeEditPartCN.java77
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/NodeCompositeFloatingLabelEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/NodeCompositeFloatingLabelEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/NodeCompositeNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/NodeCompositeNameEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueBehaviorCompositeCompartmentEditPart.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueBehaviorCompositeCompartmentEditPartCN.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueBehaviorCompositeEditPart.java91
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueBehaviorCompositeEditPartCN.java91
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueBehaviorCompositeFloatingLabelEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueBehaviorCompositeFloatingLabelEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueBehaviorCompositeNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueBehaviorCompositeNameEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueExpressionEditPart.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueExpressionFloatingLabelEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueExpressionNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OperationEditPartCLN.java269
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ParameterAppliedStereotypeEditPart.java69
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ParameterEditPart.java37
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ParameterNameEditPart.java72
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PortAppliedStereotypeEditPart.java69
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PortEditPart.java37
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PortNameEditPart.java72
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PrimitiveTypeEditPart.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PrimitiveTypeEditPartCN.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PrimitiveTypeFloatingLabelEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PrimitiveTypeFloatingLabelEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PrimitiveTypeNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PrimitiveTypeNameEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PropertyEditPartCLN.java269
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PropertyPartCompartmentEditPartCN.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PropertyPartEditPartCN.java77
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PropertyPartFloatingLabelEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PropertyPartNameEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ProtocolStateMachineCompositeCompartmentEditPart.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ProtocolStateMachineCompositeCompartmentEditPartCN.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ProtocolStateMachineCompositeEditPart.java15
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ProtocolStateMachineCompositeEditPartCN.java91
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ProtocolStateMachineCompositeFloatingLabelEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ProtocolStateMachineCompositeFloatingLabelEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ProtocolStateMachineCompositeNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ProtocolStateMachineCompositeNameEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/RealizationAppliedStereotypeEditPart.java66
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/RealizationEditPart.java20
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/RealizationNameEditPart.java66
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/RepresentationEditPart.java13
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/RepresentationTagLabelEditPart.java66
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/RoleBindingAppliedStereotypeEditPart.java66
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/RoleBindingEditPart.java20
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/RoleBindingRoleNameEditPart.java66
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalEditPart.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalEditPartCN.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalEventEditPart.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalEventFloatingLabelEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalEventNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalFloatingLabelEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalFloatingLabelEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalNameEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeCompartmentEditPart.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeCompartmentEditPartCN.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeEditPart.java15
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeEditPartCN.java91
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeFloatingLabelEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeFloatingLabelEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeNameEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StringExpressionEditPart.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StringExpressionFloatingLabelEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StringExpressionNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SubstitutionAppliedStereotypeEditPart.java66
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SubstitutionEditPart.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SubstitutionNameEditPart.java66
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeConstraintEditPart.java46
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeConstraintEditPartCN.java46
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeConstraintNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeConstraintNameEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeConstraintSpecificationEditPart.java262
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeConstraintSpecificationEditPartCN.java262
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeEventEditPart.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeEventFloatingLabelEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeEventNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeExpressionEditPart.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeExpressionFloatingLabelEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeExpressionNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeIntervalEditPart.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeIntervalFloatingLabelEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeIntervalNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeObservationEditPart.java37
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeObservationEventEditPart.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeObservationNameEditPart.java69
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeObservationStereotypeLabelEditPart.java69
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UMLEditPartFactory.java370
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UsageAppliedStereotypeEditPart.java66
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UsageEditPart.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UsageNameEditPart.java66
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UseCaseEditPart.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UseCaseEditPartCN.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UseCaseFloatingLabelEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UseCaseFloatingLabelEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UseCaseNameEditPart.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UseCaseNameEditPartCN.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/policies/UMLBaseItemSemanticEditPolicy.java260
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/policies/UMLTextNonResizableEditPolicy.java51
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/policies/UMLTextSelectionEditPolicy.java49
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/parsers/AbstractParser.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/parsers/MessageFormatParser.java35
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/DiagramEditorContextMenuProvider.java16
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/Messages.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/ModelElementSelectionPage.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLCreationWizard.java36
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLCreationWizardPage.java14
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLDiagramActionBarContributor.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLDiagramContentInitializer.java725
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLDiagramEditor.java87
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLDiagramEditorPlugin.java30
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLDiagramEditorUtil.java102
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLDiagramUpdater.java4054
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLDocumentProvider.java257
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLInitDiagramFileAction.java17
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLMatchingStrategy.java7
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLNewDiagramFileWizard.java49
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLPaletteFactory.java72
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLVisualIDRegistry.java3672
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/ValidateAction.java114
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/preferences/DiagramPreferenceInitializer.java1
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/providers/ElementInitializers.java546
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/providers/UMLEditPartProvider.java4
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/providers/UMLElementTypes.java221
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/providers/UMLMarkerNavigationProvider.java23
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/providers/UMLParserProvider.java992
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/providers/UMLValidationDecoratorProvider.java21
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/providers/UMLValidationProvider.java9
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/providers/UMLViewProvider.java1034
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/sheet/UMLPropertySection.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/sheet/UMLSheetLabelProvider.java18
364 files changed, 35321 insertions, 27954 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/AbstractionAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/AbstractionAppliedStereotypeEditPart.java
index 7e1bd3ec437..14caa53fcfa 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/AbstractionAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/AbstractionAppliedStereotypeEditPart.java
@@ -123,6 +123,7 @@ public class AbstractionAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -211,8 +212,7 @@ public class AbstractionAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* @generated
*/
- public void setLabel(IFigure
- figure) {
+ public void setLabel(IFigure figure) {
unregisterVisuals();
setFigure(figure);
defaultText = getLabelTextHelper(figure);
@@ -324,15 +324,14 @@ public class AbstractionAppliedStereotypeEditPart extends PapyrusLabelEditPart i
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid =
- (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
@@ -461,8 +460,7 @@ public class AbstractionAppliedStereotypeEditPart extends PapyrusLabelEditPart i
IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- }
- else if (configuration instanceof IAdvancedEditorConfiguration) {
+ } 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);
@@ -507,8 +505,7 @@ public class AbstractionAppliedStereotypeEditPart extends PapyrusLabelEditPart i
RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- }
- else {
+ } else {
performDirectEdit();
}
}
@@ -558,17 +555,15 @@ public class AbstractionAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
protected void refreshUnderline() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
if (resolveSemanticElement() instanceof Feature) {
if (((Feature) resolveSemanticElement()).isStatic()) {
((WrappingLabel) getFigure()).setTextUnderline(true);
- }
- else {
+ } else {
((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
@@ -578,9 +573,8 @@ public class AbstractionAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
@@ -591,14 +585,12 @@ public class AbstractionAppliedStereotypeEditPart extends PapyrusLabelEditPart i
*/
@Override
protected void refreshFont() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ 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));
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -684,7 +676,7 @@ public class AbstractionAppliedStereotypeEditPart extends PapyrusLabelEditPart i
*/
protected boolean checkExtendedEditor() {
if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -708,9 +700,9 @@ public class AbstractionAppliedStereotypeEditPart extends PapyrusLabelEditPart i
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());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
@@ -724,8 +716,7 @@ public class AbstractionAppliedStereotypeEditPart extends PapyrusLabelEditPart i
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement()
- .eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
@@ -777,18 +768,15 @@ public class AbstractionAppliedStereotypeEditPart extends PapyrusLabelEditPart i
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)) {
+ } 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();
+ ISemanticParser modelParser = (ISemanticParser) getParser();
if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
if (resolveSemanticElement() != null) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/AbstractionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/AbstractionEditPart.java
index cf88b3348a8..3f07cf7bab6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/AbstractionEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/AbstractionEditPart.java
@@ -52,10 +52,12 @@ public class AbstractionEditPart extends UMLConnectionNodeEditPart implements IT
*/
protected boolean addFixedChild(EditPart childEditPart) {
if (childEditPart instanceof AbstractionNameEditPart) {
- ((AbstractionNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ ((AbstractionNameEditPart) childEditPart).setLabel(
+ getPrimaryShape().getNameLabel());
}
if (childEditPart instanceof AbstractionAppliedStereotypeEditPart) {
- ((AbstractionAppliedStereotypeEditPart) childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
+ ((AbstractionAppliedStereotypeEditPart) childEditPart).setLabel(
+ getPrimaryShape().getAppliedStereotypeLabel());
}
return false;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/AbstractionNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/AbstractionNameEditPart.java
index 76c2cf3d882..046eafe689f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/AbstractionNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/AbstractionNameEditPart.java
@@ -123,6 +123,7 @@ public class AbstractionNameEditPart extends PapyrusLabelEditPart implements ITe
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -211,8 +212,7 @@ public class AbstractionNameEditPart extends PapyrusLabelEditPart implements ITe
/**
* @generated
*/
- public void setLabel(IFigure
- figure) {
+ public void setLabel(IFigure figure) {
unregisterVisuals();
setFigure(figure);
defaultText = getLabelTextHelper(figure);
@@ -324,15 +324,14 @@ public class AbstractionNameEditPart extends PapyrusLabelEditPart implements ITe
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid =
- (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
@@ -461,8 +460,7 @@ public class AbstractionNameEditPart extends PapyrusLabelEditPart implements ITe
IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- }
- else if (configuration instanceof IAdvancedEditorConfiguration) {
+ } 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);
@@ -507,8 +505,7 @@ public class AbstractionNameEditPart extends PapyrusLabelEditPart implements ITe
RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- }
- else {
+ } else {
performDirectEdit();
}
}
@@ -558,17 +555,15 @@ public class AbstractionNameEditPart extends PapyrusLabelEditPart implements ITe
* @generated
*/
protected void refreshUnderline() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
if (resolveSemanticElement() instanceof Feature) {
if (((Feature) resolveSemanticElement()).isStatic()) {
((WrappingLabel) getFigure()).setTextUnderline(true);
- }
- else {
+ } else {
((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
@@ -578,9 +573,8 @@ public class AbstractionNameEditPart extends PapyrusLabelEditPart implements ITe
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
@@ -591,14 +585,12 @@ public class AbstractionNameEditPart extends PapyrusLabelEditPart implements ITe
*/
@Override
protected void refreshFont() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ 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));
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -692,7 +684,7 @@ public class AbstractionNameEditPart extends PapyrusLabelEditPart implements ITe
*/
protected boolean checkExtendedEditor() {
if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -716,9 +708,9 @@ public class AbstractionNameEditPart extends PapyrusLabelEditPart implements ITe
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());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
@@ -732,8 +724,7 @@ public class AbstractionNameEditPart extends PapyrusLabelEditPart implements ITe
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement()
- .eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
@@ -785,18 +776,15 @@ public class AbstractionNameEditPart extends PapyrusLabelEditPart implements ITe
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)) {
+ } 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();
+ ISemanticParser modelParser = (ISemanticParser) getParser();
if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
if (resolveSemanticElement() != null) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActivityCompositeCompartmentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActivityCompositeCompartmentEditPart.java
index cad64aa4061..e9e94a352e8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActivityCompositeCompartmentEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActivityCompositeCompartmentEditPart.java
@@ -81,7 +81,7 @@ public class ActivityCompositeCompartmentEditPart extends LinkLFShapeCompartment
* @generated
*/
protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
+ if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
super.setRatio(ratio);
}
}
@@ -90,6 +90,7 @@ public class ActivityCompositeCompartmentEditPart extends LinkLFShapeCompartment
* @generated
*/
public EditPart getTargetEditPart(Request request) {
+
return super.getTargetEditPart(request);
}
@@ -98,7 +99,10 @@ public class ActivityCompositeCompartmentEditPart extends LinkLFShapeCompartment
*/
protected void handleNotificationEvent(Notification notification) {
Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
+ if (NotationPackage.eINSTANCE.getSize_Width().equals(feature)
+ || NotationPackage.eINSTANCE.getSize_Height().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_X().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
refreshBounds();
}
super.handleNotificationEvent(notification);
@@ -108,13 +112,16 @@ public class ActivityCompositeCompartmentEditPart extends LinkLFShapeCompartment
* @generated
*/
protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
+ ((GraphicalEditPart) getParent()).setLayoutConstraint(
+ this,
+ getFigure(),
+ new Rectangle(loc, size));
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActivityCompositeCompartmentEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActivityCompositeCompartmentEditPartCN.java
index 53dadd18bc5..ab62202021d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActivityCompositeCompartmentEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActivityCompositeCompartmentEditPartCN.java
@@ -81,7 +81,7 @@ public class ActivityCompositeCompartmentEditPartCN extends LinkLFShapeCompartme
* @generated
*/
protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
+ if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
super.setRatio(ratio);
}
}
@@ -90,6 +90,7 @@ public class ActivityCompositeCompartmentEditPartCN extends LinkLFShapeCompartme
* @generated
*/
public EditPart getTargetEditPart(Request request) {
+
return super.getTargetEditPart(request);
}
@@ -98,7 +99,10 @@ public class ActivityCompositeCompartmentEditPartCN extends LinkLFShapeCompartme
*/
protected void handleNotificationEvent(Notification notification) {
Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
+ if (NotationPackage.eINSTANCE.getSize_Width().equals(feature)
+ || NotationPackage.eINSTANCE.getSize_Height().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_X().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
refreshBounds();
}
super.handleNotificationEvent(notification);
@@ -108,13 +112,16 @@ public class ActivityCompositeCompartmentEditPartCN extends LinkLFShapeCompartme
* @generated
*/
protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
+ ((GraphicalEditPart) getParent()).setLayoutConstraint(
+ this,
+ getFigure(),
+ new Rectangle(loc, size));
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActivityCompositeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActivityCompositeEditPart.java
index 09d4127a1df..799841d84bd 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActivityCompositeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActivityCompositeEditPart.java
@@ -97,7 +97,9 @@ public class ActivityCompositeEditPart extends RoundedCompartmentEditPart {
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new DefaultCreationEditPolicy());
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
@@ -179,6 +181,7 @@ public class ActivityCompositeEditPart extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -205,24 +208,35 @@ public class ActivityCompositeEditPart extends RoundedCompartmentEditPart {
((ActivityCompositeNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
+
+
if (childEditPart instanceof ActivityCompositeCompartmentEditPart) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
pane.add(((ActivityCompositeCompartmentEditPart) childEditPart).getFigure());
return true;
}
+
+
+
// Papyrus Gencode :Affixed Port locator
if (childEditPart instanceof PortEditPart) {
IBorderItemLocator locator = new PortPositionLocator(getMainFigure(), PositionConstants.NONE);
getBorderedFigure().getBorderItemContainer().add(((PortEditPart) childEditPart).getFigure(), locator);
return true;
}
+
+
+
+
// Papyrus Gencode :Affixed Port locator
if (childEditPart instanceof ParameterEditPart) {
IBorderItemLocator locator = new PortPositionLocator(getMainFigure(), PositionConstants.NONE);
getBorderedFigure().getBorderItemContainer().add(((ParameterEditPart) childEditPart).getFigure(), locator);
return true;
}
+
+
return false;
}
@@ -309,6 +323,7 @@ public class ActivityCompositeEditPart extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActivityCompositeEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActivityCompositeEditPartCN.java
index 1cc1952dc00..98b466b87f8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActivityCompositeEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActivityCompositeEditPartCN.java
@@ -96,7 +96,9 @@ public class ActivityCompositeEditPartCN extends RoundedCompartmentEditPart {
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new DefaultCreationEditPolicy());
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
@@ -120,14 +122,14 @@ public class ActivityCompositeEditPartCN extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case ActivityCompositeFloatingLabelEditPartCN.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
@@ -137,7 +139,7 @@ public class ActivityCompositeEditPartCN extends RoundedCompartmentEditPart {
return new BorderItemResizableEditPolicy();
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -157,8 +159,9 @@ public class ActivityCompositeEditPartCN extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -176,6 +179,7 @@ public class ActivityCompositeEditPartCN extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -187,38 +191,50 @@ public class ActivityCompositeEditPartCN extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.composite.custom.figures.ActivityCompositeFigure
+ *
* @generated
*/
public ActivityCompositeFigure getPrimaryShape() {
- return (ActivityCompositeFigure)primaryShape;
+ return (ActivityCompositeFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ActivityCompositeNameEditPartCN) {
- ((ActivityCompositeNameEditPartCN)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof ActivityCompositeNameEditPartCN) {
+ ((ActivityCompositeNameEditPartCN) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
- if(childEditPart instanceof ActivityCompositeCompartmentEditPartCN) {
+
+
+ if (childEditPart instanceof ActivityCompositeCompartmentEditPartCN) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((ActivityCompositeCompartmentEditPartCN)childEditPart).getFigure());
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.add(((ActivityCompositeCompartmentEditPartCN) childEditPart).getFigure());
return true;
}
- //Papyrus Gencode :Affixed Port locator
- if(childEditPart instanceof PortEditPart) {
+
+
+
+ // Papyrus Gencode :Affixed Port locator
+ if (childEditPart instanceof PortEditPart) {
IBorderItemLocator locator = new PortPositionLocator(getMainFigure(), PositionConstants.NONE);
- getBorderedFigure().getBorderItemContainer().add(((PortEditPart)childEditPart).getFigure(), locator);
+ getBorderedFigure().getBorderItemContainer().add(((PortEditPart) childEditPart).getFigure(), locator);
return true;
}
- //Papyrus Gencode :Affixed Port locator
- if(childEditPart instanceof ParameterEditPart) {
+
+
+
+
+ // Papyrus Gencode :Affixed Port locator
+ if (childEditPart instanceof ParameterEditPart) {
IBorderItemLocator locator = new PortPositionLocator(getMainFigure(), PositionConstants.NONE);
- getBorderedFigure().getBorderItemContainer().add(((ParameterEditPart)childEditPart).getFigure(), locator);
+ getBorderedFigure().getBorderItemContainer().add(((ParameterEditPart) childEditPart).getFigure(), locator);
return true;
}
+
+
return false;
}
@@ -226,20 +242,20 @@ public class ActivityCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ActivityCompositeNameEditPartCN) {
+ if (childEditPart instanceof ActivityCompositeNameEditPartCN) {
return true;
}
- if(childEditPart instanceof ActivityCompositeCompartmentEditPartCN) {
+ if (childEditPart instanceof ActivityCompositeCompartmentEditPartCN) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- pane.remove(((ActivityCompositeCompartmentEditPartCN)childEditPart).getFigure());
+ pane.remove(((ActivityCompositeCompartmentEditPartCN) childEditPart).getFigure());
return true;
}
- if(childEditPart instanceof PortEditPart) {
- getBorderedFigure().getBorderItemContainer().remove(((PortEditPart)childEditPart).getFigure());
+ if (childEditPart instanceof PortEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((PortEditPart) childEditPart).getFigure());
return true;
}
- if(childEditPart instanceof ParameterEditPart) {
- getBorderedFigure().getBorderItemContainer().remove(((ParameterEditPart)childEditPart).getFigure());
+ if (childEditPart instanceof ParameterEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((ParameterEditPart) childEditPart).getFigure());
return true;
}
return false;
@@ -249,7 +265,7 @@ public class ActivityCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -259,7 +275,7 @@ public class ActivityCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -269,10 +285,10 @@ public class ActivityCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof ActivityCompositeCompartmentEditPartCN) {
+ if (editPart instanceof ActivityCompositeCompartmentEditPartCN) {
return getPrimaryShape().getCompositeCompartmentFigure();
}
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -282,7 +298,7 @@ public class ActivityCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof ActivityCompositeFloatingLabelEditPartCN) {
+ if (borderItemEditPart instanceof ActivityCompositeFloatingLabelEditPartCN) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -305,16 +321,19 @@ public class ActivityCompositeEditPartCN extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -326,7 +345,7 @@ public class ActivityCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -336,7 +355,7 @@ public class ActivityCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -352,8 +371,8 @@ public class ActivityCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActivityCompositeFloatingLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActivityCompositeFloatingLabelEditPart.java
index 22076b20d06..de9d1308929 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActivityCompositeFloatingLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActivityCompositeFloatingLabelEditPart.java
@@ -113,15 +113,18 @@ public class ActivityCompositeFloatingLabelEditPart extends FloatingLabelEditPar
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class ActivityCompositeFloatingLabelEditPart extends FloatingLabelEditPar
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class ActivityCompositeFloatingLabelEditPart extends FloatingLabelEditPar
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class ActivityCompositeFloatingLabelEditPart extends FloatingLabelEditPar
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class ActivityCompositeFloatingLabelEditPart extends FloatingLabelEditPar
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class ActivityCompositeFloatingLabelEditPart extends FloatingLabelEditPar
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class ActivityCompositeFloatingLabelEditPart extends FloatingLabelEditPar
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class ActivityCompositeFloatingLabelEditPart extends FloatingLabelEditPar
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class ActivityCompositeFloatingLabelEditPart extends FloatingLabelEditPar
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class ActivityCompositeFloatingLabelEditPart extends FloatingLabelEditPar
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class ActivityCompositeFloatingLabelEditPart extends FloatingLabelEditPar
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class ActivityCompositeFloatingLabelEditPart extends FloatingLabelEditPar
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class ActivityCompositeFloatingLabelEditPart extends FloatingLabelEditPar
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class ActivityCompositeFloatingLabelEditPart extends FloatingLabelEditPar
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Activity_2060, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.ActivityCompositeFloatingLabelEditPart.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class ActivityCompositeFloatingLabelEditPart extends FloatingLabelEditPar
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class ActivityCompositeFloatingLabelEditPart extends FloatingLabelEditPar
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class ActivityCompositeFloatingLabelEditPart extends FloatingLabelEditPar
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class ActivityCompositeFloatingLabelEditPart extends FloatingLabelEditPar
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class ActivityCompositeFloatingLabelEditPart extends FloatingLabelEditPar
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class ActivityCompositeFloatingLabelEditPart extends FloatingLabelEditPar
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class ActivityCompositeFloatingLabelEditPart extends FloatingLabelEditPar
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class ActivityCompositeFloatingLabelEditPart extends FloatingLabelEditPar
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class ActivityCompositeFloatingLabelEditPart extends FloatingLabelEditPar
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class ActivityCompositeFloatingLabelEditPart extends FloatingLabelEditPar
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class ActivityCompositeFloatingLabelEditPart extends FloatingLabelEditPar
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class ActivityCompositeFloatingLabelEditPart extends FloatingLabelEditPar
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class ActivityCompositeFloatingLabelEditPart extends FloatingLabelEditPar
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class ActivityCompositeFloatingLabelEditPart extends FloatingLabelEditPar
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class ActivityCompositeFloatingLabelEditPart extends FloatingLabelEditPar
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class ActivityCompositeFloatingLabelEditPart extends FloatingLabelEditPar
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class ActivityCompositeFloatingLabelEditPart extends FloatingLabelEditPar
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class ActivityCompositeFloatingLabelEditPart extends FloatingLabelEditPar
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActivityCompositeFloatingLabelEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActivityCompositeFloatingLabelEditPartCN.java
index 2a2b6e3b287..eb6a5a0dfea 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActivityCompositeFloatingLabelEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActivityCompositeFloatingLabelEditPartCN.java
@@ -113,15 +113,18 @@ public class ActivityCompositeFloatingLabelEditPartCN extends FloatingLabelEditP
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class ActivityCompositeFloatingLabelEditPartCN extends FloatingLabelEditP
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class ActivityCompositeFloatingLabelEditPartCN extends FloatingLabelEditP
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class ActivityCompositeFloatingLabelEditPartCN extends FloatingLabelEditP
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class ActivityCompositeFloatingLabelEditPartCN extends FloatingLabelEditP
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class ActivityCompositeFloatingLabelEditPartCN extends FloatingLabelEditP
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class ActivityCompositeFloatingLabelEditPartCN extends FloatingLabelEditP
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class ActivityCompositeFloatingLabelEditPartCN extends FloatingLabelEditP
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class ActivityCompositeFloatingLabelEditPartCN extends FloatingLabelEditP
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class ActivityCompositeFloatingLabelEditPartCN extends FloatingLabelEditP
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class ActivityCompositeFloatingLabelEditPartCN extends FloatingLabelEditP
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class ActivityCompositeFloatingLabelEditPartCN extends FloatingLabelEditP
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class ActivityCompositeFloatingLabelEditPartCN extends FloatingLabelEditP
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class ActivityCompositeFloatingLabelEditPartCN extends FloatingLabelEditP
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Activity_3072, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.ActivityCompositeFloatingLabelEditPartCN.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class ActivityCompositeFloatingLabelEditPartCN extends FloatingLabelEditP
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class ActivityCompositeFloatingLabelEditPartCN extends FloatingLabelEditP
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class ActivityCompositeFloatingLabelEditPartCN extends FloatingLabelEditP
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class ActivityCompositeFloatingLabelEditPartCN extends FloatingLabelEditP
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class ActivityCompositeFloatingLabelEditPartCN extends FloatingLabelEditP
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class ActivityCompositeFloatingLabelEditPartCN extends FloatingLabelEditP
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class ActivityCompositeFloatingLabelEditPartCN extends FloatingLabelEditP
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class ActivityCompositeFloatingLabelEditPartCN extends FloatingLabelEditP
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class ActivityCompositeFloatingLabelEditPartCN extends FloatingLabelEditP
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class ActivityCompositeFloatingLabelEditPartCN extends FloatingLabelEditP
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class ActivityCompositeFloatingLabelEditPartCN extends FloatingLabelEditP
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class ActivityCompositeFloatingLabelEditPartCN extends FloatingLabelEditP
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class ActivityCompositeFloatingLabelEditPartCN extends FloatingLabelEditP
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class ActivityCompositeFloatingLabelEditPartCN extends FloatingLabelEditP
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class ActivityCompositeFloatingLabelEditPartCN extends FloatingLabelEditP
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class ActivityCompositeFloatingLabelEditPartCN extends FloatingLabelEditP
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class ActivityCompositeFloatingLabelEditPartCN extends FloatingLabelEditP
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class ActivityCompositeFloatingLabelEditPartCN extends FloatingLabelEditP
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActivityCompositeNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActivityCompositeNameEditPart.java
index baadee471b0..2be9f4c0d8d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActivityCompositeNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActivityCompositeNameEditPart.java
@@ -114,12 +114,14 @@ public class ActivityCompositeNameEditPart extends PapyrusCompartmentEditPart im
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class ActivityCompositeNameEditPart extends PapyrusCompartmentEditPart im
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class ActivityCompositeNameEditPart extends PapyrusCompartmentEditPart im
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class ActivityCompositeNameEditPart extends PapyrusCompartmentEditPart im
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class ActivityCompositeNameEditPart extends PapyrusCompartmentEditPart im
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class ActivityCompositeNameEditPart extends PapyrusCompartmentEditPart im
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class ActivityCompositeNameEditPart extends PapyrusCompartmentEditPart im
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class ActivityCompositeNameEditPart extends PapyrusCompartmentEditPart im
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class ActivityCompositeNameEditPart extends PapyrusCompartmentEditPart im
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class ActivityCompositeNameEditPart extends PapyrusCompartmentEditPart im
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class ActivityCompositeNameEditPart extends PapyrusCompartmentEditPart im
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class ActivityCompositeNameEditPart extends PapyrusCompartmentEditPart im
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class ActivityCompositeNameEditPart extends PapyrusCompartmentEditPart im
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Activity_2060, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.ActivityCompositeNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class ActivityCompositeNameEditPart extends PapyrusCompartmentEditPart im
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class ActivityCompositeNameEditPart extends PapyrusCompartmentEditPart im
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class ActivityCompositeNameEditPart extends PapyrusCompartmentEditPart im
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class ActivityCompositeNameEditPart extends PapyrusCompartmentEditPart im
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class ActivityCompositeNameEditPart extends PapyrusCompartmentEditPart im
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class ActivityCompositeNameEditPart extends PapyrusCompartmentEditPart im
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class ActivityCompositeNameEditPart extends PapyrusCompartmentEditPart im
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class ActivityCompositeNameEditPart extends PapyrusCompartmentEditPart im
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class ActivityCompositeNameEditPart extends PapyrusCompartmentEditPart im
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class ActivityCompositeNameEditPart extends PapyrusCompartmentEditPart im
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class ActivityCompositeNameEditPart extends PapyrusCompartmentEditPart im
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class ActivityCompositeNameEditPart extends PapyrusCompartmentEditPart im
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class ActivityCompositeNameEditPart extends PapyrusCompartmentEditPart im
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class ActivityCompositeNameEditPart extends PapyrusCompartmentEditPart im
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class ActivityCompositeNameEditPart extends PapyrusCompartmentEditPart im
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class ActivityCompositeNameEditPart extends PapyrusCompartmentEditPart im
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class ActivityCompositeNameEditPart extends PapyrusCompartmentEditPart im
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class ActivityCompositeNameEditPart extends PapyrusCompartmentEditPart im
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class ActivityCompositeNameEditPart extends PapyrusCompartmentEditPart im
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class ActivityCompositeNameEditPart extends PapyrusCompartmentEditPart im
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class ActivityCompositeNameEditPart extends PapyrusCompartmentEditPart im
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActivityCompositeNameEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActivityCompositeNameEditPartCN.java
index e61f22cba06..c8bf34e9f5a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActivityCompositeNameEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActivityCompositeNameEditPartCN.java
@@ -114,12 +114,14 @@ public class ActivityCompositeNameEditPartCN extends PapyrusCompartmentEditPart
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class ActivityCompositeNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class ActivityCompositeNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class ActivityCompositeNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class ActivityCompositeNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class ActivityCompositeNameEditPartCN extends PapyrusCompartmentEditPart
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class ActivityCompositeNameEditPartCN extends PapyrusCompartmentEditPart
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class ActivityCompositeNameEditPartCN extends PapyrusCompartmentEditPart
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class ActivityCompositeNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class ActivityCompositeNameEditPartCN extends PapyrusCompartmentEditPart
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class ActivityCompositeNameEditPartCN extends PapyrusCompartmentEditPart
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class ActivityCompositeNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class ActivityCompositeNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Activity_3072, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.ActivityCompositeNameEditPartCN.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class ActivityCompositeNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class ActivityCompositeNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class ActivityCompositeNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class ActivityCompositeNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class ActivityCompositeNameEditPartCN extends PapyrusCompartmentEditPart
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class ActivityCompositeNameEditPartCN extends PapyrusCompartmentEditPart
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class ActivityCompositeNameEditPartCN extends PapyrusCompartmentEditPart
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class ActivityCompositeNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class ActivityCompositeNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class ActivityCompositeNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class ActivityCompositeNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class ActivityCompositeNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class ActivityCompositeNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class ActivityCompositeNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class ActivityCompositeNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class ActivityCompositeNameEditPartCN extends PapyrusCompartmentEditPart
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class ActivityCompositeNameEditPartCN extends PapyrusCompartmentEditPart
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class ActivityCompositeNameEditPartCN extends PapyrusCompartmentEditPart
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class ActivityCompositeNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class ActivityCompositeNameEditPartCN extends PapyrusCompartmentEditPart
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class ActivityCompositeNameEditPartCN extends PapyrusCompartmentEditPart
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActorEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActorEditPart.java
index fdf978b8ea0..edb38d3ec87 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActorEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActorEditPart.java
@@ -80,7 +80,9 @@ public class ActorEditPart extends NodeEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
@@ -97,21 +99,21 @@ public class ActorEditPart extends NodeEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case ActorFloatingLabelEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -139,20 +141,23 @@ public class ActorEditPart extends NodeEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure
+ *
* @generated
*/
public RoundedCompartmentFigure getPrimaryShape() {
- return (RoundedCompartmentFigure)primaryShape;
+ return (RoundedCompartmentFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ActorNameEditPart) {
- ((ActorNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof ActorNameEditPart) {
+ ((ActorNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
+
+
return false;
}
@@ -160,7 +165,7 @@ public class ActorEditPart extends NodeEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ActorNameEditPart) {
+ if (childEditPart instanceof ActorNameEditPart) {
return true;
}
return false;
@@ -170,7 +175,7 @@ public class ActorEditPart extends NodeEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -180,7 +185,7 @@ public class ActorEditPart extends NodeEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -190,7 +195,7 @@ public class ActorEditPart extends NodeEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -200,7 +205,7 @@ public class ActorEditPart extends NodeEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof ActorFloatingLabelEditPart) {
+ if (borderItemEditPart instanceof ActorFloatingLabelEditPart) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -223,16 +228,19 @@ public class ActorEditPart extends NodeEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -244,7 +252,7 @@ public class ActorEditPart extends NodeEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -254,7 +262,7 @@ public class ActorEditPart extends NodeEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -270,8 +278,8 @@ public class ActorEditPart extends NodeEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActorEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActorEditPartCN.java
index 8cb8730b00e..0be3d92a1f4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActorEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActorEditPartCN.java
@@ -80,7 +80,9 @@ public class ActorEditPartCN extends NodeEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
@@ -97,21 +99,21 @@ public class ActorEditPartCN extends NodeEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case ActorFloatingLabelEditPartCN.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -139,20 +141,23 @@ public class ActorEditPartCN extends NodeEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure
+ *
* @generated
*/
public RoundedCompartmentFigure getPrimaryShape() {
- return (RoundedCompartmentFigure)primaryShape;
+ return (RoundedCompartmentFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ActorNameEditPartCN) {
- ((ActorNameEditPartCN)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof ActorNameEditPartCN) {
+ ((ActorNameEditPartCN) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
+
+
return false;
}
@@ -160,7 +165,7 @@ public class ActorEditPartCN extends NodeEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ActorNameEditPartCN) {
+ if (childEditPart instanceof ActorNameEditPartCN) {
return true;
}
return false;
@@ -170,7 +175,7 @@ public class ActorEditPartCN extends NodeEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -180,7 +185,7 @@ public class ActorEditPartCN extends NodeEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -190,7 +195,7 @@ public class ActorEditPartCN extends NodeEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -200,7 +205,7 @@ public class ActorEditPartCN extends NodeEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof ActorFloatingLabelEditPartCN) {
+ if (borderItemEditPart instanceof ActorFloatingLabelEditPartCN) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -223,16 +228,19 @@ public class ActorEditPartCN extends NodeEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -244,7 +252,7 @@ public class ActorEditPartCN extends NodeEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -254,7 +262,7 @@ public class ActorEditPartCN extends NodeEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -270,8 +278,8 @@ public class ActorEditPartCN extends NodeEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActorFloatingLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActorFloatingLabelEditPart.java
index f25610f115a..bf6ad53fcac 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActorFloatingLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActorFloatingLabelEditPart.java
@@ -113,15 +113,18 @@ public class ActorFloatingLabelEditPart extends FloatingLabelEditPart implements
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class ActorFloatingLabelEditPart extends FloatingLabelEditPart implements
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class ActorFloatingLabelEditPart extends FloatingLabelEditPart implements
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class ActorFloatingLabelEditPart extends FloatingLabelEditPart implements
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class ActorFloatingLabelEditPart extends FloatingLabelEditPart implements
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class ActorFloatingLabelEditPart extends FloatingLabelEditPart implements
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class ActorFloatingLabelEditPart extends FloatingLabelEditPart implements
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class ActorFloatingLabelEditPart extends FloatingLabelEditPart implements
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class ActorFloatingLabelEditPart extends FloatingLabelEditPart implements
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class ActorFloatingLabelEditPart extends FloatingLabelEditPart implements
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class ActorFloatingLabelEditPart extends FloatingLabelEditPart implements
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class ActorFloatingLabelEditPart extends FloatingLabelEditPart implements
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class ActorFloatingLabelEditPart extends FloatingLabelEditPart implements
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class ActorFloatingLabelEditPart extends FloatingLabelEditPart implements
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Actor_2077, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.ActorFloatingLabelEditPart.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class ActorFloatingLabelEditPart extends FloatingLabelEditPart implements
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class ActorFloatingLabelEditPart extends FloatingLabelEditPart implements
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class ActorFloatingLabelEditPart extends FloatingLabelEditPart implements
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class ActorFloatingLabelEditPart extends FloatingLabelEditPart implements
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class ActorFloatingLabelEditPart extends FloatingLabelEditPart implements
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class ActorFloatingLabelEditPart extends FloatingLabelEditPart implements
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class ActorFloatingLabelEditPart extends FloatingLabelEditPart implements
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class ActorFloatingLabelEditPart extends FloatingLabelEditPart implements
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class ActorFloatingLabelEditPart extends FloatingLabelEditPart implements
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class ActorFloatingLabelEditPart extends FloatingLabelEditPart implements
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class ActorFloatingLabelEditPart extends FloatingLabelEditPart implements
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class ActorFloatingLabelEditPart extends FloatingLabelEditPart implements
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class ActorFloatingLabelEditPart extends FloatingLabelEditPart implements
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class ActorFloatingLabelEditPart extends FloatingLabelEditPart implements
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class ActorFloatingLabelEditPart extends FloatingLabelEditPart implements
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class ActorFloatingLabelEditPart extends FloatingLabelEditPart implements
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class ActorFloatingLabelEditPart extends FloatingLabelEditPart implements
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class ActorFloatingLabelEditPart extends FloatingLabelEditPart implements
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActorFloatingLabelEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActorFloatingLabelEditPartCN.java
index 54d7328a01b..23bbfd5dac4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActorFloatingLabelEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActorFloatingLabelEditPartCN.java
@@ -113,15 +113,18 @@ public class ActorFloatingLabelEditPartCN extends FloatingLabelEditPart implemen
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class ActorFloatingLabelEditPartCN extends FloatingLabelEditPart implemen
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class ActorFloatingLabelEditPartCN extends FloatingLabelEditPart implemen
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class ActorFloatingLabelEditPartCN extends FloatingLabelEditPart implemen
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class ActorFloatingLabelEditPartCN extends FloatingLabelEditPart implemen
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class ActorFloatingLabelEditPartCN extends FloatingLabelEditPart implemen
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class ActorFloatingLabelEditPartCN extends FloatingLabelEditPart implemen
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class ActorFloatingLabelEditPartCN extends FloatingLabelEditPart implemen
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class ActorFloatingLabelEditPartCN extends FloatingLabelEditPart implemen
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class ActorFloatingLabelEditPartCN extends FloatingLabelEditPart implemen
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class ActorFloatingLabelEditPartCN extends FloatingLabelEditPart implemen
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class ActorFloatingLabelEditPartCN extends FloatingLabelEditPart implemen
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class ActorFloatingLabelEditPartCN extends FloatingLabelEditPart implemen
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class ActorFloatingLabelEditPartCN extends FloatingLabelEditPart implemen
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Actor_3091, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.ActorFloatingLabelEditPartCN.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class ActorFloatingLabelEditPartCN extends FloatingLabelEditPart implemen
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class ActorFloatingLabelEditPartCN extends FloatingLabelEditPart implemen
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class ActorFloatingLabelEditPartCN extends FloatingLabelEditPart implemen
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class ActorFloatingLabelEditPartCN extends FloatingLabelEditPart implemen
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class ActorFloatingLabelEditPartCN extends FloatingLabelEditPart implemen
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class ActorFloatingLabelEditPartCN extends FloatingLabelEditPart implemen
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class ActorFloatingLabelEditPartCN extends FloatingLabelEditPart implemen
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class ActorFloatingLabelEditPartCN extends FloatingLabelEditPart implemen
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class ActorFloatingLabelEditPartCN extends FloatingLabelEditPart implemen
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class ActorFloatingLabelEditPartCN extends FloatingLabelEditPart implemen
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class ActorFloatingLabelEditPartCN extends FloatingLabelEditPart implemen
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class ActorFloatingLabelEditPartCN extends FloatingLabelEditPart implemen
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class ActorFloatingLabelEditPartCN extends FloatingLabelEditPart implemen
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class ActorFloatingLabelEditPartCN extends FloatingLabelEditPart implemen
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class ActorFloatingLabelEditPartCN extends FloatingLabelEditPart implemen
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class ActorFloatingLabelEditPartCN extends FloatingLabelEditPart implemen
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class ActorFloatingLabelEditPartCN extends FloatingLabelEditPart implemen
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class ActorFloatingLabelEditPartCN extends FloatingLabelEditPart implemen
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActorNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActorNameEditPart.java
index 944687f095a..2921994f528 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActorNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActorNameEditPart.java
@@ -114,12 +114,14 @@ public class ActorNameEditPart extends PapyrusCompartmentEditPart implements ITe
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class ActorNameEditPart extends PapyrusCompartmentEditPart implements ITe
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class ActorNameEditPart extends PapyrusCompartmentEditPart implements ITe
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class ActorNameEditPart extends PapyrusCompartmentEditPart implements ITe
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class ActorNameEditPart extends PapyrusCompartmentEditPart implements ITe
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class ActorNameEditPart extends PapyrusCompartmentEditPart implements ITe
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class ActorNameEditPart extends PapyrusCompartmentEditPart implements ITe
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class ActorNameEditPart extends PapyrusCompartmentEditPart implements ITe
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class ActorNameEditPart extends PapyrusCompartmentEditPart implements ITe
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class ActorNameEditPart extends PapyrusCompartmentEditPart implements ITe
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class ActorNameEditPart extends PapyrusCompartmentEditPart implements ITe
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class ActorNameEditPart extends PapyrusCompartmentEditPart implements ITe
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class ActorNameEditPart extends PapyrusCompartmentEditPart implements ITe
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Actor_2077, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.ActorNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class ActorNameEditPart extends PapyrusCompartmentEditPart implements ITe
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class ActorNameEditPart extends PapyrusCompartmentEditPart implements ITe
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class ActorNameEditPart extends PapyrusCompartmentEditPart implements ITe
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class ActorNameEditPart extends PapyrusCompartmentEditPart implements ITe
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class ActorNameEditPart extends PapyrusCompartmentEditPart implements ITe
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class ActorNameEditPart extends PapyrusCompartmentEditPart implements ITe
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class ActorNameEditPart extends PapyrusCompartmentEditPart implements ITe
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class ActorNameEditPart extends PapyrusCompartmentEditPart implements ITe
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class ActorNameEditPart extends PapyrusCompartmentEditPart implements ITe
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class ActorNameEditPart extends PapyrusCompartmentEditPart implements ITe
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class ActorNameEditPart extends PapyrusCompartmentEditPart implements ITe
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class ActorNameEditPart extends PapyrusCompartmentEditPart implements ITe
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class ActorNameEditPart extends PapyrusCompartmentEditPart implements ITe
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class ActorNameEditPart extends PapyrusCompartmentEditPart implements ITe
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class ActorNameEditPart extends PapyrusCompartmentEditPart implements ITe
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class ActorNameEditPart extends PapyrusCompartmentEditPart implements ITe
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class ActorNameEditPart extends PapyrusCompartmentEditPart implements ITe
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class ActorNameEditPart extends PapyrusCompartmentEditPart implements ITe
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class ActorNameEditPart extends PapyrusCompartmentEditPart implements ITe
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class ActorNameEditPart extends PapyrusCompartmentEditPart implements ITe
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class ActorNameEditPart extends PapyrusCompartmentEditPart implements ITe
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActorNameEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActorNameEditPartCN.java
index 7e9be3435d0..3f98de5e66e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActorNameEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ActorNameEditPartCN.java
@@ -114,12 +114,14 @@ public class ActorNameEditPartCN extends PapyrusCompartmentEditPart implements I
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class ActorNameEditPartCN extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class ActorNameEditPartCN extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class ActorNameEditPartCN extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class ActorNameEditPartCN extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class ActorNameEditPartCN extends PapyrusCompartmentEditPart implements I
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class ActorNameEditPartCN extends PapyrusCompartmentEditPart implements I
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class ActorNameEditPartCN extends PapyrusCompartmentEditPart implements I
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class ActorNameEditPartCN extends PapyrusCompartmentEditPart implements I
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class ActorNameEditPartCN extends PapyrusCompartmentEditPart implements I
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class ActorNameEditPartCN extends PapyrusCompartmentEditPart implements I
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class ActorNameEditPartCN extends PapyrusCompartmentEditPart implements I
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class ActorNameEditPartCN extends PapyrusCompartmentEditPart implements I
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Actor_3091, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.ActorNameEditPartCN.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class ActorNameEditPartCN extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class ActorNameEditPartCN extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class ActorNameEditPartCN extends PapyrusCompartmentEditPart implements I
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class ActorNameEditPartCN extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class ActorNameEditPartCN extends PapyrusCompartmentEditPart implements I
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class ActorNameEditPartCN extends PapyrusCompartmentEditPart implements I
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class ActorNameEditPartCN extends PapyrusCompartmentEditPart implements I
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class ActorNameEditPartCN extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class ActorNameEditPartCN extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class ActorNameEditPartCN extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class ActorNameEditPartCN extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class ActorNameEditPartCN extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class ActorNameEditPartCN extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class ActorNameEditPartCN extends PapyrusCompartmentEditPart implements I
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class ActorNameEditPartCN extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class ActorNameEditPartCN extends PapyrusCompartmentEditPart implements I
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class ActorNameEditPartCN extends PapyrusCompartmentEditPart implements I
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class ActorNameEditPartCN extends PapyrusCompartmentEditPart implements I
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class ActorNameEditPartCN extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class ActorNameEditPartCN extends PapyrusCompartmentEditPart implements I
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class ActorNameEditPartCN extends PapyrusCompartmentEditPart implements I
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/AnyReceiveEventEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/AnyReceiveEventEditPart.java
index f60228ddab1..7f6dd0d3097 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/AnyReceiveEventEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/AnyReceiveEventEditPart.java
@@ -84,7 +84,9 @@ public class AnyReceiveEventEditPart extends RoundedCompartmentEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
@@ -101,21 +103,21 @@ public class AnyReceiveEventEditPart extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case AnyReceiveEventFloatingLabelEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -135,8 +137,9 @@ public class AnyReceiveEventEditPart extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -154,6 +157,7 @@ public class AnyReceiveEventEditPart extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -165,20 +169,23 @@ public class AnyReceiveEventEditPart extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure
+ *
* @generated
*/
public RoundedCompartmentFigure getPrimaryShape() {
- return (RoundedCompartmentFigure)primaryShape;
+ return (RoundedCompartmentFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof AnyReceiveEventNameEditPart) {
- ((AnyReceiveEventNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof AnyReceiveEventNameEditPart) {
+ ((AnyReceiveEventNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
+
+
return false;
}
@@ -186,7 +193,7 @@ public class AnyReceiveEventEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof AnyReceiveEventNameEditPart) {
+ if (childEditPart instanceof AnyReceiveEventNameEditPart) {
return true;
}
return false;
@@ -196,7 +203,7 @@ public class AnyReceiveEventEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -206,7 +213,7 @@ public class AnyReceiveEventEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -216,7 +223,7 @@ public class AnyReceiveEventEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -226,7 +233,7 @@ public class AnyReceiveEventEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof AnyReceiveEventFloatingLabelEditPart) {
+ if (borderItemEditPart instanceof AnyReceiveEventFloatingLabelEditPart) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -249,16 +256,19 @@ public class AnyReceiveEventEditPart extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -270,7 +280,7 @@ public class AnyReceiveEventEditPart extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -280,7 +290,7 @@ public class AnyReceiveEventEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -296,8 +306,8 @@ public class AnyReceiveEventEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/AnyReceiveEventFloatingLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/AnyReceiveEventFloatingLabelEditPart.java
index 03742612589..74783ffce3a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/AnyReceiveEventFloatingLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/AnyReceiveEventFloatingLabelEditPart.java
@@ -113,15 +113,18 @@ public class AnyReceiveEventFloatingLabelEditPart extends FloatingLabelEditPart
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class AnyReceiveEventFloatingLabelEditPart extends FloatingLabelEditPart
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class AnyReceiveEventFloatingLabelEditPart extends FloatingLabelEditPart
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class AnyReceiveEventFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class AnyReceiveEventFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class AnyReceiveEventFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class AnyReceiveEventFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class AnyReceiveEventFloatingLabelEditPart extends FloatingLabelEditPart
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class AnyReceiveEventFloatingLabelEditPart extends FloatingLabelEditPart
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class AnyReceiveEventFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class AnyReceiveEventFloatingLabelEditPart extends FloatingLabelEditPart
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class AnyReceiveEventFloatingLabelEditPart extends FloatingLabelEditPart
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class AnyReceiveEventFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class AnyReceiveEventFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.AnyReceiveEvent_2085, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.AnyReceiveEventFloatingLabelEditPart.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class AnyReceiveEventFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class AnyReceiveEventFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class AnyReceiveEventFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class AnyReceiveEventFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class AnyReceiveEventFloatingLabelEditPart extends FloatingLabelEditPart
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class AnyReceiveEventFloatingLabelEditPart extends FloatingLabelEditPart
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class AnyReceiveEventFloatingLabelEditPart extends FloatingLabelEditPart
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class AnyReceiveEventFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class AnyReceiveEventFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class AnyReceiveEventFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class AnyReceiveEventFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class AnyReceiveEventFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class AnyReceiveEventFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class AnyReceiveEventFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class AnyReceiveEventFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class AnyReceiveEventFloatingLabelEditPart extends FloatingLabelEditPart
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class AnyReceiveEventFloatingLabelEditPart extends FloatingLabelEditPart
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class AnyReceiveEventFloatingLabelEditPart extends FloatingLabelEditPart
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/AnyReceiveEventNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/AnyReceiveEventNameEditPart.java
index ba96c17fffb..c1b457600b0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/AnyReceiveEventNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/AnyReceiveEventNameEditPart.java
@@ -114,12 +114,14 @@ public class AnyReceiveEventNameEditPart extends PapyrusCompartmentEditPart impl
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class AnyReceiveEventNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class AnyReceiveEventNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class AnyReceiveEventNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class AnyReceiveEventNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class AnyReceiveEventNameEditPart extends PapyrusCompartmentEditPart impl
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class AnyReceiveEventNameEditPart extends PapyrusCompartmentEditPart impl
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class AnyReceiveEventNameEditPart extends PapyrusCompartmentEditPart impl
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class AnyReceiveEventNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class AnyReceiveEventNameEditPart extends PapyrusCompartmentEditPart impl
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class AnyReceiveEventNameEditPart extends PapyrusCompartmentEditPart impl
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class AnyReceiveEventNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class AnyReceiveEventNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.AnyReceiveEvent_2085, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.AnyReceiveEventNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class AnyReceiveEventNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class AnyReceiveEventNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class AnyReceiveEventNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class AnyReceiveEventNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class AnyReceiveEventNameEditPart extends PapyrusCompartmentEditPart impl
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class AnyReceiveEventNameEditPart extends PapyrusCompartmentEditPart impl
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class AnyReceiveEventNameEditPart extends PapyrusCompartmentEditPart impl
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class AnyReceiveEventNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class AnyReceiveEventNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class AnyReceiveEventNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class AnyReceiveEventNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class AnyReceiveEventNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class AnyReceiveEventNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class AnyReceiveEventNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class AnyReceiveEventNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class AnyReceiveEventNameEditPart extends PapyrusCompartmentEditPart impl
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class AnyReceiveEventNameEditPart extends PapyrusCompartmentEditPart impl
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class AnyReceiveEventNameEditPart extends PapyrusCompartmentEditPart impl
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class AnyReceiveEventNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class AnyReceiveEventNameEditPart extends PapyrusCompartmentEditPart impl
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class AnyReceiveEventNameEditPart extends PapyrusCompartmentEditPart impl
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ArtifactEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ArtifactEditPart.java
index 404a439ada2..b86fc05adc7 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ArtifactEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ArtifactEditPart.java
@@ -80,7 +80,9 @@ public class ArtifactEditPart extends NodeEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
@@ -97,21 +99,21 @@ public class ArtifactEditPart extends NodeEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case ArtifactFloatingLabelEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -139,20 +141,23 @@ public class ArtifactEditPart extends NodeEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure
+ *
* @generated
*/
public RoundedCompartmentFigure getPrimaryShape() {
- return (RoundedCompartmentFigure)primaryShape;
+ return (RoundedCompartmentFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ArtifactNameEditPart) {
- ((ArtifactNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof ArtifactNameEditPart) {
+ ((ArtifactNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
+
+
return false;
}
@@ -160,7 +165,7 @@ public class ArtifactEditPart extends NodeEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ArtifactNameEditPart) {
+ if (childEditPart instanceof ArtifactNameEditPart) {
return true;
}
return false;
@@ -170,7 +175,7 @@ public class ArtifactEditPart extends NodeEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -180,7 +185,7 @@ public class ArtifactEditPart extends NodeEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -190,7 +195,7 @@ public class ArtifactEditPart extends NodeEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -200,7 +205,7 @@ public class ArtifactEditPart extends NodeEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof ArtifactFloatingLabelEditPart) {
+ if (borderItemEditPart instanceof ArtifactFloatingLabelEditPart) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -223,16 +228,19 @@ public class ArtifactEditPart extends NodeEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -244,7 +252,7 @@ public class ArtifactEditPart extends NodeEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -254,7 +262,7 @@ public class ArtifactEditPart extends NodeEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -270,8 +278,8 @@ public class ArtifactEditPart extends NodeEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ArtifactEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ArtifactEditPartCN.java
index c25b4f51cb4..134637003e6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ArtifactEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ArtifactEditPartCN.java
@@ -80,7 +80,9 @@ public class ArtifactEditPartCN extends NodeEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
@@ -97,21 +99,21 @@ public class ArtifactEditPartCN extends NodeEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case ArtifactFloatingLabelEditPartCN.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -139,20 +141,23 @@ public class ArtifactEditPartCN extends NodeEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure
+ *
* @generated
*/
public RoundedCompartmentFigure getPrimaryShape() {
- return (RoundedCompartmentFigure)primaryShape;
+ return (RoundedCompartmentFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ArtifactNameEditPartCN) {
- ((ArtifactNameEditPartCN)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof ArtifactNameEditPartCN) {
+ ((ArtifactNameEditPartCN) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
+
+
return false;
}
@@ -160,7 +165,7 @@ public class ArtifactEditPartCN extends NodeEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ArtifactNameEditPartCN) {
+ if (childEditPart instanceof ArtifactNameEditPartCN) {
return true;
}
return false;
@@ -170,7 +175,7 @@ public class ArtifactEditPartCN extends NodeEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -180,7 +185,7 @@ public class ArtifactEditPartCN extends NodeEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -190,7 +195,7 @@ public class ArtifactEditPartCN extends NodeEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -200,7 +205,7 @@ public class ArtifactEditPartCN extends NodeEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof ArtifactFloatingLabelEditPartCN) {
+ if (borderItemEditPart instanceof ArtifactFloatingLabelEditPartCN) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -223,16 +228,19 @@ public class ArtifactEditPartCN extends NodeEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -244,7 +252,7 @@ public class ArtifactEditPartCN extends NodeEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -254,7 +262,7 @@ public class ArtifactEditPartCN extends NodeEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -270,8 +278,8 @@ public class ArtifactEditPartCN extends NodeEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ArtifactFloatingLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ArtifactFloatingLabelEditPart.java
index a3878f3eb1f..9ea52f04d2c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ArtifactFloatingLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ArtifactFloatingLabelEditPart.java
@@ -113,15 +113,18 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Artifact_2079, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.ArtifactFloatingLabelEditPart.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class ArtifactFloatingLabelEditPart extends FloatingLabelEditPart impleme
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ArtifactFloatingLabelEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ArtifactFloatingLabelEditPartCN.java
index ce3d6a4061e..cd4e688ab7f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ArtifactFloatingLabelEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ArtifactFloatingLabelEditPartCN.java
@@ -113,15 +113,18 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Artifact_3093, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.ArtifactFloatingLabelEditPartCN.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class ArtifactFloatingLabelEditPartCN extends FloatingLabelEditPart imple
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ArtifactNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ArtifactNameEditPart.java
index b54edeb3068..1140cd53f53 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ArtifactNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ArtifactNameEditPart.java
@@ -114,12 +114,14 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Artifact_2079, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.ArtifactNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class ArtifactNameEditPart extends PapyrusCompartmentEditPart implements
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ArtifactNameEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ArtifactNameEditPartCN.java
index 71cccffc027..fec47440f67 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ArtifactNameEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ArtifactNameEditPartCN.java
@@ -114,12 +114,14 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Artifact_3093, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.ArtifactNameEditPartCN.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class ArtifactNameEditPartCN extends PapyrusCompartmentEditPart implement
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/BehaviorPortEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/BehaviorPortEditPart.java
index 1378ca6b976..689b78d75b3 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/BehaviorPortEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/BehaviorPortEditPart.java
@@ -80,7 +80,9 @@ public class BehaviorPortEditPart extends AbstractBehaviorPortEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
removeEditPolicy(EditPolicyRoles.SEMANTIC_ROLE);
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(BehaviorSymbolEditPolicy.BEHAVIOR_SYMBOL, new BehaviorSymbolEditPolicy());
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new NoConnectableEditPolicy());
@@ -97,21 +99,21 @@ public class BehaviorPortEditPart extends AbstractBehaviorPortEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case BehaviorPortFloatingLabelEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -131,8 +133,9 @@ public class BehaviorPortEditPart extends AbstractBehaviorPortEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -150,6 +153,7 @@ public class BehaviorPortEditPart extends AbstractBehaviorPortEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -161,17 +165,18 @@ public class BehaviorPortEditPart extends AbstractBehaviorPortEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure
+ *
* @generated
*/
public RoundedCompartmentFigure getPrimaryShape() {
- return (RoundedCompartmentFigure)primaryShape;
+ return (RoundedCompartmentFigure) primaryShape;
}
/**
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof BehaviorPortFloatingLabelEditPart) {
+ if (borderItemEditPart instanceof BehaviorPortFloatingLabelEditPart) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -194,12 +199,15 @@ public class BehaviorPortEditPart extends AbstractBehaviorPortEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
@@ -210,7 +218,7 @@ public class BehaviorPortEditPart extends AbstractBehaviorPortEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -220,7 +228,7 @@ public class BehaviorPortEditPart extends AbstractBehaviorPortEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -236,8 +244,8 @@ public class BehaviorPortEditPart extends AbstractBehaviorPortEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/BehaviorPortFloatingLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/BehaviorPortFloatingLabelEditPart.java
index 7fc63f8211b..f2e2441a9d6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/BehaviorPortFloatingLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/BehaviorPortFloatingLabelEditPart.java
@@ -113,15 +113,18 @@ public class BehaviorPortFloatingLabelEditPart extends FloatingLabelEditPart imp
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class BehaviorPortFloatingLabelEditPart extends FloatingLabelEditPart imp
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class BehaviorPortFloatingLabelEditPart extends FloatingLabelEditPart imp
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class BehaviorPortFloatingLabelEditPart extends FloatingLabelEditPart imp
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class BehaviorPortFloatingLabelEditPart extends FloatingLabelEditPart imp
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class BehaviorPortFloatingLabelEditPart extends FloatingLabelEditPart imp
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class BehaviorPortFloatingLabelEditPart extends FloatingLabelEditPart imp
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class BehaviorPortFloatingLabelEditPart extends FloatingLabelEditPart imp
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class BehaviorPortFloatingLabelEditPart extends FloatingLabelEditPart imp
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class BehaviorPortFloatingLabelEditPart extends FloatingLabelEditPart imp
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class BehaviorPortFloatingLabelEditPart extends FloatingLabelEditPart imp
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class BehaviorPortFloatingLabelEditPart extends FloatingLabelEditPart imp
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class BehaviorPortFloatingLabelEditPart extends FloatingLabelEditPart imp
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class BehaviorPortFloatingLabelEditPart extends FloatingLabelEditPart imp
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Node_3121, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.BehaviorPortFloatingLabelEditPart.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class BehaviorPortFloatingLabelEditPart extends FloatingLabelEditPart imp
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class BehaviorPortFloatingLabelEditPart extends FloatingLabelEditPart imp
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class BehaviorPortFloatingLabelEditPart extends FloatingLabelEditPart imp
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class BehaviorPortFloatingLabelEditPart extends FloatingLabelEditPart imp
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class BehaviorPortFloatingLabelEditPart extends FloatingLabelEditPart imp
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class BehaviorPortFloatingLabelEditPart extends FloatingLabelEditPart imp
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class BehaviorPortFloatingLabelEditPart extends FloatingLabelEditPart imp
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class BehaviorPortFloatingLabelEditPart extends FloatingLabelEditPart imp
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class BehaviorPortFloatingLabelEditPart extends FloatingLabelEditPart imp
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class BehaviorPortFloatingLabelEditPart extends FloatingLabelEditPart imp
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class BehaviorPortFloatingLabelEditPart extends FloatingLabelEditPart imp
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class BehaviorPortFloatingLabelEditPart extends FloatingLabelEditPart imp
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class BehaviorPortFloatingLabelEditPart extends FloatingLabelEditPart imp
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class BehaviorPortFloatingLabelEditPart extends FloatingLabelEditPart imp
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class BehaviorPortFloatingLabelEditPart extends FloatingLabelEditPart imp
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class BehaviorPortFloatingLabelEditPart extends FloatingLabelEditPart imp
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class BehaviorPortFloatingLabelEditPart extends FloatingLabelEditPart imp
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class BehaviorPortFloatingLabelEditPart extends FloatingLabelEditPart imp
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/BehaviorPortLinkEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/BehaviorPortLinkEditPart.java
index d84d1ba272a..51613af4a0b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/BehaviorPortLinkEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/BehaviorPortLinkEditPart.java
@@ -66,6 +66,6 @@ public class BehaviorPortLinkEditPart extends ConnectionEditPart implements ITre
* @generated
*/
public PolylineConnectionEx getPrimaryShape() {
- return (PolylineConnectionEx)getFigure();
+ return (PolylineConnectionEx) getFigure();
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CallEventEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CallEventEditPart.java
index 5238f636142..b50ea55882d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CallEventEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CallEventEditPart.java
@@ -84,7 +84,9 @@ public class CallEventEditPart extends RoundedCompartmentEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
@@ -101,21 +103,21 @@ public class CallEventEditPart extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case CallEventFloatingLabelEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -135,8 +137,9 @@ public class CallEventEditPart extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -154,6 +157,7 @@ public class CallEventEditPart extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -165,20 +169,23 @@ public class CallEventEditPart extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure
+ *
* @generated
*/
public RoundedCompartmentFigure getPrimaryShape() {
- return (RoundedCompartmentFigure)primaryShape;
+ return (RoundedCompartmentFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof CallEventNameEditPart) {
- ((CallEventNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof CallEventNameEditPart) {
+ ((CallEventNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
+
+
return false;
}
@@ -186,7 +193,7 @@ public class CallEventEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof CallEventNameEditPart) {
+ if (childEditPart instanceof CallEventNameEditPart) {
return true;
}
return false;
@@ -196,7 +203,7 @@ public class CallEventEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -206,7 +213,7 @@ public class CallEventEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -216,7 +223,7 @@ public class CallEventEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -226,7 +233,7 @@ public class CallEventEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof CallEventFloatingLabelEditPart) {
+ if (borderItemEditPart instanceof CallEventFloatingLabelEditPart) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -249,16 +256,19 @@ public class CallEventEditPart extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -270,7 +280,7 @@ public class CallEventEditPart extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -280,7 +290,7 @@ public class CallEventEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -296,8 +306,8 @@ public class CallEventEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CallEventFloatingLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CallEventFloatingLabelEditPart.java
index ff3d6ce52a6..83d36e2b06c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CallEventFloatingLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CallEventFloatingLabelEditPart.java
@@ -113,15 +113,18 @@ public class CallEventFloatingLabelEditPart extends FloatingLabelEditPart implem
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class CallEventFloatingLabelEditPart extends FloatingLabelEditPart implem
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class CallEventFloatingLabelEditPart extends FloatingLabelEditPart implem
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class CallEventFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class CallEventFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class CallEventFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class CallEventFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class CallEventFloatingLabelEditPart extends FloatingLabelEditPart implem
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class CallEventFloatingLabelEditPart extends FloatingLabelEditPart implem
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class CallEventFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class CallEventFloatingLabelEditPart extends FloatingLabelEditPart implem
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class CallEventFloatingLabelEditPart extends FloatingLabelEditPart implem
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class CallEventFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class CallEventFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.CallEvent_2084, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.CallEventFloatingLabelEditPart.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class CallEventFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class CallEventFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class CallEventFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class CallEventFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class CallEventFloatingLabelEditPart extends FloatingLabelEditPart implem
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class CallEventFloatingLabelEditPart extends FloatingLabelEditPart implem
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class CallEventFloatingLabelEditPart extends FloatingLabelEditPart implem
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class CallEventFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class CallEventFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class CallEventFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class CallEventFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class CallEventFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class CallEventFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class CallEventFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class CallEventFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class CallEventFloatingLabelEditPart extends FloatingLabelEditPart implem
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class CallEventFloatingLabelEditPart extends FloatingLabelEditPart implem
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class CallEventFloatingLabelEditPart extends FloatingLabelEditPart implem
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CallEventNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CallEventNameEditPart.java
index 99cb6b6d694..513b0c4af7e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CallEventNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CallEventNameEditPart.java
@@ -114,12 +114,14 @@ public class CallEventNameEditPart extends PapyrusCompartmentEditPart implements
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class CallEventNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class CallEventNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class CallEventNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class CallEventNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class CallEventNameEditPart extends PapyrusCompartmentEditPart implements
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class CallEventNameEditPart extends PapyrusCompartmentEditPart implements
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class CallEventNameEditPart extends PapyrusCompartmentEditPart implements
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class CallEventNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class CallEventNameEditPart extends PapyrusCompartmentEditPart implements
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class CallEventNameEditPart extends PapyrusCompartmentEditPart implements
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class CallEventNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class CallEventNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.CallEvent_2084, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.CallEventNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class CallEventNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class CallEventNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class CallEventNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class CallEventNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class CallEventNameEditPart extends PapyrusCompartmentEditPart implements
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class CallEventNameEditPart extends PapyrusCompartmentEditPart implements
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class CallEventNameEditPart extends PapyrusCompartmentEditPart implements
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class CallEventNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class CallEventNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class CallEventNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class CallEventNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class CallEventNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class CallEventNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class CallEventNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class CallEventNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class CallEventNameEditPart extends PapyrusCompartmentEditPart implements
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class CallEventNameEditPart extends PapyrusCompartmentEditPart implements
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class CallEventNameEditPart extends PapyrusCompartmentEditPart implements
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class CallEventNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class CallEventNameEditPart extends PapyrusCompartmentEditPart implements
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class CallEventNameEditPart extends PapyrusCompartmentEditPart implements
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ChangeEventEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ChangeEventEditPart.java
index 2f5ee5cbc3a..5afc5f12598 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ChangeEventEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ChangeEventEditPart.java
@@ -84,7 +84,9 @@ public class ChangeEventEditPart extends RoundedCompartmentEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
@@ -101,21 +103,21 @@ public class ChangeEventEditPart extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case ChangeEventFloatingLabelEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -135,8 +137,9 @@ public class ChangeEventEditPart extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -154,6 +157,7 @@ public class ChangeEventEditPart extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -165,20 +169,23 @@ public class ChangeEventEditPart extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure
+ *
* @generated
*/
public RoundedCompartmentFigure getPrimaryShape() {
- return (RoundedCompartmentFigure)primaryShape;
+ return (RoundedCompartmentFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ChangeEventNameEditPart) {
- ((ChangeEventNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof ChangeEventNameEditPart) {
+ ((ChangeEventNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
+
+
return false;
}
@@ -186,7 +193,7 @@ public class ChangeEventEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ChangeEventNameEditPart) {
+ if (childEditPart instanceof ChangeEventNameEditPart) {
return true;
}
return false;
@@ -196,7 +203,7 @@ public class ChangeEventEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -206,7 +213,7 @@ public class ChangeEventEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -216,7 +223,7 @@ public class ChangeEventEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -226,7 +233,7 @@ public class ChangeEventEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof ChangeEventFloatingLabelEditPart) {
+ if (borderItemEditPart instanceof ChangeEventFloatingLabelEditPart) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -249,16 +256,19 @@ public class ChangeEventEditPart extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -270,7 +280,7 @@ public class ChangeEventEditPart extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -280,7 +290,7 @@ public class ChangeEventEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -296,8 +306,8 @@ public class ChangeEventEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ChangeEventFloatingLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ChangeEventFloatingLabelEditPart.java
index 13d4cc36334..b303e26e3c3 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ChangeEventFloatingLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ChangeEventFloatingLabelEditPart.java
@@ -113,15 +113,18 @@ public class ChangeEventFloatingLabelEditPart extends FloatingLabelEditPart impl
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class ChangeEventFloatingLabelEditPart extends FloatingLabelEditPart impl
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class ChangeEventFloatingLabelEditPart extends FloatingLabelEditPart impl
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class ChangeEventFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class ChangeEventFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class ChangeEventFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class ChangeEventFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class ChangeEventFloatingLabelEditPart extends FloatingLabelEditPart impl
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class ChangeEventFloatingLabelEditPart extends FloatingLabelEditPart impl
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class ChangeEventFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class ChangeEventFloatingLabelEditPart extends FloatingLabelEditPart impl
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class ChangeEventFloatingLabelEditPart extends FloatingLabelEditPart impl
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class ChangeEventFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class ChangeEventFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.ChangeEvent_2088, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.ChangeEventFloatingLabelEditPart.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class ChangeEventFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class ChangeEventFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class ChangeEventFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class ChangeEventFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class ChangeEventFloatingLabelEditPart extends FloatingLabelEditPart impl
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class ChangeEventFloatingLabelEditPart extends FloatingLabelEditPart impl
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class ChangeEventFloatingLabelEditPart extends FloatingLabelEditPart impl
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class ChangeEventFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class ChangeEventFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class ChangeEventFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class ChangeEventFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class ChangeEventFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class ChangeEventFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class ChangeEventFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class ChangeEventFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class ChangeEventFloatingLabelEditPart extends FloatingLabelEditPart impl
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class ChangeEventFloatingLabelEditPart extends FloatingLabelEditPart impl
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class ChangeEventFloatingLabelEditPart extends FloatingLabelEditPart impl
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ChangeEventNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ChangeEventNameEditPart.java
index 850552f72b4..8fb37ce23a9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ChangeEventNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ChangeEventNameEditPart.java
@@ -114,12 +114,14 @@ public class ChangeEventNameEditPart extends PapyrusCompartmentEditPart implemen
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class ChangeEventNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class ChangeEventNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class ChangeEventNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class ChangeEventNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class ChangeEventNameEditPart extends PapyrusCompartmentEditPart implemen
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class ChangeEventNameEditPart extends PapyrusCompartmentEditPart implemen
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class ChangeEventNameEditPart extends PapyrusCompartmentEditPart implemen
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class ChangeEventNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class ChangeEventNameEditPart extends PapyrusCompartmentEditPart implemen
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class ChangeEventNameEditPart extends PapyrusCompartmentEditPart implemen
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class ChangeEventNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class ChangeEventNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.ChangeEvent_2088, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.ChangeEventNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class ChangeEventNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class ChangeEventNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class ChangeEventNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class ChangeEventNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class ChangeEventNameEditPart extends PapyrusCompartmentEditPart implemen
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class ChangeEventNameEditPart extends PapyrusCompartmentEditPart implemen
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class ChangeEventNameEditPart extends PapyrusCompartmentEditPart implemen
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class ChangeEventNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class ChangeEventNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class ChangeEventNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class ChangeEventNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class ChangeEventNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class ChangeEventNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class ChangeEventNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class ChangeEventNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class ChangeEventNameEditPart extends PapyrusCompartmentEditPart implemen
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class ChangeEventNameEditPart extends PapyrusCompartmentEditPart implemen
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class ChangeEventNameEditPart extends PapyrusCompartmentEditPart implemen
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class ChangeEventNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class ChangeEventNameEditPart extends PapyrusCompartmentEditPart implemen
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class ChangeEventNameEditPart extends PapyrusCompartmentEditPart implemen
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ClassCompositeCompartmentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ClassCompositeCompartmentEditPart.java
index 42fc8ad680c..16e4f280bb8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ClassCompositeCompartmentEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ClassCompositeCompartmentEditPart.java
@@ -81,7 +81,7 @@ public class ClassCompositeCompartmentEditPart extends LinkLFShapeCompartmentEdi
* @generated
*/
protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
+ if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
super.setRatio(ratio);
}
}
@@ -90,6 +90,7 @@ public class ClassCompositeCompartmentEditPart extends LinkLFShapeCompartmentEdi
* @generated
*/
public EditPart getTargetEditPart(Request request) {
+
return super.getTargetEditPart(request);
}
@@ -98,7 +99,10 @@ public class ClassCompositeCompartmentEditPart extends LinkLFShapeCompartmentEdi
*/
protected void handleNotificationEvent(Notification notification) {
Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
+ if (NotationPackage.eINSTANCE.getSize_Width().equals(feature)
+ || NotationPackage.eINSTANCE.getSize_Height().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_X().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
refreshBounds();
}
super.handleNotificationEvent(notification);
@@ -108,13 +112,16 @@ public class ClassCompositeCompartmentEditPart extends LinkLFShapeCompartmentEdi
* @generated
*/
protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
+ ((GraphicalEditPart) getParent()).setLayoutConstraint(
+ this,
+ getFigure(),
+ new Rectangle(loc, size));
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ClassCompositeCompartmentEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ClassCompositeCompartmentEditPartCN.java
index 4b636948944..4d9ff45b6a7 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ClassCompositeCompartmentEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ClassCompositeCompartmentEditPartCN.java
@@ -81,7 +81,7 @@ public class ClassCompositeCompartmentEditPartCN extends LinkLFShapeCompartmentE
* @generated
*/
protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
+ if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
super.setRatio(ratio);
}
}
@@ -90,6 +90,7 @@ public class ClassCompositeCompartmentEditPartCN extends LinkLFShapeCompartmentE
* @generated
*/
public EditPart getTargetEditPart(Request request) {
+
return super.getTargetEditPart(request);
}
@@ -98,7 +99,10 @@ public class ClassCompositeCompartmentEditPartCN extends LinkLFShapeCompartmentE
*/
protected void handleNotificationEvent(Notification notification) {
Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
+ if (NotationPackage.eINSTANCE.getSize_Width().equals(feature)
+ || NotationPackage.eINSTANCE.getSize_Height().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_X().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
refreshBounds();
}
super.handleNotificationEvent(notification);
@@ -108,13 +112,16 @@ public class ClassCompositeCompartmentEditPartCN extends LinkLFShapeCompartmentE
* @generated
*/
protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
+ ((GraphicalEditPart) getParent()).setLayoutConstraint(
+ this,
+ getFigure(),
+ new Rectangle(loc, size));
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ClassCompositeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ClassCompositeEditPart.java
index f76803fb0e1..aa87ebb0420 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ClassCompositeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ClassCompositeEditPart.java
@@ -97,7 +97,9 @@ public class ClassCompositeEditPart extends RoundedCompartmentEditPart {
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new DefaultCreationEditPolicy());
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
@@ -178,6 +180,7 @@ public class ClassCompositeEditPart extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -204,18 +207,25 @@ public class ClassCompositeEditPart extends RoundedCompartmentEditPart {
((ClassCompositeNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
+
+
if (childEditPart instanceof ClassCompositeCompartmentEditPart) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
pane.add(((ClassCompositeCompartmentEditPart) childEditPart).getFigure());
return true;
}
+
+
+
// Papyrus Gencode :Affixed Port locator
if (childEditPart instanceof PortEditPart) {
IBorderItemLocator locator = new PortPositionLocator(getMainFigure(), PositionConstants.NONE);
getBorderedFigure().getBorderItemContainer().add(((PortEditPart) childEditPart).getFigure(), locator);
return true;
}
+
+
return false;
}
@@ -298,6 +308,7 @@ public class ClassCompositeEditPart extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ClassCompositeEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ClassCompositeEditPartCN.java
index f2733e83cde..49d0b4cfc91 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ClassCompositeEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ClassCompositeEditPartCN.java
@@ -96,7 +96,9 @@ public class ClassCompositeEditPartCN extends RoundedCompartmentEditPart {
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new DefaultCreationEditPolicy());
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
@@ -120,14 +122,14 @@ public class ClassCompositeEditPartCN extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case ClassCompositeFloatingLabelEditPartCN.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
@@ -136,7 +138,7 @@ public class ClassCompositeEditPartCN extends RoundedCompartmentEditPart {
return new BorderItemResizableEditPolicy();
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -156,8 +158,9 @@ public class ClassCompositeEditPartCN extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -175,6 +178,7 @@ public class ClassCompositeEditPartCN extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -186,32 +190,40 @@ public class ClassCompositeEditPartCN extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.composite.custom.figures.ClassCompositeFigure
+ *
* @generated
*/
public ClassCompositeFigure getPrimaryShape() {
- return (ClassCompositeFigure)primaryShape;
+ return (ClassCompositeFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ClassCompositeNameEditPartCN) {
- ((ClassCompositeNameEditPartCN)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof ClassCompositeNameEditPartCN) {
+ ((ClassCompositeNameEditPartCN) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
- if(childEditPart instanceof ClassCompositeCompartmentEditPartCN) {
+
+
+ if (childEditPart instanceof ClassCompositeCompartmentEditPartCN) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((ClassCompositeCompartmentEditPartCN)childEditPart).getFigure());
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.add(((ClassCompositeCompartmentEditPartCN) childEditPart).getFigure());
return true;
}
- //Papyrus Gencode :Affixed Port locator
- if(childEditPart instanceof PortEditPart) {
+
+
+
+ // Papyrus Gencode :Affixed Port locator
+ if (childEditPart instanceof PortEditPart) {
IBorderItemLocator locator = new PortPositionLocator(getMainFigure(), PositionConstants.NONE);
- getBorderedFigure().getBorderItemContainer().add(((PortEditPart)childEditPart).getFigure(), locator);
+ getBorderedFigure().getBorderItemContainer().add(((PortEditPart) childEditPart).getFigure(), locator);
return true;
}
+
+
return false;
}
@@ -219,16 +231,16 @@ public class ClassCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ClassCompositeNameEditPartCN) {
+ if (childEditPart instanceof ClassCompositeNameEditPartCN) {
return true;
}
- if(childEditPart instanceof ClassCompositeCompartmentEditPartCN) {
+ if (childEditPart instanceof ClassCompositeCompartmentEditPartCN) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- pane.remove(((ClassCompositeCompartmentEditPartCN)childEditPart).getFigure());
+ pane.remove(((ClassCompositeCompartmentEditPartCN) childEditPart).getFigure());
return true;
}
- if(childEditPart instanceof PortEditPart) {
- getBorderedFigure().getBorderItemContainer().remove(((PortEditPart)childEditPart).getFigure());
+ if (childEditPart instanceof PortEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((PortEditPart) childEditPart).getFigure());
return true;
}
return false;
@@ -238,7 +250,7 @@ public class ClassCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -248,7 +260,7 @@ public class ClassCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -258,10 +270,10 @@ public class ClassCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof ClassCompositeCompartmentEditPartCN) {
+ if (editPart instanceof ClassCompositeCompartmentEditPartCN) {
return getPrimaryShape().getCompositeCompartmentFigure();
}
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -271,7 +283,7 @@ public class ClassCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof ClassCompositeFloatingLabelEditPartCN) {
+ if (borderItemEditPart instanceof ClassCompositeFloatingLabelEditPartCN) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -294,16 +306,19 @@ public class ClassCompositeEditPartCN extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -315,7 +330,7 @@ public class ClassCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -325,7 +340,7 @@ public class ClassCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -341,8 +356,8 @@ public class ClassCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ClassCompositeFloatingLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ClassCompositeFloatingLabelEditPart.java
index 5a393e0e450..9a576218ade 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ClassCompositeFloatingLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ClassCompositeFloatingLabelEditPart.java
@@ -113,15 +113,18 @@ public class ClassCompositeFloatingLabelEditPart extends FloatingLabelEditPart i
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class ClassCompositeFloatingLabelEditPart extends FloatingLabelEditPart i
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class ClassCompositeFloatingLabelEditPart extends FloatingLabelEditPart i
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class ClassCompositeFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class ClassCompositeFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class ClassCompositeFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class ClassCompositeFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class ClassCompositeFloatingLabelEditPart extends FloatingLabelEditPart i
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class ClassCompositeFloatingLabelEditPart extends FloatingLabelEditPart i
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class ClassCompositeFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class ClassCompositeFloatingLabelEditPart extends FloatingLabelEditPart i
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class ClassCompositeFloatingLabelEditPart extends FloatingLabelEditPart i
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class ClassCompositeFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class ClassCompositeFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Class_2073, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.ClassCompositeFloatingLabelEditPart.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class ClassCompositeFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class ClassCompositeFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class ClassCompositeFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class ClassCompositeFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class ClassCompositeFloatingLabelEditPart extends FloatingLabelEditPart i
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class ClassCompositeFloatingLabelEditPart extends FloatingLabelEditPart i
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class ClassCompositeFloatingLabelEditPart extends FloatingLabelEditPart i
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class ClassCompositeFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class ClassCompositeFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class ClassCompositeFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class ClassCompositeFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class ClassCompositeFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class ClassCompositeFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class ClassCompositeFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class ClassCompositeFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class ClassCompositeFloatingLabelEditPart extends FloatingLabelEditPart i
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class ClassCompositeFloatingLabelEditPart extends FloatingLabelEditPart i
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class ClassCompositeFloatingLabelEditPart extends FloatingLabelEditPart i
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ClassCompositeFloatingLabelEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ClassCompositeFloatingLabelEditPartCN.java
index c139b4ffa25..d37a891aeb3 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ClassCompositeFloatingLabelEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ClassCompositeFloatingLabelEditPartCN.java
@@ -113,15 +113,18 @@ public class ClassCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class ClassCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class ClassCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class ClassCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class ClassCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class ClassCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class ClassCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class ClassCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class ClassCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class ClassCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class ClassCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class ClassCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class ClassCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class ClassCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Class_3085, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.ClassCompositeFloatingLabelEditPartCN.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class ClassCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class ClassCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class ClassCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class ClassCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class ClassCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class ClassCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class ClassCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class ClassCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class ClassCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class ClassCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class ClassCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class ClassCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class ClassCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class ClassCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class ClassCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class ClassCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class ClassCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class ClassCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ClassCompositeNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ClassCompositeNameEditPart.java
index 3417204858a..5992fad2e01 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ClassCompositeNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ClassCompositeNameEditPart.java
@@ -114,12 +114,14 @@ public class ClassCompositeNameEditPart extends PapyrusCompartmentEditPart imple
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class ClassCompositeNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class ClassCompositeNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class ClassCompositeNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class ClassCompositeNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class ClassCompositeNameEditPart extends PapyrusCompartmentEditPart imple
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class ClassCompositeNameEditPart extends PapyrusCompartmentEditPart imple
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class ClassCompositeNameEditPart extends PapyrusCompartmentEditPart imple
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class ClassCompositeNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class ClassCompositeNameEditPart extends PapyrusCompartmentEditPart imple
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class ClassCompositeNameEditPart extends PapyrusCompartmentEditPart imple
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class ClassCompositeNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class ClassCompositeNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Class_2073, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.ClassCompositeNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class ClassCompositeNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class ClassCompositeNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class ClassCompositeNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class ClassCompositeNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class ClassCompositeNameEditPart extends PapyrusCompartmentEditPart imple
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class ClassCompositeNameEditPart extends PapyrusCompartmentEditPart imple
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class ClassCompositeNameEditPart extends PapyrusCompartmentEditPart imple
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class ClassCompositeNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class ClassCompositeNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class ClassCompositeNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class ClassCompositeNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class ClassCompositeNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class ClassCompositeNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class ClassCompositeNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class ClassCompositeNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class ClassCompositeNameEditPart extends PapyrusCompartmentEditPart imple
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class ClassCompositeNameEditPart extends PapyrusCompartmentEditPart imple
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class ClassCompositeNameEditPart extends PapyrusCompartmentEditPart imple
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class ClassCompositeNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class ClassCompositeNameEditPart extends PapyrusCompartmentEditPart imple
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class ClassCompositeNameEditPart extends PapyrusCompartmentEditPart imple
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ClassCompositeNameEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ClassCompositeNameEditPartCN.java
index c505e499c38..ea28d33242f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ClassCompositeNameEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ClassCompositeNameEditPartCN.java
@@ -114,12 +114,14 @@ public class ClassCompositeNameEditPartCN extends PapyrusCompartmentEditPart imp
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class ClassCompositeNameEditPartCN extends PapyrusCompartmentEditPart imp
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class ClassCompositeNameEditPartCN extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class ClassCompositeNameEditPartCN extends PapyrusCompartmentEditPart imp
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class ClassCompositeNameEditPartCN extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class ClassCompositeNameEditPartCN extends PapyrusCompartmentEditPart imp
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class ClassCompositeNameEditPartCN extends PapyrusCompartmentEditPart imp
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class ClassCompositeNameEditPartCN extends PapyrusCompartmentEditPart imp
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class ClassCompositeNameEditPartCN extends PapyrusCompartmentEditPart imp
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class ClassCompositeNameEditPartCN extends PapyrusCompartmentEditPart imp
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class ClassCompositeNameEditPartCN extends PapyrusCompartmentEditPart imp
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class ClassCompositeNameEditPartCN extends PapyrusCompartmentEditPart imp
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class ClassCompositeNameEditPartCN extends PapyrusCompartmentEditPart imp
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Class_3085, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.ClassCompositeNameEditPartCN.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class ClassCompositeNameEditPartCN extends PapyrusCompartmentEditPart imp
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class ClassCompositeNameEditPartCN extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class ClassCompositeNameEditPartCN extends PapyrusCompartmentEditPart imp
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class ClassCompositeNameEditPartCN extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class ClassCompositeNameEditPartCN extends PapyrusCompartmentEditPart imp
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class ClassCompositeNameEditPartCN extends PapyrusCompartmentEditPart imp
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class ClassCompositeNameEditPartCN extends PapyrusCompartmentEditPart imp
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class ClassCompositeNameEditPartCN extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class ClassCompositeNameEditPartCN extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class ClassCompositeNameEditPartCN extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class ClassCompositeNameEditPartCN extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class ClassCompositeNameEditPartCN extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class ClassCompositeNameEditPartCN extends PapyrusCompartmentEditPart imp
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class ClassCompositeNameEditPartCN extends PapyrusCompartmentEditPart imp
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class ClassCompositeNameEditPartCN extends PapyrusCompartmentEditPart imp
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class ClassCompositeNameEditPartCN extends PapyrusCompartmentEditPart imp
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class ClassCompositeNameEditPartCN extends PapyrusCompartmentEditPart imp
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class ClassCompositeNameEditPartCN extends PapyrusCompartmentEditPart imp
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class ClassCompositeNameEditPartCN extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class ClassCompositeNameEditPartCN extends PapyrusCompartmentEditPart imp
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class ClassCompositeNameEditPartCN extends PapyrusCompartmentEditPart imp
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationCompositeCompartmentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationCompositeCompartmentEditPart.java
index 00cebbbc9f2..970c6332630 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationCompositeCompartmentEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationCompositeCompartmentEditPart.java
@@ -79,7 +79,7 @@ public class CollaborationCompositeCompartmentEditPart extends LinkLFShapeCompar
* @generated
*/
protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
+ if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
super.setRatio(ratio);
}
}
@@ -88,6 +88,7 @@ public class CollaborationCompositeCompartmentEditPart extends LinkLFShapeCompar
* @generated
*/
public EditPart getTargetEditPart(Request request) {
+
return super.getTargetEditPart(request);
}
@@ -96,7 +97,10 @@ public class CollaborationCompositeCompartmentEditPart extends LinkLFShapeCompar
*/
protected void handleNotificationEvent(Notification notification) {
Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
+ if (NotationPackage.eINSTANCE.getSize_Width().equals(feature)
+ || NotationPackage.eINSTANCE.getSize_Height().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_X().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
refreshBounds();
}
super.handleNotificationEvent(notification);
@@ -106,13 +110,16 @@ public class CollaborationCompositeCompartmentEditPart extends LinkLFShapeCompar
* @generated
*/
protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
+ ((GraphicalEditPart) getParent()).setLayoutConstraint(
+ this,
+ getFigure(),
+ new Rectangle(loc, size));
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationCompositeCompartmentEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationCompositeCompartmentEditPartCN.java
index 4fc39ac1f91..d6f309c46cc 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationCompositeCompartmentEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationCompositeCompartmentEditPartCN.java
@@ -79,7 +79,7 @@ public class CollaborationCompositeCompartmentEditPartCN extends LinkLFShapeComp
* @generated
*/
protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
+ if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
super.setRatio(ratio);
}
}
@@ -88,6 +88,7 @@ public class CollaborationCompositeCompartmentEditPartCN extends LinkLFShapeComp
* @generated
*/
public EditPart getTargetEditPart(Request request) {
+
return super.getTargetEditPart(request);
}
@@ -96,7 +97,10 @@ public class CollaborationCompositeCompartmentEditPartCN extends LinkLFShapeComp
*/
protected void handleNotificationEvent(Notification notification) {
Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
+ if (NotationPackage.eINSTANCE.getSize_Width().equals(feature)
+ || NotationPackage.eINSTANCE.getSize_Height().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_X().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
refreshBounds();
}
super.handleNotificationEvent(notification);
@@ -106,13 +110,16 @@ public class CollaborationCompositeCompartmentEditPartCN extends LinkLFShapeComp
* @generated
*/
protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
+ ((GraphicalEditPart) getParent()).setLayoutConstraint(
+ this,
+ getFigure(),
+ new Rectangle(loc, size));
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationCompositeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationCompositeEditPart.java
index 0d5244bf8c2..7578dd04343 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationCompositeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationCompositeEditPart.java
@@ -87,7 +87,9 @@ public class CollaborationCompositeEditPart extends RoundedCompartmentEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
@@ -107,21 +109,21 @@ public class CollaborationCompositeEditPart extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case CollaborationCompositeFloatingLabelEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -141,8 +143,9 @@ public class CollaborationCompositeEditPart extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -160,6 +163,7 @@ public class CollaborationCompositeEditPart extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -171,26 +175,30 @@ public class CollaborationCompositeEditPart extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.composite.custom.figures.CollaborationCompositeFigure
+ *
* @generated
*/
public CollaborationCompositeFigure getPrimaryShape() {
- return (CollaborationCompositeFigure)primaryShape;
+ return (CollaborationCompositeFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof CollaborationCompositeNameEditPart) {
- ((CollaborationCompositeNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof CollaborationCompositeNameEditPart) {
+ ((CollaborationCompositeNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
- if(childEditPart instanceof CollaborationCompositeCompartmentEditPart) {
+
+
+ if (childEditPart instanceof CollaborationCompositeCompartmentEditPart) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((CollaborationCompositeCompartmentEditPart)childEditPart).getFigure());
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.add(((CollaborationCompositeCompartmentEditPart) childEditPart).getFigure());
return true;
}
+
return false;
}
@@ -198,12 +206,12 @@ public class CollaborationCompositeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof CollaborationCompositeNameEditPart) {
+ if (childEditPart instanceof CollaborationCompositeNameEditPart) {
return true;
}
- if(childEditPart instanceof CollaborationCompositeCompartmentEditPart) {
+ if (childEditPart instanceof CollaborationCompositeCompartmentEditPart) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- pane.remove(((CollaborationCompositeCompartmentEditPart)childEditPart).getFigure());
+ pane.remove(((CollaborationCompositeCompartmentEditPart) childEditPart).getFigure());
return true;
}
return false;
@@ -213,7 +221,7 @@ public class CollaborationCompositeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -223,7 +231,7 @@ public class CollaborationCompositeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -233,10 +241,10 @@ public class CollaborationCompositeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof CollaborationCompositeCompartmentEditPart) {
+ if (editPart instanceof CollaborationCompositeCompartmentEditPart) {
return getPrimaryShape().getCompositeCompartmentFigure();
}
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -246,7 +254,7 @@ public class CollaborationCompositeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof CollaborationCompositeFloatingLabelEditPart) {
+ if (borderItemEditPart instanceof CollaborationCompositeFloatingLabelEditPart) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -269,16 +277,19 @@ public class CollaborationCompositeEditPart extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -290,7 +301,7 @@ public class CollaborationCompositeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -300,7 +311,7 @@ public class CollaborationCompositeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -316,8 +327,8 @@ public class CollaborationCompositeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationCompositeEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationCompositeEditPartCN.java
index f2b18ee8d6e..d7e5e8178aa 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationCompositeEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationCompositeEditPartCN.java
@@ -87,7 +87,9 @@ public class CollaborationCompositeEditPartCN extends RoundedCompartmentEditPart
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
@@ -107,21 +109,21 @@ public class CollaborationCompositeEditPartCN extends RoundedCompartmentEditPart
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case CollaborationCompositeFloatingLabelEditPartCN.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -141,8 +143,9 @@ public class CollaborationCompositeEditPartCN extends RoundedCompartmentEditPart
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -160,6 +163,7 @@ public class CollaborationCompositeEditPartCN extends RoundedCompartmentEditPart
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -171,26 +175,30 @@ public class CollaborationCompositeEditPartCN extends RoundedCompartmentEditPart
/**
* org.eclipse.papyrus.uml.diagram.composite.custom.figures.CollaborationCompositeFigure
+ *
* @generated
*/
public CollaborationCompositeFigure getPrimaryShape() {
- return (CollaborationCompositeFigure)primaryShape;
+ return (CollaborationCompositeFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof CollaborationCompositeNameEditPartCN) {
- ((CollaborationCompositeNameEditPartCN)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof CollaborationCompositeNameEditPartCN) {
+ ((CollaborationCompositeNameEditPartCN) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
- if(childEditPart instanceof CollaborationCompositeCompartmentEditPartCN) {
+
+
+ if (childEditPart instanceof CollaborationCompositeCompartmentEditPartCN) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((CollaborationCompositeCompartmentEditPartCN)childEditPart).getFigure());
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.add(((CollaborationCompositeCompartmentEditPartCN) childEditPart).getFigure());
return true;
}
+
return false;
}
@@ -198,12 +206,12 @@ public class CollaborationCompositeEditPartCN extends RoundedCompartmentEditPart
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof CollaborationCompositeNameEditPartCN) {
+ if (childEditPart instanceof CollaborationCompositeNameEditPartCN) {
return true;
}
- if(childEditPart instanceof CollaborationCompositeCompartmentEditPartCN) {
+ if (childEditPart instanceof CollaborationCompositeCompartmentEditPartCN) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- pane.remove(((CollaborationCompositeCompartmentEditPartCN)childEditPart).getFigure());
+ pane.remove(((CollaborationCompositeCompartmentEditPartCN) childEditPart).getFigure());
return true;
}
return false;
@@ -213,7 +221,7 @@ public class CollaborationCompositeEditPartCN extends RoundedCompartmentEditPart
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -223,7 +231,7 @@ public class CollaborationCompositeEditPartCN extends RoundedCompartmentEditPart
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -233,10 +241,10 @@ public class CollaborationCompositeEditPartCN extends RoundedCompartmentEditPart
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof CollaborationCompositeCompartmentEditPartCN) {
+ if (editPart instanceof CollaborationCompositeCompartmentEditPartCN) {
return getPrimaryShape().getCompositeCompartmentFigure();
}
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -246,7 +254,7 @@ public class CollaborationCompositeEditPartCN extends RoundedCompartmentEditPart
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof CollaborationCompositeFloatingLabelEditPartCN) {
+ if (borderItemEditPart instanceof CollaborationCompositeFloatingLabelEditPartCN) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -269,16 +277,19 @@ public class CollaborationCompositeEditPartCN extends RoundedCompartmentEditPart
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -290,7 +301,7 @@ public class CollaborationCompositeEditPartCN extends RoundedCompartmentEditPart
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -300,7 +311,7 @@ public class CollaborationCompositeEditPartCN extends RoundedCompartmentEditPart
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -316,8 +327,8 @@ public class CollaborationCompositeEditPartCN extends RoundedCompartmentEditPart
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationCompositeFloatingLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationCompositeFloatingLabelEditPart.java
index 3aa6055f464..08089c93d76 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationCompositeFloatingLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationCompositeFloatingLabelEditPart.java
@@ -113,15 +113,18 @@ public class CollaborationCompositeFloatingLabelEditPart extends FloatingLabelEd
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class CollaborationCompositeFloatingLabelEditPart extends FloatingLabelEd
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class CollaborationCompositeFloatingLabelEditPart extends FloatingLabelEd
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class CollaborationCompositeFloatingLabelEditPart extends FloatingLabelEd
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class CollaborationCompositeFloatingLabelEditPart extends FloatingLabelEd
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class CollaborationCompositeFloatingLabelEditPart extends FloatingLabelEd
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class CollaborationCompositeFloatingLabelEditPart extends FloatingLabelEd
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class CollaborationCompositeFloatingLabelEditPart extends FloatingLabelEd
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class CollaborationCompositeFloatingLabelEditPart extends FloatingLabelEd
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class CollaborationCompositeFloatingLabelEditPart extends FloatingLabelEd
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class CollaborationCompositeFloatingLabelEditPart extends FloatingLabelEd
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class CollaborationCompositeFloatingLabelEditPart extends FloatingLabelEd
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class CollaborationCompositeFloatingLabelEditPart extends FloatingLabelEd
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class CollaborationCompositeFloatingLabelEditPart extends FloatingLabelEd
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Collaboration_2075, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.CollaborationCompositeFloatingLabelEditPart.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class CollaborationCompositeFloatingLabelEditPart extends FloatingLabelEd
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class CollaborationCompositeFloatingLabelEditPart extends FloatingLabelEd
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class CollaborationCompositeFloatingLabelEditPart extends FloatingLabelEd
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class CollaborationCompositeFloatingLabelEditPart extends FloatingLabelEd
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class CollaborationCompositeFloatingLabelEditPart extends FloatingLabelEd
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class CollaborationCompositeFloatingLabelEditPart extends FloatingLabelEd
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class CollaborationCompositeFloatingLabelEditPart extends FloatingLabelEd
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class CollaborationCompositeFloatingLabelEditPart extends FloatingLabelEd
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class CollaborationCompositeFloatingLabelEditPart extends FloatingLabelEd
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class CollaborationCompositeFloatingLabelEditPart extends FloatingLabelEd
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class CollaborationCompositeFloatingLabelEditPart extends FloatingLabelEd
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class CollaborationCompositeFloatingLabelEditPart extends FloatingLabelEd
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class CollaborationCompositeFloatingLabelEditPart extends FloatingLabelEd
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class CollaborationCompositeFloatingLabelEditPart extends FloatingLabelEd
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class CollaborationCompositeFloatingLabelEditPart extends FloatingLabelEd
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class CollaborationCompositeFloatingLabelEditPart extends FloatingLabelEd
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class CollaborationCompositeFloatingLabelEditPart extends FloatingLabelEd
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class CollaborationCompositeFloatingLabelEditPart extends FloatingLabelEd
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationCompositeFloatingLabelEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationCompositeFloatingLabelEditPartCN.java
index 5877fbb29fe..6d53038b9c4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationCompositeFloatingLabelEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationCompositeFloatingLabelEditPartCN.java
@@ -113,15 +113,18 @@ public class CollaborationCompositeFloatingLabelEditPartCN extends FloatingLabel
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class CollaborationCompositeFloatingLabelEditPartCN extends FloatingLabel
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class CollaborationCompositeFloatingLabelEditPartCN extends FloatingLabel
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class CollaborationCompositeFloatingLabelEditPartCN extends FloatingLabel
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class CollaborationCompositeFloatingLabelEditPartCN extends FloatingLabel
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class CollaborationCompositeFloatingLabelEditPartCN extends FloatingLabel
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class CollaborationCompositeFloatingLabelEditPartCN extends FloatingLabel
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class CollaborationCompositeFloatingLabelEditPartCN extends FloatingLabel
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class CollaborationCompositeFloatingLabelEditPartCN extends FloatingLabel
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class CollaborationCompositeFloatingLabelEditPartCN extends FloatingLabel
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class CollaborationCompositeFloatingLabelEditPartCN extends FloatingLabel
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class CollaborationCompositeFloatingLabelEditPartCN extends FloatingLabel
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class CollaborationCompositeFloatingLabelEditPartCN extends FloatingLabel
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class CollaborationCompositeFloatingLabelEditPartCN extends FloatingLabel
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Collaboration_3086, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.CollaborationCompositeFloatingLabelEditPartCN.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class CollaborationCompositeFloatingLabelEditPartCN extends FloatingLabel
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class CollaborationCompositeFloatingLabelEditPartCN extends FloatingLabel
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class CollaborationCompositeFloatingLabelEditPartCN extends FloatingLabel
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class CollaborationCompositeFloatingLabelEditPartCN extends FloatingLabel
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class CollaborationCompositeFloatingLabelEditPartCN extends FloatingLabel
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class CollaborationCompositeFloatingLabelEditPartCN extends FloatingLabel
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class CollaborationCompositeFloatingLabelEditPartCN extends FloatingLabel
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class CollaborationCompositeFloatingLabelEditPartCN extends FloatingLabel
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class CollaborationCompositeFloatingLabelEditPartCN extends FloatingLabel
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class CollaborationCompositeFloatingLabelEditPartCN extends FloatingLabel
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class CollaborationCompositeFloatingLabelEditPartCN extends FloatingLabel
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class CollaborationCompositeFloatingLabelEditPartCN extends FloatingLabel
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class CollaborationCompositeFloatingLabelEditPartCN extends FloatingLabel
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class CollaborationCompositeFloatingLabelEditPartCN extends FloatingLabel
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class CollaborationCompositeFloatingLabelEditPartCN extends FloatingLabel
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class CollaborationCompositeFloatingLabelEditPartCN extends FloatingLabel
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class CollaborationCompositeFloatingLabelEditPartCN extends FloatingLabel
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class CollaborationCompositeFloatingLabelEditPartCN extends FloatingLabel
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationCompositeNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationCompositeNameEditPart.java
index 3e651143555..1f684011e18 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationCompositeNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationCompositeNameEditPart.java
@@ -114,12 +114,14 @@ public class CollaborationCompositeNameEditPart extends PapyrusCompartmentEditPa
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class CollaborationCompositeNameEditPart extends PapyrusCompartmentEditPa
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class CollaborationCompositeNameEditPart extends PapyrusCompartmentEditPa
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class CollaborationCompositeNameEditPart extends PapyrusCompartmentEditPa
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class CollaborationCompositeNameEditPart extends PapyrusCompartmentEditPa
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class CollaborationCompositeNameEditPart extends PapyrusCompartmentEditPa
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class CollaborationCompositeNameEditPart extends PapyrusCompartmentEditPa
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class CollaborationCompositeNameEditPart extends PapyrusCompartmentEditPa
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class CollaborationCompositeNameEditPart extends PapyrusCompartmentEditPa
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class CollaborationCompositeNameEditPart extends PapyrusCompartmentEditPa
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class CollaborationCompositeNameEditPart extends PapyrusCompartmentEditPa
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class CollaborationCompositeNameEditPart extends PapyrusCompartmentEditPa
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class CollaborationCompositeNameEditPart extends PapyrusCompartmentEditPa
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Collaboration_2075, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.CollaborationCompositeNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class CollaborationCompositeNameEditPart extends PapyrusCompartmentEditPa
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class CollaborationCompositeNameEditPart extends PapyrusCompartmentEditPa
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class CollaborationCompositeNameEditPart extends PapyrusCompartmentEditPa
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class CollaborationCompositeNameEditPart extends PapyrusCompartmentEditPa
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class CollaborationCompositeNameEditPart extends PapyrusCompartmentEditPa
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class CollaborationCompositeNameEditPart extends PapyrusCompartmentEditPa
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class CollaborationCompositeNameEditPart extends PapyrusCompartmentEditPa
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class CollaborationCompositeNameEditPart extends PapyrusCompartmentEditPa
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class CollaborationCompositeNameEditPart extends PapyrusCompartmentEditPa
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class CollaborationCompositeNameEditPart extends PapyrusCompartmentEditPa
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class CollaborationCompositeNameEditPart extends PapyrusCompartmentEditPa
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class CollaborationCompositeNameEditPart extends PapyrusCompartmentEditPa
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class CollaborationCompositeNameEditPart extends PapyrusCompartmentEditPa
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class CollaborationCompositeNameEditPart extends PapyrusCompartmentEditPa
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class CollaborationCompositeNameEditPart extends PapyrusCompartmentEditPa
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class CollaborationCompositeNameEditPart extends PapyrusCompartmentEditPa
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class CollaborationCompositeNameEditPart extends PapyrusCompartmentEditPa
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class CollaborationCompositeNameEditPart extends PapyrusCompartmentEditPa
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class CollaborationCompositeNameEditPart extends PapyrusCompartmentEditPa
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class CollaborationCompositeNameEditPart extends PapyrusCompartmentEditPa
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class CollaborationCompositeNameEditPart extends PapyrusCompartmentEditPa
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationCompositeNameEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationCompositeNameEditPartCN.java
index 53d99354fb6..cbb97fb1f0f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationCompositeNameEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationCompositeNameEditPartCN.java
@@ -114,12 +114,14 @@ public class CollaborationCompositeNameEditPartCN extends PapyrusCompartmentEdit
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class CollaborationCompositeNameEditPartCN extends PapyrusCompartmentEdit
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class CollaborationCompositeNameEditPartCN extends PapyrusCompartmentEdit
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class CollaborationCompositeNameEditPartCN extends PapyrusCompartmentEdit
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class CollaborationCompositeNameEditPartCN extends PapyrusCompartmentEdit
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class CollaborationCompositeNameEditPartCN extends PapyrusCompartmentEdit
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class CollaborationCompositeNameEditPartCN extends PapyrusCompartmentEdit
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class CollaborationCompositeNameEditPartCN extends PapyrusCompartmentEdit
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class CollaborationCompositeNameEditPartCN extends PapyrusCompartmentEdit
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class CollaborationCompositeNameEditPartCN extends PapyrusCompartmentEdit
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class CollaborationCompositeNameEditPartCN extends PapyrusCompartmentEdit
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class CollaborationCompositeNameEditPartCN extends PapyrusCompartmentEdit
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class CollaborationCompositeNameEditPartCN extends PapyrusCompartmentEdit
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Collaboration_3086, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.CollaborationCompositeNameEditPartCN.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class CollaborationCompositeNameEditPartCN extends PapyrusCompartmentEdit
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class CollaborationCompositeNameEditPartCN extends PapyrusCompartmentEdit
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class CollaborationCompositeNameEditPartCN extends PapyrusCompartmentEdit
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class CollaborationCompositeNameEditPartCN extends PapyrusCompartmentEdit
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class CollaborationCompositeNameEditPartCN extends PapyrusCompartmentEdit
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class CollaborationCompositeNameEditPartCN extends PapyrusCompartmentEdit
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class CollaborationCompositeNameEditPartCN extends PapyrusCompartmentEdit
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class CollaborationCompositeNameEditPartCN extends PapyrusCompartmentEdit
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class CollaborationCompositeNameEditPartCN extends PapyrusCompartmentEdit
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class CollaborationCompositeNameEditPartCN extends PapyrusCompartmentEdit
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class CollaborationCompositeNameEditPartCN extends PapyrusCompartmentEdit
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class CollaborationCompositeNameEditPartCN extends PapyrusCompartmentEdit
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class CollaborationCompositeNameEditPartCN extends PapyrusCompartmentEdit
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class CollaborationCompositeNameEditPartCN extends PapyrusCompartmentEdit
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class CollaborationCompositeNameEditPartCN extends PapyrusCompartmentEdit
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class CollaborationCompositeNameEditPartCN extends PapyrusCompartmentEdit
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class CollaborationCompositeNameEditPartCN extends PapyrusCompartmentEdit
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class CollaborationCompositeNameEditPartCN extends PapyrusCompartmentEdit
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class CollaborationCompositeNameEditPartCN extends PapyrusCompartmentEdit
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class CollaborationCompositeNameEditPartCN extends PapyrusCompartmentEdit
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class CollaborationCompositeNameEditPartCN extends PapyrusCompartmentEdit
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationRoleEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationRoleEditPartCN.java
index d26501dd95a..866aa83f054 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationRoleEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationRoleEditPartCN.java
@@ -85,7 +85,9 @@ public class CollaborationRoleEditPartCN extends RoundedCompartmentEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CollaborationRoleItemSemanticEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
@@ -103,21 +105,21 @@ public class CollaborationRoleEditPartCN extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case CollaborationRoleFloatingLabelEditPartCN.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -137,8 +139,9 @@ public class CollaborationRoleEditPartCN extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -156,6 +159,7 @@ public class CollaborationRoleEditPartCN extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -167,20 +171,23 @@ public class CollaborationRoleEditPartCN extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.composite.custom.figures.CollaborationRoleFigure
+ *
* @generated
*/
public CollaborationRoleFigure getPrimaryShape() {
- return (CollaborationRoleFigure)primaryShape;
+ return (CollaborationRoleFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof CollaborationRoleNameEditPartCN) {
- ((CollaborationRoleNameEditPartCN)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof CollaborationRoleNameEditPartCN) {
+ ((CollaborationRoleNameEditPartCN) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
+
+
return false;
}
@@ -188,7 +195,7 @@ public class CollaborationRoleEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof CollaborationRoleNameEditPartCN) {
+ if (childEditPart instanceof CollaborationRoleNameEditPartCN) {
return true;
}
return false;
@@ -198,7 +205,7 @@ public class CollaborationRoleEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -208,7 +215,7 @@ public class CollaborationRoleEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -218,7 +225,7 @@ public class CollaborationRoleEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -228,7 +235,7 @@ public class CollaborationRoleEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof CollaborationRoleFloatingLabelEditPartCN) {
+ if (borderItemEditPart instanceof CollaborationRoleFloatingLabelEditPartCN) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -251,16 +258,19 @@ public class CollaborationRoleEditPartCN extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -272,7 +282,7 @@ public class CollaborationRoleEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -282,7 +292,7 @@ public class CollaborationRoleEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -298,8 +308,8 @@ public class CollaborationRoleEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationRoleFloatingLabelEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationRoleFloatingLabelEditPartCN.java
index c8c298c4915..3d7e348eca8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationRoleFloatingLabelEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationRoleFloatingLabelEditPartCN.java
@@ -113,15 +113,18 @@ public class CollaborationRoleFloatingLabelEditPartCN extends FloatingLabelEditP
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class CollaborationRoleFloatingLabelEditPartCN extends FloatingLabelEditP
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class CollaborationRoleFloatingLabelEditPartCN extends FloatingLabelEditP
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class CollaborationRoleFloatingLabelEditPartCN extends FloatingLabelEditP
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class CollaborationRoleFloatingLabelEditPartCN extends FloatingLabelEditP
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class CollaborationRoleFloatingLabelEditPartCN extends FloatingLabelEditP
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class CollaborationRoleFloatingLabelEditPartCN extends FloatingLabelEditP
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class CollaborationRoleFloatingLabelEditPartCN extends FloatingLabelEditP
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class CollaborationRoleFloatingLabelEditPartCN extends FloatingLabelEditP
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class CollaborationRoleFloatingLabelEditPartCN extends FloatingLabelEditP
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class CollaborationRoleFloatingLabelEditPartCN extends FloatingLabelEditP
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class CollaborationRoleFloatingLabelEditPartCN extends FloatingLabelEditP
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class CollaborationRoleFloatingLabelEditPartCN extends FloatingLabelEditP
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class CollaborationRoleFloatingLabelEditPartCN extends FloatingLabelEditP
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.ConnectableElement_3115, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.CollaborationRoleFloatingLabelEditPartCN.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class CollaborationRoleFloatingLabelEditPartCN extends FloatingLabelEditP
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class CollaborationRoleFloatingLabelEditPartCN extends FloatingLabelEditP
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class CollaborationRoleFloatingLabelEditPartCN extends FloatingLabelEditP
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class CollaborationRoleFloatingLabelEditPartCN extends FloatingLabelEditP
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class CollaborationRoleFloatingLabelEditPartCN extends FloatingLabelEditP
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class CollaborationRoleFloatingLabelEditPartCN extends FloatingLabelEditP
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class CollaborationRoleFloatingLabelEditPartCN extends FloatingLabelEditP
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class CollaborationRoleFloatingLabelEditPartCN extends FloatingLabelEditP
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class CollaborationRoleFloatingLabelEditPartCN extends FloatingLabelEditP
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class CollaborationRoleFloatingLabelEditPartCN extends FloatingLabelEditP
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class CollaborationRoleFloatingLabelEditPartCN extends FloatingLabelEditP
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class CollaborationRoleFloatingLabelEditPartCN extends FloatingLabelEditP
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class CollaborationRoleFloatingLabelEditPartCN extends FloatingLabelEditP
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class CollaborationRoleFloatingLabelEditPartCN extends FloatingLabelEditP
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class CollaborationRoleFloatingLabelEditPartCN extends FloatingLabelEditP
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class CollaborationRoleFloatingLabelEditPartCN extends FloatingLabelEditP
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class CollaborationRoleFloatingLabelEditPartCN extends FloatingLabelEditP
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class CollaborationRoleFloatingLabelEditPartCN extends FloatingLabelEditP
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationRoleNameEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationRoleNameEditPartCN.java
index 68370b3b871..76a8b34d76a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationRoleNameEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationRoleNameEditPartCN.java
@@ -114,12 +114,14 @@ public class CollaborationRoleNameEditPartCN extends PapyrusCompartmentEditPart
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class CollaborationRoleNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class CollaborationRoleNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class CollaborationRoleNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class CollaborationRoleNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class CollaborationRoleNameEditPartCN extends PapyrusCompartmentEditPart
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class CollaborationRoleNameEditPartCN extends PapyrusCompartmentEditPart
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class CollaborationRoleNameEditPartCN extends PapyrusCompartmentEditPart
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class CollaborationRoleNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class CollaborationRoleNameEditPartCN extends PapyrusCompartmentEditPart
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class CollaborationRoleNameEditPartCN extends PapyrusCompartmentEditPart
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class CollaborationRoleNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class CollaborationRoleNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.ConnectableElement_3115, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.CollaborationRoleNameEditPartCN.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class CollaborationRoleNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class CollaborationRoleNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class CollaborationRoleNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class CollaborationRoleNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class CollaborationRoleNameEditPartCN extends PapyrusCompartmentEditPart
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class CollaborationRoleNameEditPartCN extends PapyrusCompartmentEditPart
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class CollaborationRoleNameEditPartCN extends PapyrusCompartmentEditPart
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class CollaborationRoleNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class CollaborationRoleNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class CollaborationRoleNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class CollaborationRoleNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class CollaborationRoleNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class CollaborationRoleNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -640,8 +661,8 @@ public class CollaborationRoleNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -658,35 +679,40 @@ public class CollaborationRoleNameEditPartCN extends PapyrusCompartmentEditPart
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -696,12 +722,13 @@ public class CollaborationRoleNameEditPartCN extends PapyrusCompartmentEditPart
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -736,31 +763,32 @@ public class CollaborationRoleNameEditPartCN extends PapyrusCompartmentEditPart
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -791,7 +819,8 @@ public class CollaborationRoleNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -800,6 +829,7 @@ public class CollaborationRoleNameEditPartCN extends PapyrusCompartmentEditPart
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -807,5 +837,6 @@ public class CollaborationRoleNameEditPartCN extends PapyrusCompartmentEditPart
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationUseEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationUseEditPartCN.java
index bd80854b241..f68c49a6e26 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationUseEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationUseEditPartCN.java
@@ -85,7 +85,9 @@ public class CollaborationUseEditPartCN extends RoundedCompartmentEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
@@ -103,21 +105,21 @@ public class CollaborationUseEditPartCN extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case CollaborationUseFloatingLabelEditPartCN.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -137,8 +139,9 @@ public class CollaborationUseEditPartCN extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -156,6 +159,7 @@ public class CollaborationUseEditPartCN extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -167,20 +171,23 @@ public class CollaborationUseEditPartCN extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure
+ *
* @generated
*/
public RoundedCompartmentFigure getPrimaryShape() {
- return (RoundedCompartmentFigure)primaryShape;
+ return (RoundedCompartmentFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof CollaborationUseNameEditPart) {
- ((CollaborationUseNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof CollaborationUseNameEditPart) {
+ ((CollaborationUseNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
+
+
return false;
}
@@ -188,7 +195,7 @@ public class CollaborationUseEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof CollaborationUseNameEditPart) {
+ if (childEditPart instanceof CollaborationUseNameEditPart) {
return true;
}
return false;
@@ -198,7 +205,7 @@ public class CollaborationUseEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -208,7 +215,7 @@ public class CollaborationUseEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -218,7 +225,7 @@ public class CollaborationUseEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -228,7 +235,7 @@ public class CollaborationUseEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof CollaborationUseFloatingLabelEditPartCN) {
+ if (borderItemEditPart instanceof CollaborationUseFloatingLabelEditPartCN) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -251,16 +258,19 @@ public class CollaborationUseEditPartCN extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -272,7 +282,7 @@ public class CollaborationUseEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -282,7 +292,7 @@ public class CollaborationUseEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -298,8 +308,8 @@ public class CollaborationUseEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationUseFloatingLabelEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationUseFloatingLabelEditPartCN.java
index ca6dc0cedf1..da1754abb49 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationUseFloatingLabelEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationUseFloatingLabelEditPartCN.java
@@ -113,15 +113,18 @@ public class CollaborationUseFloatingLabelEditPartCN extends FloatingLabelEditPa
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class CollaborationUseFloatingLabelEditPartCN extends FloatingLabelEditPa
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class CollaborationUseFloatingLabelEditPartCN extends FloatingLabelEditPa
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class CollaborationUseFloatingLabelEditPartCN extends FloatingLabelEditPa
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class CollaborationUseFloatingLabelEditPartCN extends FloatingLabelEditPa
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class CollaborationUseFloatingLabelEditPartCN extends FloatingLabelEditPa
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class CollaborationUseFloatingLabelEditPartCN extends FloatingLabelEditPa
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class CollaborationUseFloatingLabelEditPartCN extends FloatingLabelEditPa
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class CollaborationUseFloatingLabelEditPartCN extends FloatingLabelEditPa
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class CollaborationUseFloatingLabelEditPartCN extends FloatingLabelEditPa
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class CollaborationUseFloatingLabelEditPartCN extends FloatingLabelEditPa
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class CollaborationUseFloatingLabelEditPartCN extends FloatingLabelEditPa
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class CollaborationUseFloatingLabelEditPartCN extends FloatingLabelEditPa
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class CollaborationUseFloatingLabelEditPartCN extends FloatingLabelEditPa
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.CollaborationUse_3071, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.CollaborationUseFloatingLabelEditPartCN.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class CollaborationUseFloatingLabelEditPartCN extends FloatingLabelEditPa
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class CollaborationUseFloatingLabelEditPartCN extends FloatingLabelEditPa
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class CollaborationUseFloatingLabelEditPartCN extends FloatingLabelEditPa
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class CollaborationUseFloatingLabelEditPartCN extends FloatingLabelEditPa
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class CollaborationUseFloatingLabelEditPartCN extends FloatingLabelEditPa
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class CollaborationUseFloatingLabelEditPartCN extends FloatingLabelEditPa
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class CollaborationUseFloatingLabelEditPartCN extends FloatingLabelEditPa
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class CollaborationUseFloatingLabelEditPartCN extends FloatingLabelEditPa
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class CollaborationUseFloatingLabelEditPartCN extends FloatingLabelEditPa
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class CollaborationUseFloatingLabelEditPartCN extends FloatingLabelEditPa
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class CollaborationUseFloatingLabelEditPartCN extends FloatingLabelEditPa
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class CollaborationUseFloatingLabelEditPartCN extends FloatingLabelEditPa
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class CollaborationUseFloatingLabelEditPartCN extends FloatingLabelEditPa
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class CollaborationUseFloatingLabelEditPartCN extends FloatingLabelEditPa
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class CollaborationUseFloatingLabelEditPartCN extends FloatingLabelEditPa
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class CollaborationUseFloatingLabelEditPartCN extends FloatingLabelEditPa
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class CollaborationUseFloatingLabelEditPartCN extends FloatingLabelEditPa
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class CollaborationUseFloatingLabelEditPartCN extends FloatingLabelEditPa
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationUseNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationUseNameEditPart.java
index ec40170e16e..859127e7495 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationUseNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CollaborationUseNameEditPart.java
@@ -115,12 +115,14 @@ public class CollaborationUseNameEditPart extends PapyrusCompartmentEditPart imp
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -147,12 +149,12 @@ public class CollaborationUseNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -160,12 +162,12 @@ public class CollaborationUseNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -173,12 +175,12 @@ public class CollaborationUseNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -186,12 +188,12 @@ public class CollaborationUseNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -239,12 +241,12 @@ public class CollaborationUseNameEditPart extends PapyrusCompartmentEditPart imp
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -257,10 +259,12 @@ public class CollaborationUseNameEditPart extends PapyrusCompartmentEditPart imp
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -272,12 +276,12 @@ public class CollaborationUseNameEditPart extends PapyrusCompartmentEditPart imp
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -285,10 +289,12 @@ public class CollaborationUseNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -306,15 +312,16 @@ public class CollaborationUseNameEditPart extends PapyrusCompartmentEditPart imp
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -322,6 +329,7 @@ public class CollaborationUseNameEditPart extends PapyrusCompartmentEditPart imp
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -332,7 +340,7 @@ public class CollaborationUseNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -349,7 +357,7 @@ public class CollaborationUseNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.CollaborationUse_3071, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.CollaborationUseNameEditPart.VISUAL_ID));
}
return parser;
@@ -359,8 +367,10 @@ public class CollaborationUseNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -389,8 +399,8 @@ public class CollaborationUseNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -398,8 +408,8 @@ public class CollaborationUseNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -409,46 +419,52 @@ public class CollaborationUseNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -470,12 +486,12 @@ public class CollaborationUseNameEditPart extends PapyrusCompartmentEditPart imp
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -505,12 +521,12 @@ public class CollaborationUseNameEditPart extends PapyrusCompartmentEditPart imp
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -519,12 +535,12 @@ public class CollaborationUseNameEditPart extends PapyrusCompartmentEditPart imp
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -532,15 +548,16 @@ public class CollaborationUseNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -549,9 +566,10 @@ public class CollaborationUseNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -559,9 +577,12 @@ public class CollaborationUseNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -577,11 +598,11 @@ public class CollaborationUseNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -592,8 +613,8 @@ public class CollaborationUseNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -605,7 +626,7 @@ public class CollaborationUseNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -631,13 +652,14 @@ public class CollaborationUseNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -649,8 +671,8 @@ public class CollaborationUseNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -667,35 +689,40 @@ public class CollaborationUseNameEditPart extends PapyrusCompartmentEditPart imp
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -705,12 +732,13 @@ public class CollaborationUseNameEditPart extends PapyrusCompartmentEditPart imp
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -745,31 +773,32 @@ public class CollaborationUseNameEditPart extends PapyrusCompartmentEditPart imp
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -800,7 +829,8 @@ public class CollaborationUseNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -809,6 +839,7 @@ public class CollaborationUseNameEditPart extends PapyrusCompartmentEditPart imp
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -816,5 +847,6 @@ public class CollaborationUseNameEditPart extends PapyrusCompartmentEditPart imp
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CommentAnnotatedElementEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CommentAnnotatedElementEditPart.java
index e303ae9d5fb..853de9c718e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CommentAnnotatedElementEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CommentAnnotatedElementEditPart.java
@@ -60,6 +60,6 @@ public class CommentAnnotatedElementEditPart extends ConnectionEditPart implemen
* @generated
*/
public SimpleDashedEdgeFigure getPrimaryShape() {
- return (SimpleDashedEdgeFigure)getFigure();
+ return (SimpleDashedEdgeFigure) getFigure();
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CommentBodyEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CommentBodyEditPart.java
index daca4ac9b7f..0d757cf88a1 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CommentBodyEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CommentBodyEditPart.java
@@ -110,12 +110,14 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -141,12 +143,12 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -154,12 +156,12 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -167,12 +169,12 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -180,12 +182,12 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -241,10 +243,12 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -256,12 +260,12 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -269,10 +273,12 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -290,15 +296,16 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -306,6 +313,7 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -316,7 +324,7 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -333,7 +341,7 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Comment_2109, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.CommentBodyEditPart.VISUAL_ID));
}
return parser;
@@ -343,8 +351,10 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -373,8 +383,8 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -382,8 +392,8 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -393,46 +403,52 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -454,12 +470,12 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -489,12 +505,12 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -503,12 +519,12 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -516,15 +532,16 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -533,9 +550,10 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -543,9 +561,12 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -561,11 +582,11 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -576,8 +597,8 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -589,7 +610,7 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -615,13 +636,14 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -633,8 +655,8 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -651,35 +673,40 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -689,12 +716,13 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -729,24 +757,25 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -781,7 +810,8 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -790,6 +820,7 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -797,5 +828,6 @@ public class CommentBodyEditPart extends PapyrusCompartmentEditPart implements I
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CommentBodyEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CommentBodyEditPartCN.java
index 009560d2a76..8c623c548fd 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CommentBodyEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CommentBodyEditPartCN.java
@@ -110,12 +110,14 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -141,12 +143,12 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -154,12 +156,12 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -167,12 +169,12 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -180,12 +182,12 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -241,10 +243,12 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -256,12 +260,12 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -269,10 +273,12 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -290,15 +296,16 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -306,6 +313,7 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -316,7 +324,7 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -333,7 +341,7 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Comment_3097, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.CommentBodyEditPartCN.VISUAL_ID));
}
return parser;
@@ -343,8 +351,10 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -373,8 +383,8 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -382,8 +392,8 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -393,46 +403,52 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -454,12 +470,12 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -489,12 +505,12 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -503,12 +519,12 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -516,15 +532,16 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -533,9 +550,10 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -543,9 +561,12 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -561,11 +582,11 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -576,8 +597,8 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -589,7 +610,7 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -615,13 +636,14 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -633,8 +655,8 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -651,35 +673,40 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -689,12 +716,13 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -729,24 +757,25 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -781,7 +810,8 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -790,6 +820,7 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -797,5 +828,6 @@ public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart implements
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CommentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CommentEditPart.java
index 146d28169a3..aa5640516ef 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CommentEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CommentEditPart.java
@@ -71,7 +71,9 @@ public class CommentEditPart extends AbstractCommentEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PapyrusReflowableShapeEditPolicy());
@@ -88,7 +90,7 @@ public class CommentEditPart extends AbstractCommentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -108,11 +110,13 @@ public class CommentEditPart extends AbstractCommentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
super.handleNotificationEvent(event);
+
}
/**
@@ -124,20 +128,23 @@ public class CommentEditPart extends AbstractCommentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.HTMLCornerBentFigure
+ *
* @generated
*/
public HTMLCornerBentFigure getPrimaryShape() {
- return (HTMLCornerBentFigure)primaryShape;
+ return (HTMLCornerBentFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof CommentBodyEditPart) {
- ((CommentBodyEditPart)childEditPart).setLabel(getPrimaryShape().getCornerBentFigure());
+ if (childEditPart instanceof CommentBodyEditPart) {
+ ((CommentBodyEditPart) childEditPart).setLabel(getPrimaryShape().getCornerBentFigure());
return true;
}
+
+
return false;
}
@@ -145,7 +152,7 @@ public class CommentEditPart extends AbstractCommentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof CommentBodyEditPart) {
+ if (childEditPart instanceof CommentBodyEditPart) {
return true;
}
return false;
@@ -155,7 +162,7 @@ public class CommentEditPart extends AbstractCommentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -165,7 +172,7 @@ public class CommentEditPart extends AbstractCommentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -193,16 +200,19 @@ public class CommentEditPart extends AbstractCommentEditPart {
*/
protected NodeFigure createNodeFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -214,7 +224,7 @@ public class CommentEditPart extends AbstractCommentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -224,7 +234,7 @@ public class CommentEditPart extends AbstractCommentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -240,8 +250,8 @@ public class CommentEditPart extends AbstractCommentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CommentEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CommentEditPartCN.java
index 82db32ee7aa..5ec38d35fa2 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CommentEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CommentEditPartCN.java
@@ -71,7 +71,9 @@ public class CommentEditPartCN extends AbstractCommentEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PapyrusReflowableShapeEditPolicy());
@@ -88,7 +90,7 @@ public class CommentEditPartCN extends AbstractCommentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -108,11 +110,13 @@ public class CommentEditPartCN extends AbstractCommentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
super.handleNotificationEvent(event);
+
}
/**
@@ -124,20 +128,23 @@ public class CommentEditPartCN extends AbstractCommentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.HTMLCornerBentFigure
+ *
* @generated
*/
public HTMLCornerBentFigure getPrimaryShape() {
- return (HTMLCornerBentFigure)primaryShape;
+ return (HTMLCornerBentFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof CommentBodyEditPartCN) {
- ((CommentBodyEditPartCN)childEditPart).setLabel(getPrimaryShape().getCornerBentFigure());
+ if (childEditPart instanceof CommentBodyEditPartCN) {
+ ((CommentBodyEditPartCN) childEditPart).setLabel(getPrimaryShape().getCornerBentFigure());
return true;
}
+
+
return false;
}
@@ -145,7 +152,7 @@ public class CommentEditPartCN extends AbstractCommentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof CommentBodyEditPartCN) {
+ if (childEditPart instanceof CommentBodyEditPartCN) {
return true;
}
return false;
@@ -155,7 +162,7 @@ public class CommentEditPartCN extends AbstractCommentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -165,7 +172,7 @@ public class CommentEditPartCN extends AbstractCommentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -193,16 +200,19 @@ public class CommentEditPartCN extends AbstractCommentEditPart {
*/
protected NodeFigure createNodeFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -214,7 +224,7 @@ public class CommentEditPartCN extends AbstractCommentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -224,7 +234,7 @@ public class CommentEditPartCN extends AbstractCommentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -240,8 +250,8 @@ public class CommentEditPartCN extends AbstractCommentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentCompositeCompartmentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentCompositeCompartmentEditPart.java
index 4a5334a44ae..96a3e09871e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentCompositeCompartmentEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentCompositeCompartmentEditPart.java
@@ -81,7 +81,7 @@ public class ComponentCompositeCompartmentEditPart extends LinkLFShapeCompartmen
* @generated
*/
protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
+ if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
super.setRatio(ratio);
}
}
@@ -90,6 +90,7 @@ public class ComponentCompositeCompartmentEditPart extends LinkLFShapeCompartmen
* @generated
*/
public EditPart getTargetEditPart(Request request) {
+
return super.getTargetEditPart(request);
}
@@ -98,7 +99,10 @@ public class ComponentCompositeCompartmentEditPart extends LinkLFShapeCompartmen
*/
protected void handleNotificationEvent(Notification notification) {
Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
+ if (NotationPackage.eINSTANCE.getSize_Width().equals(feature)
+ || NotationPackage.eINSTANCE.getSize_Height().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_X().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
refreshBounds();
}
super.handleNotificationEvent(notification);
@@ -108,13 +112,16 @@ public class ComponentCompositeCompartmentEditPart extends LinkLFShapeCompartmen
* @generated
*/
protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
+ ((GraphicalEditPart) getParent()).setLayoutConstraint(
+ this,
+ getFigure(),
+ new Rectangle(loc, size));
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentCompositeCompartmentEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentCompositeCompartmentEditPartCN.java
index 2d4a30034b7..66d982b9d34 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentCompositeCompartmentEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentCompositeCompartmentEditPartCN.java
@@ -81,7 +81,7 @@ public class ComponentCompositeCompartmentEditPartCN extends LinkLFShapeCompartm
* @generated
*/
protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
+ if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
super.setRatio(ratio);
}
}
@@ -90,6 +90,7 @@ public class ComponentCompositeCompartmentEditPartCN extends LinkLFShapeCompartm
* @generated
*/
public EditPart getTargetEditPart(Request request) {
+
return super.getTargetEditPart(request);
}
@@ -98,7 +99,10 @@ public class ComponentCompositeCompartmentEditPartCN extends LinkLFShapeCompartm
*/
protected void handleNotificationEvent(Notification notification) {
Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
+ if (NotationPackage.eINSTANCE.getSize_Width().equals(feature)
+ || NotationPackage.eINSTANCE.getSize_Height().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_X().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
refreshBounds();
}
super.handleNotificationEvent(notification);
@@ -108,13 +112,16 @@ public class ComponentCompositeCompartmentEditPartCN extends LinkLFShapeCompartm
* @generated
*/
protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
+ ((GraphicalEditPart) getParent()).setLayoutConstraint(
+ this,
+ getFigure(),
+ new Rectangle(loc, size));
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentCompositeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentCompositeEditPart.java
index fcb34ad74ce..a9b3b5829de 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentCompositeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentCompositeEditPart.java
@@ -96,7 +96,9 @@ public class ComponentCompositeEditPart extends RoundedCompartmentEditPart {
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new DefaultCreationEditPolicy());
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
@@ -120,14 +122,14 @@ public class ComponentCompositeEditPart extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case ComponentCompositeFloatingLabelEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
@@ -136,7 +138,7 @@ public class ComponentCompositeEditPart extends RoundedCompartmentEditPart {
return new BorderItemResizableEditPolicy();
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -156,8 +158,9 @@ public class ComponentCompositeEditPart extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -175,6 +178,7 @@ public class ComponentCompositeEditPart extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -186,32 +190,40 @@ public class ComponentCompositeEditPart extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.composite.custom.figures.ComponentCompositeFigure
+ *
* @generated
*/
public ComponentCompositeFigure getPrimaryShape() {
- return (ComponentCompositeFigure)primaryShape;
+ return (ComponentCompositeFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ComponentCompositeNameEditPart) {
- ((ComponentCompositeNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof ComponentCompositeNameEditPart) {
+ ((ComponentCompositeNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
- if(childEditPart instanceof ComponentCompositeCompartmentEditPart) {
+
+
+ if (childEditPart instanceof ComponentCompositeCompartmentEditPart) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((ComponentCompositeCompartmentEditPart)childEditPart).getFigure());
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.add(((ComponentCompositeCompartmentEditPart) childEditPart).getFigure());
return true;
}
- //Papyrus Gencode :Affixed Port locator
- if(childEditPart instanceof PortEditPart) {
+
+
+
+ // Papyrus Gencode :Affixed Port locator
+ if (childEditPart instanceof PortEditPart) {
IBorderItemLocator locator = new PortPositionLocator(getMainFigure(), PositionConstants.NONE);
- getBorderedFigure().getBorderItemContainer().add(((PortEditPart)childEditPart).getFigure(), locator);
+ getBorderedFigure().getBorderItemContainer().add(((PortEditPart) childEditPart).getFigure(), locator);
return true;
}
+
+
return false;
}
@@ -219,16 +231,16 @@ public class ComponentCompositeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ComponentCompositeNameEditPart) {
+ if (childEditPart instanceof ComponentCompositeNameEditPart) {
return true;
}
- if(childEditPart instanceof ComponentCompositeCompartmentEditPart) {
+ if (childEditPart instanceof ComponentCompositeCompartmentEditPart) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- pane.remove(((ComponentCompositeCompartmentEditPart)childEditPart).getFigure());
+ pane.remove(((ComponentCompositeCompartmentEditPart) childEditPart).getFigure());
return true;
}
- if(childEditPart instanceof PortEditPart) {
- getBorderedFigure().getBorderItemContainer().remove(((PortEditPart)childEditPart).getFigure());
+ if (childEditPart instanceof PortEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((PortEditPart) childEditPart).getFigure());
return true;
}
return false;
@@ -238,7 +250,7 @@ public class ComponentCompositeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -248,7 +260,7 @@ public class ComponentCompositeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -258,10 +270,10 @@ public class ComponentCompositeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof ComponentCompositeCompartmentEditPart) {
+ if (editPart instanceof ComponentCompositeCompartmentEditPart) {
return getPrimaryShape().getCompositeCompartmentFigure();
}
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -271,7 +283,7 @@ public class ComponentCompositeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof ComponentCompositeFloatingLabelEditPart) {
+ if (borderItemEditPart instanceof ComponentCompositeFloatingLabelEditPart) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -294,16 +306,19 @@ public class ComponentCompositeEditPart extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -315,7 +330,7 @@ public class ComponentCompositeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -325,7 +340,7 @@ public class ComponentCompositeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -341,8 +356,8 @@ public class ComponentCompositeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentCompositeEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentCompositeEditPartCN.java
index a182cd1bfcf..427feeb2510 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentCompositeEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentCompositeEditPartCN.java
@@ -96,7 +96,9 @@ public class ComponentCompositeEditPartCN extends RoundedCompartmentEditPart {
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new DefaultCreationEditPolicy());
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
@@ -120,14 +122,14 @@ public class ComponentCompositeEditPartCN extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case ComponentCompositeFloatingLabelEditPartCN.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
@@ -136,7 +138,7 @@ public class ComponentCompositeEditPartCN extends RoundedCompartmentEditPart {
return new BorderItemResizableEditPolicy();
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -156,8 +158,9 @@ public class ComponentCompositeEditPartCN extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -175,6 +178,7 @@ public class ComponentCompositeEditPartCN extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -186,32 +190,40 @@ public class ComponentCompositeEditPartCN extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.composite.custom.figures.ComponentCompositeFigure
+ *
* @generated
*/
public ComponentCompositeFigure getPrimaryShape() {
- return (ComponentCompositeFigure)primaryShape;
+ return (ComponentCompositeFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ComponentCompositeNameEditPartCN) {
- ((ComponentCompositeNameEditPartCN)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof ComponentCompositeNameEditPartCN) {
+ ((ComponentCompositeNameEditPartCN) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
- if(childEditPart instanceof ComponentCompositeCompartmentEditPartCN) {
+
+
+ if (childEditPart instanceof ComponentCompositeCompartmentEditPartCN) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((ComponentCompositeCompartmentEditPartCN)childEditPart).getFigure());
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.add(((ComponentCompositeCompartmentEditPartCN) childEditPart).getFigure());
return true;
}
- //Papyrus Gencode :Affixed Port locator
- if(childEditPart instanceof PortEditPart) {
+
+
+
+ // Papyrus Gencode :Affixed Port locator
+ if (childEditPart instanceof PortEditPart) {
IBorderItemLocator locator = new PortPositionLocator(getMainFigure(), PositionConstants.NONE);
- getBorderedFigure().getBorderItemContainer().add(((PortEditPart)childEditPart).getFigure(), locator);
+ getBorderedFigure().getBorderItemContainer().add(((PortEditPart) childEditPart).getFigure(), locator);
return true;
}
+
+
return false;
}
@@ -219,16 +231,16 @@ public class ComponentCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ComponentCompositeNameEditPartCN) {
+ if (childEditPart instanceof ComponentCompositeNameEditPartCN) {
return true;
}
- if(childEditPart instanceof ComponentCompositeCompartmentEditPartCN) {
+ if (childEditPart instanceof ComponentCompositeCompartmentEditPartCN) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- pane.remove(((ComponentCompositeCompartmentEditPartCN)childEditPart).getFigure());
+ pane.remove(((ComponentCompositeCompartmentEditPartCN) childEditPart).getFigure());
return true;
}
- if(childEditPart instanceof PortEditPart) {
- getBorderedFigure().getBorderItemContainer().remove(((PortEditPart)childEditPart).getFigure());
+ if (childEditPart instanceof PortEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((PortEditPart) childEditPart).getFigure());
return true;
}
return false;
@@ -238,7 +250,7 @@ public class ComponentCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -248,7 +260,7 @@ public class ComponentCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -258,10 +270,10 @@ public class ComponentCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof ComponentCompositeCompartmentEditPartCN) {
+ if (editPart instanceof ComponentCompositeCompartmentEditPartCN) {
return getPrimaryShape().getCompositeCompartmentFigure();
}
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -271,7 +283,7 @@ public class ComponentCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof ComponentCompositeFloatingLabelEditPartCN) {
+ if (borderItemEditPart instanceof ComponentCompositeFloatingLabelEditPartCN) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -294,16 +306,19 @@ public class ComponentCompositeEditPartCN extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -315,7 +330,7 @@ public class ComponentCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -325,7 +340,7 @@ public class ComponentCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -341,8 +356,8 @@ public class ComponentCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentCompositeFloatingLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentCompositeFloatingLabelEditPart.java
index 07de68922e6..8e54686b80e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentCompositeFloatingLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentCompositeFloatingLabelEditPart.java
@@ -113,15 +113,18 @@ public class ComponentCompositeFloatingLabelEditPart extends FloatingLabelEditPa
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class ComponentCompositeFloatingLabelEditPart extends FloatingLabelEditPa
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class ComponentCompositeFloatingLabelEditPart extends FloatingLabelEditPa
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class ComponentCompositeFloatingLabelEditPart extends FloatingLabelEditPa
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class ComponentCompositeFloatingLabelEditPart extends FloatingLabelEditPa
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class ComponentCompositeFloatingLabelEditPart extends FloatingLabelEditPa
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class ComponentCompositeFloatingLabelEditPart extends FloatingLabelEditPa
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class ComponentCompositeFloatingLabelEditPart extends FloatingLabelEditPa
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class ComponentCompositeFloatingLabelEditPart extends FloatingLabelEditPa
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class ComponentCompositeFloatingLabelEditPart extends FloatingLabelEditPa
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class ComponentCompositeFloatingLabelEditPart extends FloatingLabelEditPa
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class ComponentCompositeFloatingLabelEditPart extends FloatingLabelEditPa
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class ComponentCompositeFloatingLabelEditPart extends FloatingLabelEditPa
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class ComponentCompositeFloatingLabelEditPart extends FloatingLabelEditPa
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Component_2069, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.ComponentCompositeFloatingLabelEditPart.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class ComponentCompositeFloatingLabelEditPart extends FloatingLabelEditPa
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class ComponentCompositeFloatingLabelEditPart extends FloatingLabelEditPa
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class ComponentCompositeFloatingLabelEditPart extends FloatingLabelEditPa
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class ComponentCompositeFloatingLabelEditPart extends FloatingLabelEditPa
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class ComponentCompositeFloatingLabelEditPart extends FloatingLabelEditPa
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class ComponentCompositeFloatingLabelEditPart extends FloatingLabelEditPa
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class ComponentCompositeFloatingLabelEditPart extends FloatingLabelEditPa
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class ComponentCompositeFloatingLabelEditPart extends FloatingLabelEditPa
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class ComponentCompositeFloatingLabelEditPart extends FloatingLabelEditPa
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class ComponentCompositeFloatingLabelEditPart extends FloatingLabelEditPa
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class ComponentCompositeFloatingLabelEditPart extends FloatingLabelEditPa
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class ComponentCompositeFloatingLabelEditPart extends FloatingLabelEditPa
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class ComponentCompositeFloatingLabelEditPart extends FloatingLabelEditPa
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class ComponentCompositeFloatingLabelEditPart extends FloatingLabelEditPa
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class ComponentCompositeFloatingLabelEditPart extends FloatingLabelEditPa
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class ComponentCompositeFloatingLabelEditPart extends FloatingLabelEditPa
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class ComponentCompositeFloatingLabelEditPart extends FloatingLabelEditPa
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class ComponentCompositeFloatingLabelEditPart extends FloatingLabelEditPa
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentCompositeFloatingLabelEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentCompositeFloatingLabelEditPartCN.java
index b6964bd3c1e..53c328815dc 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentCompositeFloatingLabelEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentCompositeFloatingLabelEditPartCN.java
@@ -113,15 +113,18 @@ public class ComponentCompositeFloatingLabelEditPartCN extends FloatingLabelEdit
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class ComponentCompositeFloatingLabelEditPartCN extends FloatingLabelEdit
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class ComponentCompositeFloatingLabelEditPartCN extends FloatingLabelEdit
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class ComponentCompositeFloatingLabelEditPartCN extends FloatingLabelEdit
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class ComponentCompositeFloatingLabelEditPartCN extends FloatingLabelEdit
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class ComponentCompositeFloatingLabelEditPartCN extends FloatingLabelEdit
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class ComponentCompositeFloatingLabelEditPartCN extends FloatingLabelEdit
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class ComponentCompositeFloatingLabelEditPartCN extends FloatingLabelEdit
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class ComponentCompositeFloatingLabelEditPartCN extends FloatingLabelEdit
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class ComponentCompositeFloatingLabelEditPartCN extends FloatingLabelEdit
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class ComponentCompositeFloatingLabelEditPartCN extends FloatingLabelEdit
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class ComponentCompositeFloatingLabelEditPartCN extends FloatingLabelEdit
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class ComponentCompositeFloatingLabelEditPartCN extends FloatingLabelEdit
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class ComponentCompositeFloatingLabelEditPartCN extends FloatingLabelEdit
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Component_3081, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.ComponentCompositeFloatingLabelEditPartCN.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class ComponentCompositeFloatingLabelEditPartCN extends FloatingLabelEdit
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class ComponentCompositeFloatingLabelEditPartCN extends FloatingLabelEdit
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class ComponentCompositeFloatingLabelEditPartCN extends FloatingLabelEdit
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class ComponentCompositeFloatingLabelEditPartCN extends FloatingLabelEdit
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class ComponentCompositeFloatingLabelEditPartCN extends FloatingLabelEdit
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class ComponentCompositeFloatingLabelEditPartCN extends FloatingLabelEdit
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class ComponentCompositeFloatingLabelEditPartCN extends FloatingLabelEdit
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class ComponentCompositeFloatingLabelEditPartCN extends FloatingLabelEdit
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class ComponentCompositeFloatingLabelEditPartCN extends FloatingLabelEdit
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class ComponentCompositeFloatingLabelEditPartCN extends FloatingLabelEdit
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class ComponentCompositeFloatingLabelEditPartCN extends FloatingLabelEdit
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class ComponentCompositeFloatingLabelEditPartCN extends FloatingLabelEdit
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class ComponentCompositeFloatingLabelEditPartCN extends FloatingLabelEdit
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class ComponentCompositeFloatingLabelEditPartCN extends FloatingLabelEdit
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class ComponentCompositeFloatingLabelEditPartCN extends FloatingLabelEdit
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class ComponentCompositeFloatingLabelEditPartCN extends FloatingLabelEdit
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class ComponentCompositeFloatingLabelEditPartCN extends FloatingLabelEdit
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class ComponentCompositeFloatingLabelEditPartCN extends FloatingLabelEdit
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentCompositeNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentCompositeNameEditPart.java
index d4f38c620e6..4a971128fec 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentCompositeNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentCompositeNameEditPart.java
@@ -114,12 +114,14 @@ public class ComponentCompositeNameEditPart extends PapyrusCompartmentEditPart i
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class ComponentCompositeNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class ComponentCompositeNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class ComponentCompositeNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class ComponentCompositeNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class ComponentCompositeNameEditPart extends PapyrusCompartmentEditPart i
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class ComponentCompositeNameEditPart extends PapyrusCompartmentEditPart i
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class ComponentCompositeNameEditPart extends PapyrusCompartmentEditPart i
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class ComponentCompositeNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class ComponentCompositeNameEditPart extends PapyrusCompartmentEditPart i
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class ComponentCompositeNameEditPart extends PapyrusCompartmentEditPart i
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class ComponentCompositeNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class ComponentCompositeNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Component_2069, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.ComponentCompositeNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class ComponentCompositeNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class ComponentCompositeNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class ComponentCompositeNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class ComponentCompositeNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class ComponentCompositeNameEditPart extends PapyrusCompartmentEditPart i
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class ComponentCompositeNameEditPart extends PapyrusCompartmentEditPart i
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class ComponentCompositeNameEditPart extends PapyrusCompartmentEditPart i
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class ComponentCompositeNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class ComponentCompositeNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class ComponentCompositeNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class ComponentCompositeNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class ComponentCompositeNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class ComponentCompositeNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class ComponentCompositeNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class ComponentCompositeNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class ComponentCompositeNameEditPart extends PapyrusCompartmentEditPart i
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class ComponentCompositeNameEditPart extends PapyrusCompartmentEditPart i
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class ComponentCompositeNameEditPart extends PapyrusCompartmentEditPart i
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class ComponentCompositeNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class ComponentCompositeNameEditPart extends PapyrusCompartmentEditPart i
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class ComponentCompositeNameEditPart extends PapyrusCompartmentEditPart i
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentCompositeNameEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentCompositeNameEditPartCN.java
index 919fbd9c72a..bb3dcec39fe 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentCompositeNameEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentCompositeNameEditPartCN.java
@@ -114,12 +114,14 @@ public class ComponentCompositeNameEditPartCN extends PapyrusCompartmentEditPart
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class ComponentCompositeNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class ComponentCompositeNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class ComponentCompositeNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class ComponentCompositeNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class ComponentCompositeNameEditPartCN extends PapyrusCompartmentEditPart
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class ComponentCompositeNameEditPartCN extends PapyrusCompartmentEditPart
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class ComponentCompositeNameEditPartCN extends PapyrusCompartmentEditPart
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class ComponentCompositeNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class ComponentCompositeNameEditPartCN extends PapyrusCompartmentEditPart
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class ComponentCompositeNameEditPartCN extends PapyrusCompartmentEditPart
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class ComponentCompositeNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class ComponentCompositeNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Component_3081, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.ComponentCompositeNameEditPartCN.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class ComponentCompositeNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class ComponentCompositeNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class ComponentCompositeNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class ComponentCompositeNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class ComponentCompositeNameEditPartCN extends PapyrusCompartmentEditPart
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class ComponentCompositeNameEditPartCN extends PapyrusCompartmentEditPart
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class ComponentCompositeNameEditPartCN extends PapyrusCompartmentEditPart
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class ComponentCompositeNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class ComponentCompositeNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class ComponentCompositeNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class ComponentCompositeNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class ComponentCompositeNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class ComponentCompositeNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class ComponentCompositeNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class ComponentCompositeNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class ComponentCompositeNameEditPartCN extends PapyrusCompartmentEditPart
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class ComponentCompositeNameEditPartCN extends PapyrusCompartmentEditPart
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class ComponentCompositeNameEditPartCN extends PapyrusCompartmentEditPart
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class ComponentCompositeNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class ComponentCompositeNameEditPartCN extends PapyrusCompartmentEditPart
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class ComponentCompositeNameEditPartCN extends PapyrusCompartmentEditPart
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentRealizationAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentRealizationAppliedStereotypeEditPart.java
index af40f2e7181..c3e6a16cfe6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentRealizationAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentRealizationAppliedStereotypeEditPart.java
@@ -123,6 +123,7 @@ public class ComponentRealizationAppliedStereotypeEditPart extends PapyrusLabelE
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -211,8 +212,7 @@ public class ComponentRealizationAppliedStereotypeEditPart extends PapyrusLabelE
/**
* @generated
*/
- public void setLabel(IFigure
- figure) {
+ public void setLabel(IFigure figure) {
unregisterVisuals();
setFigure(figure);
defaultText = getLabelTextHelper(figure);
@@ -324,15 +324,14 @@ public class ComponentRealizationAppliedStereotypeEditPart extends PapyrusLabelE
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid =
- (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
@@ -461,8 +460,7 @@ public class ComponentRealizationAppliedStereotypeEditPart extends PapyrusLabelE
IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- }
- else if (configuration instanceof IAdvancedEditorConfiguration) {
+ } 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);
@@ -507,8 +505,7 @@ public class ComponentRealizationAppliedStereotypeEditPart extends PapyrusLabelE
RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- }
- else {
+ } else {
performDirectEdit();
}
}
@@ -558,17 +555,15 @@ public class ComponentRealizationAppliedStereotypeEditPart extends PapyrusLabelE
* @generated
*/
protected void refreshUnderline() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
if (resolveSemanticElement() instanceof Feature) {
if (((Feature) resolveSemanticElement()).isStatic()) {
((WrappingLabel) getFigure()).setTextUnderline(true);
- }
- else {
+ } else {
((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
@@ -578,9 +573,8 @@ public class ComponentRealizationAppliedStereotypeEditPart extends PapyrusLabelE
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
@@ -591,14 +585,12 @@ public class ComponentRealizationAppliedStereotypeEditPart extends PapyrusLabelE
*/
@Override
protected void refreshFont() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ 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));
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -684,7 +676,7 @@ public class ComponentRealizationAppliedStereotypeEditPart extends PapyrusLabelE
*/
protected boolean checkExtendedEditor() {
if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -708,9 +700,9 @@ public class ComponentRealizationAppliedStereotypeEditPart extends PapyrusLabelE
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());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
@@ -724,8 +716,7 @@ public class ComponentRealizationAppliedStereotypeEditPart extends PapyrusLabelE
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement()
- .eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
@@ -777,18 +768,15 @@ public class ComponentRealizationAppliedStereotypeEditPart extends PapyrusLabelE
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)) {
+ } 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();
+ ISemanticParser modelParser = (ISemanticParser) getParser();
if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
if (resolveSemanticElement() != null) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentRealizationEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentRealizationEditPart.java
index 214b353d10b..9daceb8bcc0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentRealizationEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentRealizationEditPart.java
@@ -51,11 +51,13 @@ public class ComponentRealizationEditPart extends UMLConnectionNodeEditPart impl
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ComponentRealizationNameEditPart) {
- ((ComponentRealizationNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof ComponentRealizationNameEditPart) {
+ ((ComponentRealizationNameEditPart) childEditPart).setLabel(
+ getPrimaryShape().getNameLabel());
}
- if(childEditPart instanceof ComponentRealizationAppliedStereotypeEditPart) {
- ((ComponentRealizationAppliedStereotypeEditPart)childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
+ if (childEditPart instanceof ComponentRealizationAppliedStereotypeEditPart) {
+ ((ComponentRealizationAppliedStereotypeEditPart) childEditPart).setLabel(
+ getPrimaryShape().getAppliedStereotypeLabel());
}
return false;
}
@@ -64,7 +66,7 @@ public class ComponentRealizationEditPart extends UMLConnectionNodeEditPart impl
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -74,10 +76,10 @@ public class ComponentRealizationEditPart extends UMLConnectionNodeEditPart impl
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ComponentRealizationNameEditPart) {
+ if (childEditPart instanceof ComponentRealizationNameEditPart) {
return true;
}
- if(childEditPart instanceof ComponentRealizationAppliedStereotypeEditPart) {
+ if (childEditPart instanceof ComponentRealizationAppliedStereotypeEditPart) {
return true;
}
return false;
@@ -87,7 +89,7 @@ public class ComponentRealizationEditPart extends UMLConnectionNodeEditPart impl
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -109,6 +111,6 @@ public class ComponentRealizationEditPart extends UMLConnectionNodeEditPart impl
* @generated
*/
public InterfaceRealizationFigure getPrimaryShape() {
- return (InterfaceRealizationFigure)getFigure();
+ return (InterfaceRealizationFigure) getFigure();
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentRealizationNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentRealizationNameEditPart.java
index 0f22e906c8c..b52c836f3e9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentRealizationNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ComponentRealizationNameEditPart.java
@@ -123,6 +123,7 @@ public class ComponentRealizationNameEditPart extends PapyrusLabelEditPart imple
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -211,8 +212,7 @@ public class ComponentRealizationNameEditPart extends PapyrusLabelEditPart imple
/**
* @generated
*/
- public void setLabel(IFigure
- figure) {
+ public void setLabel(IFigure figure) {
unregisterVisuals();
setFigure(figure);
defaultText = getLabelTextHelper(figure);
@@ -324,15 +324,14 @@ public class ComponentRealizationNameEditPart extends PapyrusLabelEditPart imple
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid =
- (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
@@ -461,8 +460,7 @@ public class ComponentRealizationNameEditPart extends PapyrusLabelEditPart imple
IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- }
- else if (configuration instanceof IAdvancedEditorConfiguration) {
+ } 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);
@@ -507,8 +505,7 @@ public class ComponentRealizationNameEditPart extends PapyrusLabelEditPart imple
RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- }
- else {
+ } else {
performDirectEdit();
}
}
@@ -558,17 +555,15 @@ public class ComponentRealizationNameEditPart extends PapyrusLabelEditPart imple
* @generated
*/
protected void refreshUnderline() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
if (resolveSemanticElement() instanceof Feature) {
if (((Feature) resolveSemanticElement()).isStatic()) {
((WrappingLabel) getFigure()).setTextUnderline(true);
- }
- else {
+ } else {
((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
@@ -578,9 +573,8 @@ public class ComponentRealizationNameEditPart extends PapyrusLabelEditPart imple
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
@@ -591,14 +585,12 @@ public class ComponentRealizationNameEditPart extends PapyrusLabelEditPart imple
*/
@Override
protected void refreshFont() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ 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));
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -692,7 +684,7 @@ public class ComponentRealizationNameEditPart extends PapyrusLabelEditPart imple
*/
protected boolean checkExtendedEditor() {
if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -716,9 +708,9 @@ public class ComponentRealizationNameEditPart extends PapyrusLabelEditPart imple
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());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
@@ -732,8 +724,7 @@ public class ComponentRealizationNameEditPart extends PapyrusLabelEditPart imple
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement()
- .eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
@@ -785,18 +776,15 @@ public class ComponentRealizationNameEditPart extends PapyrusLabelEditPart imple
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)) {
+ } 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();
+ ISemanticParser modelParser = (ISemanticParser) getParser();
if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
if (resolveSemanticElement() != null) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CompositeStructureDiagramEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CompositeStructureDiagramEditPart.java
index 2cadc7118aa..0b90574a281 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CompositeStructureDiagramEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/CompositeStructureDiagramEditPart.java
@@ -47,8 +47,10 @@ public class CompositeStructureDiagramEditPart extends PapyrusDiagramEditPart {
*/
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
+
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new DefaultCreationEditPolicy());
installEditPolicy(PasteEditPolicy.PASTE_ROLE, new PasteEditPolicy());
+
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultCompartmentSemanticEditPolicy());
installEditPolicy("REMOVE_ORPHAN_VIEW", new RemoveOrphanViewPolicy()); //$NON-NLS-1$
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConnectorAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConnectorAppliedStereotypeEditPart.java
index f63f1efb29d..b9a892ee76b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConnectorAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConnectorAppliedStereotypeEditPart.java
@@ -123,6 +123,7 @@ public class ConnectorAppliedStereotypeEditPart extends PapyrusLabelEditPart imp
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -211,8 +212,7 @@ public class ConnectorAppliedStereotypeEditPart extends PapyrusLabelEditPart imp
/**
* @generated
*/
- public void setLabel(IFigure
- figure) {
+ public void setLabel(IFigure figure) {
unregisterVisuals();
setFigure(figure);
defaultText = getLabelTextHelper(figure);
@@ -324,15 +324,14 @@ public class ConnectorAppliedStereotypeEditPart extends PapyrusLabelEditPart imp
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid =
- (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
@@ -461,8 +460,7 @@ public class ConnectorAppliedStereotypeEditPart extends PapyrusLabelEditPart imp
IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- }
- else if (configuration instanceof IAdvancedEditorConfiguration) {
+ } 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);
@@ -507,8 +505,7 @@ public class ConnectorAppliedStereotypeEditPart extends PapyrusLabelEditPart imp
RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- }
- else {
+ } else {
performDirectEdit();
}
}
@@ -558,17 +555,15 @@ public class ConnectorAppliedStereotypeEditPart extends PapyrusLabelEditPart imp
* @generated
*/
protected void refreshUnderline() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
if (resolveSemanticElement() instanceof Feature) {
if (((Feature) resolveSemanticElement()).isStatic()) {
((WrappingLabel) getFigure()).setTextUnderline(true);
- }
- else {
+ } else {
((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
@@ -578,9 +573,8 @@ public class ConnectorAppliedStereotypeEditPart extends PapyrusLabelEditPart imp
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
@@ -591,14 +585,12 @@ public class ConnectorAppliedStereotypeEditPart extends PapyrusLabelEditPart imp
*/
@Override
protected void refreshFont() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ 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));
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -684,7 +676,7 @@ public class ConnectorAppliedStereotypeEditPart extends PapyrusLabelEditPart imp
*/
protected boolean checkExtendedEditor() {
if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -708,9 +700,9 @@ public class ConnectorAppliedStereotypeEditPart extends PapyrusLabelEditPart imp
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());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
@@ -724,8 +716,7 @@ public class ConnectorAppliedStereotypeEditPart extends PapyrusLabelEditPart imp
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement()
- .eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
@@ -777,18 +768,15 @@ public class ConnectorAppliedStereotypeEditPart extends PapyrusLabelEditPart imp
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)) {
+ } 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();
+ ISemanticParser modelParser = (ISemanticParser) getParser();
if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
if (resolveSemanticElement() != null) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConnectorEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConnectorEditPart.java
index ede2e7d64f0..9f67533a009 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConnectorEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConnectorEditPart.java
@@ -51,17 +51,21 @@ public class ConnectorEditPart extends UMLConnectionNodeEditPart implements ITre
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ConnectorAppliedStereotypeEditPart) {
- ((ConnectorAppliedStereotypeEditPart)childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
+ if (childEditPart instanceof ConnectorAppliedStereotypeEditPart) {
+ ((ConnectorAppliedStereotypeEditPart) childEditPart).setLabel(
+ getPrimaryShape().getAppliedStereotypeLabel());
}
- if(childEditPart instanceof ConnectorNameEditPart) {
- ((ConnectorNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof ConnectorNameEditPart) {
+ ((ConnectorNameEditPart) childEditPart).setLabel(
+ getPrimaryShape().getNameLabel());
}
- if(childEditPart instanceof ConnectorMultiplicitySourceEditPart) {
- ((ConnectorMultiplicitySourceEditPart)childEditPart).setLabel(getPrimaryShape().getMultiplicitySourceLabel());
+ if (childEditPart instanceof ConnectorMultiplicitySourceEditPart) {
+ ((ConnectorMultiplicitySourceEditPart) childEditPart).setLabel(
+ getPrimaryShape().getMultiplicitySourceLabel());
}
- if(childEditPart instanceof ConnectorMultiplicityTargetEditPart) {
- ((ConnectorMultiplicityTargetEditPart)childEditPart).setLabel(getPrimaryShape().getMultiplicityTargetLabel());
+ if (childEditPart instanceof ConnectorMultiplicityTargetEditPart) {
+ ((ConnectorMultiplicityTargetEditPart) childEditPart).setLabel(
+ getPrimaryShape().getMultiplicityTargetLabel());
}
return false;
}
@@ -70,7 +74,7 @@ public class ConnectorEditPart extends UMLConnectionNodeEditPart implements ITre
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -80,16 +84,16 @@ public class ConnectorEditPart extends UMLConnectionNodeEditPart implements ITre
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ConnectorAppliedStereotypeEditPart) {
+ if (childEditPart instanceof ConnectorAppliedStereotypeEditPart) {
return true;
}
- if(childEditPart instanceof ConnectorNameEditPart) {
+ if (childEditPart instanceof ConnectorNameEditPart) {
return true;
}
- if(childEditPart instanceof ConnectorMultiplicitySourceEditPart) {
+ if (childEditPart instanceof ConnectorMultiplicitySourceEditPart) {
return true;
}
- if(childEditPart instanceof ConnectorMultiplicityTargetEditPart) {
+ if (childEditPart instanceof ConnectorMultiplicityTargetEditPart) {
return true;
}
return false;
@@ -99,7 +103,7 @@ public class ConnectorEditPart extends UMLConnectionNodeEditPart implements ITre
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -121,6 +125,6 @@ public class ConnectorEditPart extends UMLConnectionNodeEditPart implements ITre
* @generated
*/
public ConnectorFigure getPrimaryShape() {
- return (ConnectorFigure)getFigure();
+ return (ConnectorFigure) getFigure();
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConnectorMultiplicitySourceEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConnectorMultiplicitySourceEditPart.java
index 88d888d61fd..b0e616eadc9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConnectorMultiplicitySourceEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConnectorMultiplicitySourceEditPart.java
@@ -123,6 +123,7 @@ public class ConnectorMultiplicitySourceEditPart extends PapyrusLabelEditPart im
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -211,8 +212,7 @@ public class ConnectorMultiplicitySourceEditPart extends PapyrusLabelEditPart im
/**
* @generated
*/
- public void setLabel(IFigure
- figure) {
+ public void setLabel(IFigure figure) {
unregisterVisuals();
setFigure(figure);
defaultText = getLabelTextHelper(figure);
@@ -324,15 +324,14 @@ public class ConnectorMultiplicitySourceEditPart extends PapyrusLabelEditPart im
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid =
- (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
@@ -461,8 +460,7 @@ public class ConnectorMultiplicitySourceEditPart extends PapyrusLabelEditPart im
IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- }
- else if (configuration instanceof IAdvancedEditorConfiguration) {
+ } 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);
@@ -507,8 +505,7 @@ public class ConnectorMultiplicitySourceEditPart extends PapyrusLabelEditPart im
RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- }
- else {
+ } else {
performDirectEdit();
}
}
@@ -558,17 +555,15 @@ public class ConnectorMultiplicitySourceEditPart extends PapyrusLabelEditPart im
* @generated
*/
protected void refreshUnderline() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
if (resolveSemanticElement() instanceof Feature) {
if (((Feature) resolveSemanticElement()).isStatic()) {
((WrappingLabel) getFigure()).setTextUnderline(true);
- }
- else {
+ } else {
((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
@@ -578,9 +573,8 @@ public class ConnectorMultiplicitySourceEditPart extends PapyrusLabelEditPart im
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
@@ -591,14 +585,12 @@ public class ConnectorMultiplicitySourceEditPart extends PapyrusLabelEditPart im
*/
@Override
protected void refreshFont() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ 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));
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -684,7 +676,7 @@ public class ConnectorMultiplicitySourceEditPart extends PapyrusLabelEditPart im
*/
protected boolean checkExtendedEditor() {
if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -708,9 +700,9 @@ public class ConnectorMultiplicitySourceEditPart extends PapyrusLabelEditPart im
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());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
@@ -724,8 +716,7 @@ public class ConnectorMultiplicitySourceEditPart extends PapyrusLabelEditPart im
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement()
- .eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
@@ -777,18 +768,15 @@ public class ConnectorMultiplicitySourceEditPart extends PapyrusLabelEditPart im
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)) {
+ } 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();
+ ISemanticParser modelParser = (ISemanticParser) getParser();
if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
if (resolveSemanticElement() != null) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConnectorMultiplicityTargetEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConnectorMultiplicityTargetEditPart.java
index 53b9b8738de..dda04a7c7a7 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConnectorMultiplicityTargetEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConnectorMultiplicityTargetEditPart.java
@@ -123,6 +123,7 @@ public class ConnectorMultiplicityTargetEditPart extends PapyrusLabelEditPart im
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -211,8 +212,7 @@ public class ConnectorMultiplicityTargetEditPart extends PapyrusLabelEditPart im
/**
* @generated
*/
- public void setLabel(IFigure
- figure) {
+ public void setLabel(IFigure figure) {
unregisterVisuals();
setFigure(figure);
defaultText = getLabelTextHelper(figure);
@@ -324,15 +324,14 @@ public class ConnectorMultiplicityTargetEditPart extends PapyrusLabelEditPart im
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid =
- (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
@@ -461,8 +460,7 @@ public class ConnectorMultiplicityTargetEditPart extends PapyrusLabelEditPart im
IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- }
- else if (configuration instanceof IAdvancedEditorConfiguration) {
+ } 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);
@@ -507,8 +505,7 @@ public class ConnectorMultiplicityTargetEditPart extends PapyrusLabelEditPart im
RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- }
- else {
+ } else {
performDirectEdit();
}
}
@@ -558,17 +555,15 @@ public class ConnectorMultiplicityTargetEditPart extends PapyrusLabelEditPart im
* @generated
*/
protected void refreshUnderline() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
if (resolveSemanticElement() instanceof Feature) {
if (((Feature) resolveSemanticElement()).isStatic()) {
((WrappingLabel) getFigure()).setTextUnderline(true);
- }
- else {
+ } else {
((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
@@ -578,9 +573,8 @@ public class ConnectorMultiplicityTargetEditPart extends PapyrusLabelEditPart im
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
@@ -591,14 +585,12 @@ public class ConnectorMultiplicityTargetEditPart extends PapyrusLabelEditPart im
*/
@Override
protected void refreshFont() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ 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));
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -684,7 +676,7 @@ public class ConnectorMultiplicityTargetEditPart extends PapyrusLabelEditPart im
*/
protected boolean checkExtendedEditor() {
if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -708,9 +700,9 @@ public class ConnectorMultiplicityTargetEditPart extends PapyrusLabelEditPart im
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());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
@@ -724,8 +716,7 @@ public class ConnectorMultiplicityTargetEditPart extends PapyrusLabelEditPart im
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement()
- .eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
@@ -777,18 +768,15 @@ public class ConnectorMultiplicityTargetEditPart extends PapyrusLabelEditPart im
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)) {
+ } 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();
+ ISemanticParser modelParser = (ISemanticParser) getParser();
if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
if (resolveSemanticElement() != null) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConnectorNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConnectorNameEditPart.java
index 283a64f5174..a999df6e8d7 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConnectorNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConnectorNameEditPart.java
@@ -69,6 +69,7 @@ import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEdi
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.util.DiagramEditPartsUtil;
import org.eclipse.papyrus.uml.diagram.composite.edit.policies.UMLTextSelectionEditPolicy;
import org.eclipse.papyrus.uml.diagram.composite.part.UMLVisualIDRegistry;
import org.eclipse.papyrus.uml.diagram.composite.providers.UMLElementTypes;
@@ -126,6 +127,7 @@ public class ConnectorNameEditPart extends PapyrusLabelEditPart implements IText
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -214,8 +216,7 @@ public class ConnectorNameEditPart extends PapyrusLabelEditPart implements IText
/**
* @generated
*/
- public void setLabel(IFigure
- figure) {
+ public void setLabel(IFigure figure) {
unregisterVisuals();
setFigure(figure);
defaultText = getLabelTextHelper(figure);
@@ -262,7 +263,7 @@ public class ConnectorNameEditPart extends PapyrusLabelEditPart implements IText
if (parserElement == null) {
return null;
}
- List<View> views = org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramEditPartsUtil.findViews(parserElement, getViewer());
+ List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
for (View view : views) {
if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
@@ -337,15 +338,14 @@ public class ConnectorNameEditPart extends PapyrusLabelEditPart implements IText
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid =
- (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
@@ -474,8 +474,7 @@ public class ConnectorNameEditPart extends PapyrusLabelEditPart implements IText
IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- }
- else if (configuration instanceof IAdvancedEditorConfiguration) {
+ } 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);
@@ -520,8 +519,7 @@ public class ConnectorNameEditPart extends PapyrusLabelEditPart implements IText
RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- }
- else {
+ } else {
performDirectEdit();
}
}
@@ -571,17 +569,15 @@ public class ConnectorNameEditPart extends PapyrusLabelEditPart implements IText
* @generated
*/
protected void refreshUnderline() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
if (resolveSemanticElement() instanceof Feature) {
if (((Feature) resolveSemanticElement()).isStatic()) {
((WrappingLabel) getFigure()).setTextUnderline(true);
- }
- else {
+ } else {
((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
@@ -591,9 +587,8 @@ public class ConnectorNameEditPart extends PapyrusLabelEditPart implements IText
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
@@ -604,14 +599,12 @@ public class ConnectorNameEditPart extends PapyrusLabelEditPart implements IText
*/
@Override
protected void refreshFont() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ 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));
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -705,7 +698,7 @@ public class ConnectorNameEditPart extends PapyrusLabelEditPart implements IText
*/
protected boolean checkExtendedEditor() {
if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -729,9 +722,9 @@ public class ConnectorNameEditPart extends PapyrusLabelEditPart implements IText
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());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
@@ -745,8 +738,7 @@ public class ConnectorNameEditPart extends PapyrusLabelEditPart implements IText
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement()
- .eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
@@ -798,18 +790,15 @@ public class ConnectorNameEditPart extends PapyrusLabelEditPart implements IText
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)) {
+ } 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();
+ ISemanticParser modelParser = (ISemanticParser) getParser();
if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
if (resolveSemanticElement() != null) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConstraintConstrainedElementEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConstraintConstrainedElementEditPart.java
index 5422ad520d7..fbc77bc419d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConstraintConstrainedElementEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConstraintConstrainedElementEditPart.java
@@ -60,6 +60,6 @@ public class ConstraintConstrainedElementEditPart extends UMLConnectionNodeEditP
* @generated
*/
public SimpleDashedEdgeFigure getPrimaryShape() {
- return (SimpleDashedEdgeFigure)getFigure();
+ return (SimpleDashedEdgeFigure) getFigure();
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConstraintEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConstraintEditPart.java
index 42849ee9134..21fa9fa4dd1 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConstraintEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConstraintEditPart.java
@@ -70,7 +70,9 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
// XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
@@ -86,7 +88,7 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -106,11 +108,13 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
super.handleNotificationEvent(event);
+
}
/**
@@ -122,24 +126,27 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.ConstraintFigure
+ *
* @generated
*/
public ConstraintFigure getPrimaryShape() {
- return (ConstraintFigure)primaryShape;
+ return (ConstraintFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ConstraintNameEditPart) {
- ((ConstraintNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof ConstraintNameEditPart) {
+ ((ConstraintNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
- if(childEditPart instanceof ConstraintSpecificationEditPart) {
- ((ConstraintSpecificationEditPart)childEditPart).setLabel(getPrimaryShape().getConstraintFigure());
+ if (childEditPart instanceof ConstraintSpecificationEditPart) {
+ ((ConstraintSpecificationEditPart) childEditPart).setLabel(getPrimaryShape().getConstraintFigure());
return true;
}
+
+
return false;
}
@@ -147,10 +154,10 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ConstraintNameEditPart) {
+ if (childEditPart instanceof ConstraintNameEditPart) {
return true;
}
- if(childEditPart instanceof ConstraintSpecificationEditPart) {
+ if (childEditPart instanceof ConstraintSpecificationEditPart) {
return true;
}
return false;
@@ -160,7 +167,7 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -170,7 +177,7 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -198,16 +205,19 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
*/
protected NodeFigure createNodeFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -219,7 +229,7 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -229,7 +239,7 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -245,8 +255,8 @@ public class ConstraintEditPart extends AbstractConstraintEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConstraintEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConstraintEditPartCN.java
index 7a4b560e55f..1190f31a7f8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConstraintEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConstraintEditPartCN.java
@@ -70,7 +70,9 @@ public class ConstraintEditPartCN extends AbstractConstraintEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
// XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
@@ -86,7 +88,7 @@ public class ConstraintEditPartCN extends AbstractConstraintEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -106,11 +108,13 @@ public class ConstraintEditPartCN extends AbstractConstraintEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
super.handleNotificationEvent(event);
+
}
/**
@@ -122,24 +126,27 @@ public class ConstraintEditPartCN extends AbstractConstraintEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.ConstraintFigure
+ *
* @generated
*/
public ConstraintFigure getPrimaryShape() {
- return (ConstraintFigure)primaryShape;
+ return (ConstraintFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ConstraintNameEditPartCN) {
- ((ConstraintNameEditPartCN)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof ConstraintNameEditPartCN) {
+ ((ConstraintNameEditPartCN) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
- if(childEditPart instanceof ConstraintSpecificationEditPartCN) {
- ((ConstraintSpecificationEditPartCN)childEditPart).setLabel(getPrimaryShape().getConstraintFigure());
+ if (childEditPart instanceof ConstraintSpecificationEditPartCN) {
+ ((ConstraintSpecificationEditPartCN) childEditPart).setLabel(getPrimaryShape().getConstraintFigure());
return true;
}
+
+
return false;
}
@@ -147,10 +154,10 @@ public class ConstraintEditPartCN extends AbstractConstraintEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ConstraintNameEditPartCN) {
+ if (childEditPart instanceof ConstraintNameEditPartCN) {
return true;
}
- if(childEditPart instanceof ConstraintSpecificationEditPartCN) {
+ if (childEditPart instanceof ConstraintSpecificationEditPartCN) {
return true;
}
return false;
@@ -160,7 +167,7 @@ public class ConstraintEditPartCN extends AbstractConstraintEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -170,7 +177,7 @@ public class ConstraintEditPartCN extends AbstractConstraintEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -198,16 +205,19 @@ public class ConstraintEditPartCN extends AbstractConstraintEditPart {
*/
protected NodeFigure createNodeFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -219,7 +229,7 @@ public class ConstraintEditPartCN extends AbstractConstraintEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -229,7 +239,7 @@ public class ConstraintEditPartCN extends AbstractConstraintEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -245,8 +255,8 @@ public class ConstraintEditPartCN extends AbstractConstraintEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConstraintNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConstraintNameEditPart.java
index 319732df94e..9f5167d1ff6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConstraintNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConstraintNameEditPart.java
@@ -114,12 +114,14 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Constraint_2114, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.ConstraintNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class ConstraintNameEditPart extends PapyrusCompartmentEditPart implement
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConstraintNameEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConstraintNameEditPartCN.java
index 480cad48a9e..43ecfcad80d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConstraintNameEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConstraintNameEditPartCN.java
@@ -114,12 +114,14 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Constraint_3120, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.ConstraintNameEditPartCN.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart impleme
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConstraintSpecificationEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConstraintSpecificationEditPart.java
index 91ff0c6046a..295568affa0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConstraintSpecificationEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConstraintSpecificationEditPart.java
@@ -110,12 +110,14 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -141,12 +143,12 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -154,12 +156,12 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -167,12 +169,12 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -180,12 +182,12 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -241,10 +243,12 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -256,12 +260,12 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -269,10 +273,12 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -290,15 +296,16 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -306,6 +313,7 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -316,7 +324,7 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -333,7 +341,7 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Constraint_2114, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.ConstraintSpecificationEditPart.VISUAL_ID));
}
return parser;
@@ -343,8 +351,10 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -373,8 +383,8 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -382,8 +392,8 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -393,46 +403,52 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -454,12 +470,12 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -489,12 +505,12 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -503,12 +519,12 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -516,15 +532,16 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -533,9 +550,10 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -543,9 +561,12 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -561,11 +582,11 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -576,8 +597,8 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -589,7 +610,7 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -615,13 +636,14 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -633,8 +655,8 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -651,35 +673,40 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -689,12 +716,13 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -729,24 +757,25 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -781,7 +810,8 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -790,6 +820,7 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -797,5 +828,6 @@ public class ConstraintSpecificationEditPart extends PapyrusCompartmentEditPart
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConstraintSpecificationEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConstraintSpecificationEditPartCN.java
index 88bb26ca9de..993d9a20fef 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConstraintSpecificationEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ConstraintSpecificationEditPartCN.java
@@ -110,12 +110,14 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -141,12 +143,12 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -154,12 +156,12 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -167,12 +169,12 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -180,12 +182,12 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -241,10 +243,12 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -256,12 +260,12 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -269,10 +273,12 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -290,15 +296,16 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -306,6 +313,7 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -316,7 +324,7 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -333,7 +341,7 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Constraint_3120, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.ConstraintSpecificationEditPartCN.VISUAL_ID));
}
return parser;
@@ -343,8 +351,10 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -373,8 +383,8 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -382,8 +392,8 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -393,46 +403,52 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -454,12 +470,12 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -489,12 +505,12 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -503,12 +519,12 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -516,15 +532,16 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -533,9 +550,10 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -543,9 +561,12 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -561,11 +582,11 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -576,8 +597,8 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -589,7 +610,7 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -615,13 +636,14 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -633,8 +655,8 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -651,35 +673,40 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -689,12 +716,13 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -729,24 +757,25 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -781,7 +810,8 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -790,6 +820,7 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -797,5 +828,6 @@ public class ConstraintSpecificationEditPartCN extends PapyrusCompartmentEditPar
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeAttributeCompartmentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeAttributeCompartmentEditPart.java
index b006ba04b26..4c1148585d7 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeAttributeCompartmentEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeAttributeCompartmentEditPart.java
@@ -84,7 +84,7 @@ public class DataTypeAttributeCompartmentEditPart extends ListCompartmentEditPar
* @generated
*/
protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
+ if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
super.setRatio(ratio);
}
}
@@ -93,6 +93,7 @@ public class DataTypeAttributeCompartmentEditPart extends ListCompartmentEditPar
* @generated
*/
public EditPart getTargetEditPart(Request request) {
+
return super.getTargetEditPart(request);
}
@@ -101,7 +102,10 @@ public class DataTypeAttributeCompartmentEditPart extends ListCompartmentEditPar
*/
protected void handleNotificationEvent(Notification notification) {
Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
+ if (NotationPackage.eINSTANCE.getSize_Width().equals(feature)
+ || NotationPackage.eINSTANCE.getSize_Height().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_X().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
refreshBounds();
}
super.handleNotificationEvent(notification);
@@ -111,13 +115,16 @@ public class DataTypeAttributeCompartmentEditPart extends ListCompartmentEditPar
* @generated
*/
protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
+ ((GraphicalEditPart) getParent()).setLayoutConstraint(
+ this,
+ getFigure(),
+ new Rectangle(loc, size));
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeAttributeCompartmentEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeAttributeCompartmentEditPartCN.java
index 66ce054330c..f376b253fe4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeAttributeCompartmentEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeAttributeCompartmentEditPartCN.java
@@ -84,7 +84,7 @@ public class DataTypeAttributeCompartmentEditPartCN extends ListCompartmentEditP
* @generated
*/
protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
+ if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
super.setRatio(ratio);
}
}
@@ -93,6 +93,7 @@ public class DataTypeAttributeCompartmentEditPartCN extends ListCompartmentEditP
* @generated
*/
public EditPart getTargetEditPart(Request request) {
+
return super.getTargetEditPart(request);
}
@@ -101,7 +102,10 @@ public class DataTypeAttributeCompartmentEditPartCN extends ListCompartmentEditP
*/
protected void handleNotificationEvent(Notification notification) {
Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
+ if (NotationPackage.eINSTANCE.getSize_Width().equals(feature)
+ || NotationPackage.eINSTANCE.getSize_Height().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_X().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
refreshBounds();
}
super.handleNotificationEvent(notification);
@@ -111,13 +115,16 @@ public class DataTypeAttributeCompartmentEditPartCN extends ListCompartmentEditP
* @generated
*/
protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
+ ((GraphicalEditPart) getParent()).setLayoutConstraint(
+ this,
+ getFigure(),
+ new Rectangle(loc, size));
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeEditPart.java
index e81ba0450b1..f3bdf48045d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeEditPart.java
@@ -92,7 +92,9 @@ public class DataTypeEditPart extends RoundedCompartmentEditPart {
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new DefaultCreationEditPolicy());
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
@@ -111,21 +113,21 @@ public class DataTypeEditPart extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case DataTypeFloatingLabelEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -145,8 +147,9 @@ public class DataTypeEditPart extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -164,6 +167,7 @@ public class DataTypeEditPart extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -175,32 +179,37 @@ public class DataTypeEditPart extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.DataTypeFigure
+ *
* @generated
*/
public DataTypeFigure getPrimaryShape() {
- return (DataTypeFigure)primaryShape;
+ return (DataTypeFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof DataTypeNameEditPart) {
- ((DataTypeNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof DataTypeNameEditPart) {
+ ((DataTypeNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
- if(childEditPart instanceof DataTypeAttributeCompartmentEditPart) {
+
+
+ if (childEditPart instanceof DataTypeAttributeCompartmentEditPart) {
IFigure pane = getPrimaryShape().getAttributeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((DataTypeAttributeCompartmentEditPart)childEditPart).getFigure());
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.add(((DataTypeAttributeCompartmentEditPart) childEditPart).getFigure());
return true;
}
- if(childEditPart instanceof DataTypeOperationCompartmentEditPart) {
+
+ if (childEditPart instanceof DataTypeOperationCompartmentEditPart) {
IFigure pane = getPrimaryShape().getOperationCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((DataTypeOperationCompartmentEditPart)childEditPart).getFigure());
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.add(((DataTypeOperationCompartmentEditPart) childEditPart).getFigure());
return true;
}
+
return false;
}
@@ -208,17 +217,17 @@ public class DataTypeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof DataTypeNameEditPart) {
+ if (childEditPart instanceof DataTypeNameEditPart) {
return true;
}
- if(childEditPart instanceof DataTypeAttributeCompartmentEditPart) {
+ if (childEditPart instanceof DataTypeAttributeCompartmentEditPart) {
IFigure pane = getPrimaryShape().getAttributeCompartmentFigure();
- pane.remove(((DataTypeAttributeCompartmentEditPart)childEditPart).getFigure());
+ pane.remove(((DataTypeAttributeCompartmentEditPart) childEditPart).getFigure());
return true;
}
- if(childEditPart instanceof DataTypeOperationCompartmentEditPart) {
+ if (childEditPart instanceof DataTypeOperationCompartmentEditPart) {
IFigure pane = getPrimaryShape().getOperationCompartmentFigure();
- pane.remove(((DataTypeOperationCompartmentEditPart)childEditPart).getFigure());
+ pane.remove(((DataTypeOperationCompartmentEditPart) childEditPart).getFigure());
return true;
}
return false;
@@ -228,7 +237,7 @@ public class DataTypeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -238,7 +247,7 @@ public class DataTypeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -248,13 +257,13 @@ public class DataTypeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof DataTypeAttributeCompartmentEditPart) {
+ if (editPart instanceof DataTypeAttributeCompartmentEditPart) {
return getPrimaryShape().getAttributeCompartmentFigure();
}
- if(editPart instanceof DataTypeOperationCompartmentEditPart) {
+ if (editPart instanceof DataTypeOperationCompartmentEditPart) {
return getPrimaryShape().getOperationCompartmentFigure();
}
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -264,7 +273,7 @@ public class DataTypeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof DataTypeFloatingLabelEditPart) {
+ if (borderItemEditPart instanceof DataTypeFloatingLabelEditPart) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -287,16 +296,19 @@ public class DataTypeEditPart extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -308,7 +320,7 @@ public class DataTypeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -318,7 +330,7 @@ public class DataTypeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -334,8 +346,8 @@ public class DataTypeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
@@ -350,13 +362,13 @@ public class DataTypeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
public EditPart getTargetEditPart(Request request) {
- if(request instanceof CreateViewAndElementRequest) {
- CreateElementRequestAdapter adapter = ((CreateViewAndElementRequest)request).getViewAndElementDescriptor().getCreateElementRequestAdapter();
- IElementType type = (IElementType)adapter.getAdapter(IElementType.class);
- if(UMLElementTypes.isKindOf(type, UMLElementTypes.Property_3101)) {
+ if (request instanceof CreateViewAndElementRequest) {
+ CreateElementRequestAdapter adapter = ((CreateViewAndElementRequest) request).getViewAndElementDescriptor().getCreateElementRequestAdapter();
+ IElementType type = (IElementType) adapter.getAdapter(IElementType.class);
+ if (UMLElementTypes.isKindOf(type, UMLElementTypes.Property_3101)) {
return getChildBySemanticHint(UMLVisualIDRegistry.getType(DataTypeAttributeCompartmentEditPart.VISUAL_ID));
}
- if(UMLElementTypes.isKindOf(type, UMLElementTypes.Operation_3102)) {
+ if (UMLElementTypes.isKindOf(type, UMLElementTypes.Operation_3102)) {
return getChildBySemanticHint(UMLVisualIDRegistry.getType(DataTypeOperationCompartmentEditPart.VISUAL_ID));
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeEditPartCN.java
index f413388d405..838fcd5bd0d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeEditPartCN.java
@@ -92,7 +92,9 @@ public class DataTypeEditPartCN extends RoundedCompartmentEditPart {
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new DefaultCreationEditPolicy());
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
@@ -111,21 +113,21 @@ public class DataTypeEditPartCN extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case DataTypeFloatingLabelEditPartCN.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -145,8 +147,9 @@ public class DataTypeEditPartCN extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -164,6 +167,7 @@ public class DataTypeEditPartCN extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -175,32 +179,37 @@ public class DataTypeEditPartCN extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.DataTypeFigure
+ *
* @generated
*/
public DataTypeFigure getPrimaryShape() {
- return (DataTypeFigure)primaryShape;
+ return (DataTypeFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof DataTypeNameEditPartCN) {
- ((DataTypeNameEditPartCN)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof DataTypeNameEditPartCN) {
+ ((DataTypeNameEditPartCN) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
- if(childEditPart instanceof DataTypeAttributeCompartmentEditPartCN) {
+
+
+ if (childEditPart instanceof DataTypeAttributeCompartmentEditPartCN) {
IFigure pane = getPrimaryShape().getAttributeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((DataTypeAttributeCompartmentEditPartCN)childEditPart).getFigure());
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.add(((DataTypeAttributeCompartmentEditPartCN) childEditPart).getFigure());
return true;
}
- if(childEditPart instanceof DataTypeOperationCompartmentEditPartCN) {
+
+ if (childEditPart instanceof DataTypeOperationCompartmentEditPartCN) {
IFigure pane = getPrimaryShape().getOperationCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((DataTypeOperationCompartmentEditPartCN)childEditPart).getFigure());
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.add(((DataTypeOperationCompartmentEditPartCN) childEditPart).getFigure());
return true;
}
+
return false;
}
@@ -208,17 +217,17 @@ public class DataTypeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof DataTypeNameEditPartCN) {
+ if (childEditPart instanceof DataTypeNameEditPartCN) {
return true;
}
- if(childEditPart instanceof DataTypeAttributeCompartmentEditPartCN) {
+ if (childEditPart instanceof DataTypeAttributeCompartmentEditPartCN) {
IFigure pane = getPrimaryShape().getAttributeCompartmentFigure();
- pane.remove(((DataTypeAttributeCompartmentEditPartCN)childEditPart).getFigure());
+ pane.remove(((DataTypeAttributeCompartmentEditPartCN) childEditPart).getFigure());
return true;
}
- if(childEditPart instanceof DataTypeOperationCompartmentEditPartCN) {
+ if (childEditPart instanceof DataTypeOperationCompartmentEditPartCN) {
IFigure pane = getPrimaryShape().getOperationCompartmentFigure();
- pane.remove(((DataTypeOperationCompartmentEditPartCN)childEditPart).getFigure());
+ pane.remove(((DataTypeOperationCompartmentEditPartCN) childEditPart).getFigure());
return true;
}
return false;
@@ -228,7 +237,7 @@ public class DataTypeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -238,7 +247,7 @@ public class DataTypeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -248,13 +257,13 @@ public class DataTypeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof DataTypeAttributeCompartmentEditPartCN) {
+ if (editPart instanceof DataTypeAttributeCompartmentEditPartCN) {
return getPrimaryShape().getAttributeCompartmentFigure();
}
- if(editPart instanceof DataTypeOperationCompartmentEditPartCN) {
+ if (editPart instanceof DataTypeOperationCompartmentEditPartCN) {
return getPrimaryShape().getOperationCompartmentFigure();
}
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -264,7 +273,7 @@ public class DataTypeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof DataTypeFloatingLabelEditPartCN) {
+ if (borderItemEditPart instanceof DataTypeFloatingLabelEditPartCN) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -287,16 +296,19 @@ public class DataTypeEditPartCN extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -308,7 +320,7 @@ public class DataTypeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -318,7 +330,7 @@ public class DataTypeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -334,8 +346,8 @@ public class DataTypeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
@@ -350,13 +362,13 @@ public class DataTypeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
public EditPart getTargetEditPart(Request request) {
- if(request instanceof CreateViewAndElementRequest) {
- CreateElementRequestAdapter adapter = ((CreateViewAndElementRequest)request).getViewAndElementDescriptor().getCreateElementRequestAdapter();
- IElementType type = (IElementType)adapter.getAdapter(IElementType.class);
- if(UMLElementTypes.isKindOf(type, UMLElementTypes.Property_3101)) {
+ if (request instanceof CreateViewAndElementRequest) {
+ CreateElementRequestAdapter adapter = ((CreateViewAndElementRequest) request).getViewAndElementDescriptor().getCreateElementRequestAdapter();
+ IElementType type = (IElementType) adapter.getAdapter(IElementType.class);
+ if (UMLElementTypes.isKindOf(type, UMLElementTypes.Property_3101)) {
return getChildBySemanticHint(UMLVisualIDRegistry.getType(DataTypeAttributeCompartmentEditPartCN.VISUAL_ID));
}
- if(UMLElementTypes.isKindOf(type, UMLElementTypes.Operation_3102)) {
+ if (UMLElementTypes.isKindOf(type, UMLElementTypes.Operation_3102)) {
return getChildBySemanticHint(UMLVisualIDRegistry.getType(DataTypeOperationCompartmentEditPartCN.VISUAL_ID));
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeFloatingLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeFloatingLabelEditPart.java
index 68cc11ef490..e4c859a6bbe 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeFloatingLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeFloatingLabelEditPart.java
@@ -113,15 +113,18 @@ public class DataTypeFloatingLabelEditPart extends FloatingLabelEditPart impleme
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class DataTypeFloatingLabelEditPart extends FloatingLabelEditPart impleme
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class DataTypeFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class DataTypeFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class DataTypeFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class DataTypeFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class DataTypeFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class DataTypeFloatingLabelEditPart extends FloatingLabelEditPart impleme
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class DataTypeFloatingLabelEditPart extends FloatingLabelEditPart impleme
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class DataTypeFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class DataTypeFloatingLabelEditPart extends FloatingLabelEditPart impleme
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class DataTypeFloatingLabelEditPart extends FloatingLabelEditPart impleme
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class DataTypeFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class DataTypeFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.DataType_2068, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.DataTypeFloatingLabelEditPart.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class DataTypeFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class DataTypeFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class DataTypeFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class DataTypeFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class DataTypeFloatingLabelEditPart extends FloatingLabelEditPart impleme
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class DataTypeFloatingLabelEditPart extends FloatingLabelEditPart impleme
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class DataTypeFloatingLabelEditPart extends FloatingLabelEditPart impleme
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class DataTypeFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class DataTypeFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class DataTypeFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class DataTypeFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class DataTypeFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class DataTypeFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class DataTypeFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class DataTypeFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class DataTypeFloatingLabelEditPart extends FloatingLabelEditPart impleme
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class DataTypeFloatingLabelEditPart extends FloatingLabelEditPart impleme
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class DataTypeFloatingLabelEditPart extends FloatingLabelEditPart impleme
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeFloatingLabelEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeFloatingLabelEditPartCN.java
index ddfdfff0607..c83dd3e2788 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeFloatingLabelEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeFloatingLabelEditPartCN.java
@@ -113,15 +113,18 @@ public class DataTypeFloatingLabelEditPartCN extends FloatingLabelEditPart imple
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class DataTypeFloatingLabelEditPartCN extends FloatingLabelEditPart imple
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class DataTypeFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class DataTypeFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class DataTypeFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class DataTypeFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class DataTypeFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class DataTypeFloatingLabelEditPartCN extends FloatingLabelEditPart imple
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class DataTypeFloatingLabelEditPartCN extends FloatingLabelEditPart imple
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class DataTypeFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class DataTypeFloatingLabelEditPartCN extends FloatingLabelEditPart imple
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class DataTypeFloatingLabelEditPartCN extends FloatingLabelEditPart imple
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class DataTypeFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class DataTypeFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.DataType_3080, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.DataTypeFloatingLabelEditPartCN.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class DataTypeFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class DataTypeFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class DataTypeFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class DataTypeFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class DataTypeFloatingLabelEditPartCN extends FloatingLabelEditPart imple
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class DataTypeFloatingLabelEditPartCN extends FloatingLabelEditPart imple
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class DataTypeFloatingLabelEditPartCN extends FloatingLabelEditPart imple
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class DataTypeFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class DataTypeFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class DataTypeFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class DataTypeFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class DataTypeFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class DataTypeFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class DataTypeFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class DataTypeFloatingLabelEditPartCN extends FloatingLabelEditPart imple
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class DataTypeFloatingLabelEditPartCN extends FloatingLabelEditPart imple
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class DataTypeFloatingLabelEditPartCN extends FloatingLabelEditPart imple
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class DataTypeFloatingLabelEditPartCN extends FloatingLabelEditPart imple
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeNameEditPart.java
index 048617e9f4a..64591c9796c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeNameEditPart.java
@@ -114,12 +114,14 @@ public class DataTypeNameEditPart extends PapyrusCompartmentEditPart implements
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class DataTypeNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class DataTypeNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class DataTypeNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class DataTypeNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class DataTypeNameEditPart extends PapyrusCompartmentEditPart implements
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class DataTypeNameEditPart extends PapyrusCompartmentEditPart implements
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class DataTypeNameEditPart extends PapyrusCompartmentEditPart implements
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class DataTypeNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class DataTypeNameEditPart extends PapyrusCompartmentEditPart implements
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class DataTypeNameEditPart extends PapyrusCompartmentEditPart implements
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class DataTypeNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class DataTypeNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.DataType_2068, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.DataTypeNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class DataTypeNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class DataTypeNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class DataTypeNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class DataTypeNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class DataTypeNameEditPart extends PapyrusCompartmentEditPart implements
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class DataTypeNameEditPart extends PapyrusCompartmentEditPart implements
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class DataTypeNameEditPart extends PapyrusCompartmentEditPart implements
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class DataTypeNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class DataTypeNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class DataTypeNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class DataTypeNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class DataTypeNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class DataTypeNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class DataTypeNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class DataTypeNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class DataTypeNameEditPart extends PapyrusCompartmentEditPart implements
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class DataTypeNameEditPart extends PapyrusCompartmentEditPart implements
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class DataTypeNameEditPart extends PapyrusCompartmentEditPart implements
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class DataTypeNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class DataTypeNameEditPart extends PapyrusCompartmentEditPart implements
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class DataTypeNameEditPart extends PapyrusCompartmentEditPart implements
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeNameEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeNameEditPartCN.java
index 41ab119cdef..7e811b9fa96 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeNameEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeNameEditPartCN.java
@@ -114,12 +114,14 @@ public class DataTypeNameEditPartCN extends PapyrusCompartmentEditPart implement
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class DataTypeNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class DataTypeNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class DataTypeNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class DataTypeNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class DataTypeNameEditPartCN extends PapyrusCompartmentEditPart implement
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class DataTypeNameEditPartCN extends PapyrusCompartmentEditPart implement
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class DataTypeNameEditPartCN extends PapyrusCompartmentEditPart implement
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class DataTypeNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class DataTypeNameEditPartCN extends PapyrusCompartmentEditPart implement
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class DataTypeNameEditPartCN extends PapyrusCompartmentEditPart implement
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class DataTypeNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class DataTypeNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.DataType_3080, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.DataTypeNameEditPartCN.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class DataTypeNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class DataTypeNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class DataTypeNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class DataTypeNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class DataTypeNameEditPartCN extends PapyrusCompartmentEditPart implement
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class DataTypeNameEditPartCN extends PapyrusCompartmentEditPart implement
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class DataTypeNameEditPartCN extends PapyrusCompartmentEditPart implement
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class DataTypeNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class DataTypeNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class DataTypeNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class DataTypeNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class DataTypeNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class DataTypeNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class DataTypeNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class DataTypeNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class DataTypeNameEditPartCN extends PapyrusCompartmentEditPart implement
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class DataTypeNameEditPartCN extends PapyrusCompartmentEditPart implement
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class DataTypeNameEditPartCN extends PapyrusCompartmentEditPart implement
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class DataTypeNameEditPartCN extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class DataTypeNameEditPartCN extends PapyrusCompartmentEditPart implement
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class DataTypeNameEditPartCN extends PapyrusCompartmentEditPart implement
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeOperationCompartmentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeOperationCompartmentEditPart.java
index 82e36445d4a..745328b0bda 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeOperationCompartmentEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeOperationCompartmentEditPart.java
@@ -84,7 +84,7 @@ public class DataTypeOperationCompartmentEditPart extends ListCompartmentEditPar
* @generated
*/
protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
+ if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
super.setRatio(ratio);
}
}
@@ -93,6 +93,7 @@ public class DataTypeOperationCompartmentEditPart extends ListCompartmentEditPar
* @generated
*/
public EditPart getTargetEditPart(Request request) {
+
return super.getTargetEditPart(request);
}
@@ -101,7 +102,10 @@ public class DataTypeOperationCompartmentEditPart extends ListCompartmentEditPar
*/
protected void handleNotificationEvent(Notification notification) {
Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
+ if (NotationPackage.eINSTANCE.getSize_Width().equals(feature)
+ || NotationPackage.eINSTANCE.getSize_Height().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_X().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
refreshBounds();
}
super.handleNotificationEvent(notification);
@@ -111,13 +115,16 @@ public class DataTypeOperationCompartmentEditPart extends ListCompartmentEditPar
* @generated
*/
protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
+ ((GraphicalEditPart) getParent()).setLayoutConstraint(
+ this,
+ getFigure(),
+ new Rectangle(loc, size));
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeOperationCompartmentEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeOperationCompartmentEditPartCN.java
index 8df78130fad..4736096d5e3 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeOperationCompartmentEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DataTypeOperationCompartmentEditPartCN.java
@@ -84,7 +84,7 @@ public class DataTypeOperationCompartmentEditPartCN extends ListCompartmentEditP
* @generated
*/
protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
+ if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
super.setRatio(ratio);
}
}
@@ -93,6 +93,7 @@ public class DataTypeOperationCompartmentEditPartCN extends ListCompartmentEditP
* @generated
*/
public EditPart getTargetEditPart(Request request) {
+
return super.getTargetEditPart(request);
}
@@ -101,7 +102,10 @@ public class DataTypeOperationCompartmentEditPartCN extends ListCompartmentEditP
*/
protected void handleNotificationEvent(Notification notification) {
Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
+ if (NotationPackage.eINSTANCE.getSize_Width().equals(feature)
+ || NotationPackage.eINSTANCE.getSize_Height().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_X().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
refreshBounds();
}
super.handleNotificationEvent(notification);
@@ -111,13 +115,16 @@ public class DataTypeOperationCompartmentEditPartCN extends ListCompartmentEditP
* @generated
*/
protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
+ ((GraphicalEditPart) getParent()).setLayoutConstraint(
+ this,
+ getFigure(),
+ new Rectangle(loc, size));
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DependencyAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DependencyAppliedStereotypeEditPart.java
index 710c44cd7f3..4bcf314499a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DependencyAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DependencyAppliedStereotypeEditPart.java
@@ -123,6 +123,7 @@ public class DependencyAppliedStereotypeEditPart extends PapyrusLabelEditPart im
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -211,8 +212,7 @@ public class DependencyAppliedStereotypeEditPart extends PapyrusLabelEditPart im
/**
* @generated
*/
- public void setLabel(IFigure
- figure) {
+ public void setLabel(IFigure figure) {
unregisterVisuals();
setFigure(figure);
defaultText = getLabelTextHelper(figure);
@@ -324,15 +324,14 @@ public class DependencyAppliedStereotypeEditPart extends PapyrusLabelEditPart im
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid =
- (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
@@ -461,8 +460,7 @@ public class DependencyAppliedStereotypeEditPart extends PapyrusLabelEditPart im
IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- }
- else if (configuration instanceof IAdvancedEditorConfiguration) {
+ } 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);
@@ -507,8 +505,7 @@ public class DependencyAppliedStereotypeEditPart extends PapyrusLabelEditPart im
RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- }
- else {
+ } else {
performDirectEdit();
}
}
@@ -558,17 +555,15 @@ public class DependencyAppliedStereotypeEditPart extends PapyrusLabelEditPart im
* @generated
*/
protected void refreshUnderline() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
if (resolveSemanticElement() instanceof Feature) {
if (((Feature) resolveSemanticElement()).isStatic()) {
((WrappingLabel) getFigure()).setTextUnderline(true);
- }
- else {
+ } else {
((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
@@ -578,9 +573,8 @@ public class DependencyAppliedStereotypeEditPart extends PapyrusLabelEditPart im
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
@@ -591,14 +585,12 @@ public class DependencyAppliedStereotypeEditPart extends PapyrusLabelEditPart im
*/
@Override
protected void refreshFont() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ 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));
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -684,7 +676,7 @@ public class DependencyAppliedStereotypeEditPart extends PapyrusLabelEditPart im
*/
protected boolean checkExtendedEditor() {
if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -708,9 +700,9 @@ public class DependencyAppliedStereotypeEditPart extends PapyrusLabelEditPart im
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());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
@@ -724,8 +716,7 @@ public class DependencyAppliedStereotypeEditPart extends PapyrusLabelEditPart im
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement()
- .eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
@@ -777,18 +768,15 @@ public class DependencyAppliedStereotypeEditPart extends PapyrusLabelEditPart im
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)) {
+ } 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();
+ ISemanticParser modelParser = (ISemanticParser) getParser();
if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
if (resolveSemanticElement() != null) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DependencyEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DependencyEditPart.java
index eec3c958843..233c87e2ba1 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DependencyEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DependencyEditPart.java
@@ -51,11 +51,13 @@ public class DependencyEditPart extends UMLConnectionNodeEditPart implements ITr
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof DependencyNameEditPart) {
- ((DependencyNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof DependencyNameEditPart) {
+ ((DependencyNameEditPart) childEditPart).setLabel(
+ getPrimaryShape().getNameLabel());
}
- if(childEditPart instanceof DependencyAppliedStereotypeEditPart) {
- ((DependencyAppliedStereotypeEditPart)childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
+ if (childEditPart instanceof DependencyAppliedStereotypeEditPart) {
+ ((DependencyAppliedStereotypeEditPart) childEditPart).setLabel(
+ getPrimaryShape().getAppliedStereotypeLabel());
}
return false;
}
@@ -64,7 +66,7 @@ public class DependencyEditPart extends UMLConnectionNodeEditPart implements ITr
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -74,10 +76,10 @@ public class DependencyEditPart extends UMLConnectionNodeEditPart implements ITr
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof DependencyNameEditPart) {
+ if (childEditPart instanceof DependencyNameEditPart) {
return true;
}
- if(childEditPart instanceof DependencyAppliedStereotypeEditPart) {
+ if (childEditPart instanceof DependencyAppliedStereotypeEditPart) {
return true;
}
return false;
@@ -87,7 +89,7 @@ public class DependencyEditPart extends UMLConnectionNodeEditPart implements ITr
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -109,6 +111,6 @@ public class DependencyEditPart extends UMLConnectionNodeEditPart implements ITr
* @generated
*/
public DashedEdgeFigure getPrimaryShape() {
- return (DashedEdgeFigure)getFigure();
+ return (DashedEdgeFigure) getFigure();
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DependencyNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DependencyNameEditPart.java
index 0cedfc4921c..62f8c78ea8e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DependencyNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DependencyNameEditPart.java
@@ -123,6 +123,7 @@ public class DependencyNameEditPart extends PapyrusLabelEditPart implements ITex
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -211,8 +212,7 @@ public class DependencyNameEditPart extends PapyrusLabelEditPart implements ITex
/**
* @generated
*/
- public void setLabel(IFigure
- figure) {
+ public void setLabel(IFigure figure) {
unregisterVisuals();
setFigure(figure);
defaultText = getLabelTextHelper(figure);
@@ -324,15 +324,14 @@ public class DependencyNameEditPart extends PapyrusLabelEditPart implements ITex
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid =
- (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
@@ -461,8 +460,7 @@ public class DependencyNameEditPart extends PapyrusLabelEditPart implements ITex
IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- }
- else if (configuration instanceof IAdvancedEditorConfiguration) {
+ } 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);
@@ -507,8 +505,7 @@ public class DependencyNameEditPart extends PapyrusLabelEditPart implements ITex
RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- }
- else {
+ } else {
performDirectEdit();
}
}
@@ -558,17 +555,15 @@ public class DependencyNameEditPart extends PapyrusLabelEditPart implements ITex
* @generated
*/
protected void refreshUnderline() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
if (resolveSemanticElement() instanceof Feature) {
if (((Feature) resolveSemanticElement()).isStatic()) {
((WrappingLabel) getFigure()).setTextUnderline(true);
- }
- else {
+ } else {
((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
@@ -578,9 +573,8 @@ public class DependencyNameEditPart extends PapyrusLabelEditPart implements ITex
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
@@ -591,14 +585,12 @@ public class DependencyNameEditPart extends PapyrusLabelEditPart implements ITex
*/
@Override
protected void refreshFont() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ 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));
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -692,7 +684,7 @@ public class DependencyNameEditPart extends PapyrusLabelEditPart implements ITex
*/
protected boolean checkExtendedEditor() {
if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -716,9 +708,9 @@ public class DependencyNameEditPart extends PapyrusLabelEditPart implements ITex
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());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
@@ -732,8 +724,7 @@ public class DependencyNameEditPart extends PapyrusLabelEditPart implements ITex
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement()
- .eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
@@ -785,18 +776,15 @@ public class DependencyNameEditPart extends PapyrusLabelEditPart implements ITex
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)) {
+ } 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();
+ ISemanticParser modelParser = (ISemanticParser) getParser();
if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
if (resolveSemanticElement() != null) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentAppliedStereotypeEditPart.java
index a0ad111966b..6fb2d9b83b8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentAppliedStereotypeEditPart.java
@@ -123,6 +123,7 @@ public class DeploymentAppliedStereotypeEditPart extends PapyrusLabelEditPart im
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -211,8 +212,7 @@ public class DeploymentAppliedStereotypeEditPart extends PapyrusLabelEditPart im
/**
* @generated
*/
- public void setLabel(IFigure
- figure) {
+ public void setLabel(IFigure figure) {
unregisterVisuals();
setFigure(figure);
defaultText = getLabelTextHelper(figure);
@@ -324,15 +324,14 @@ public class DeploymentAppliedStereotypeEditPart extends PapyrusLabelEditPart im
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid =
- (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
@@ -461,8 +460,7 @@ public class DeploymentAppliedStereotypeEditPart extends PapyrusLabelEditPart im
IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- }
- else if (configuration instanceof IAdvancedEditorConfiguration) {
+ } 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);
@@ -507,8 +505,7 @@ public class DeploymentAppliedStereotypeEditPart extends PapyrusLabelEditPart im
RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- }
- else {
+ } else {
performDirectEdit();
}
}
@@ -558,17 +555,15 @@ public class DeploymentAppliedStereotypeEditPart extends PapyrusLabelEditPart im
* @generated
*/
protected void refreshUnderline() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
if (resolveSemanticElement() instanceof Feature) {
if (((Feature) resolveSemanticElement()).isStatic()) {
((WrappingLabel) getFigure()).setTextUnderline(true);
- }
- else {
+ } else {
((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
@@ -578,9 +573,8 @@ public class DeploymentAppliedStereotypeEditPart extends PapyrusLabelEditPart im
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
@@ -591,14 +585,12 @@ public class DeploymentAppliedStereotypeEditPart extends PapyrusLabelEditPart im
*/
@Override
protected void refreshFont() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ 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));
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -684,7 +676,7 @@ public class DeploymentAppliedStereotypeEditPart extends PapyrusLabelEditPart im
*/
protected boolean checkExtendedEditor() {
if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -708,9 +700,9 @@ public class DeploymentAppliedStereotypeEditPart extends PapyrusLabelEditPart im
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());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
@@ -724,8 +716,7 @@ public class DeploymentAppliedStereotypeEditPart extends PapyrusLabelEditPart im
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement()
- .eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
@@ -777,18 +768,15 @@ public class DeploymentAppliedStereotypeEditPart extends PapyrusLabelEditPart im
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)) {
+ } 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();
+ ISemanticParser modelParser = (ISemanticParser) getParser();
if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
if (resolveSemanticElement() != null) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentEditPart.java
index 3f4e73b0f58..e9cd7d14c18 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentEditPart.java
@@ -52,10 +52,12 @@ public class DeploymentEditPart extends UMLConnectionNodeEditPart implements ITr
*/
protected boolean addFixedChild(EditPart childEditPart) {
if (childEditPart instanceof DeploymentNameEditPart) {
- ((DeploymentNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ ((DeploymentNameEditPart) childEditPart).setLabel(
+ getPrimaryShape().getNameLabel());
}
if (childEditPart instanceof DeploymentAppliedStereotypeEditPart) {
- ((DeploymentAppliedStereotypeEditPart) childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
+ ((DeploymentAppliedStereotypeEditPart) childEditPart).setLabel(
+ getPrimaryShape().getAppliedStereotypeLabel());
}
return false;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentNameEditPart.java
index 35d4583005e..b9e4f47f2ad 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentNameEditPart.java
@@ -123,6 +123,7 @@ public class DeploymentNameEditPart extends PapyrusLabelEditPart implements ITex
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -211,8 +212,7 @@ public class DeploymentNameEditPart extends PapyrusLabelEditPart implements ITex
/**
* @generated
*/
- public void setLabel(IFigure
- figure) {
+ public void setLabel(IFigure figure) {
unregisterVisuals();
setFigure(figure);
defaultText = getLabelTextHelper(figure);
@@ -324,15 +324,14 @@ public class DeploymentNameEditPart extends PapyrusLabelEditPart implements ITex
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid =
- (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
@@ -461,8 +460,7 @@ public class DeploymentNameEditPart extends PapyrusLabelEditPart implements ITex
IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- }
- else if (configuration instanceof IAdvancedEditorConfiguration) {
+ } 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);
@@ -507,8 +505,7 @@ public class DeploymentNameEditPart extends PapyrusLabelEditPart implements ITex
RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- }
- else {
+ } else {
performDirectEdit();
}
}
@@ -558,17 +555,15 @@ public class DeploymentNameEditPart extends PapyrusLabelEditPart implements ITex
* @generated
*/
protected void refreshUnderline() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
if (resolveSemanticElement() instanceof Feature) {
if (((Feature) resolveSemanticElement()).isStatic()) {
((WrappingLabel) getFigure()).setTextUnderline(true);
- }
- else {
+ } else {
((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
@@ -578,9 +573,8 @@ public class DeploymentNameEditPart extends PapyrusLabelEditPart implements ITex
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
@@ -591,14 +585,12 @@ public class DeploymentNameEditPart extends PapyrusLabelEditPart implements ITex
*/
@Override
protected void refreshFont() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ 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));
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -692,7 +684,7 @@ public class DeploymentNameEditPart extends PapyrusLabelEditPart implements ITex
*/
protected boolean checkExtendedEditor() {
if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -716,9 +708,9 @@ public class DeploymentNameEditPart extends PapyrusLabelEditPart implements ITex
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());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
@@ -732,8 +724,7 @@ public class DeploymentNameEditPart extends PapyrusLabelEditPart implements ITex
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement()
- .eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
@@ -785,18 +776,15 @@ public class DeploymentNameEditPart extends PapyrusLabelEditPart implements ITex
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)) {
+ } 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();
+ ISemanticParser modelParser = (ISemanticParser) getParser();
if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
if (resolveSemanticElement() != null) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentSpecificationEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentSpecificationEditPart.java
index 3a1e09e5036..d22cfc8d371 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentSpecificationEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentSpecificationEditPart.java
@@ -84,7 +84,9 @@ public class DeploymentSpecificationEditPart extends RoundedCompartmentEditPart
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
@@ -101,21 +103,21 @@ public class DeploymentSpecificationEditPart extends RoundedCompartmentEditPart
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case DeploymentSpecificationFloatingLabelEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -135,8 +137,9 @@ public class DeploymentSpecificationEditPart extends RoundedCompartmentEditPart
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -154,6 +157,7 @@ public class DeploymentSpecificationEditPart extends RoundedCompartmentEditPart
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -165,20 +169,23 @@ public class DeploymentSpecificationEditPart extends RoundedCompartmentEditPart
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure
+ *
* @generated
*/
public RoundedCompartmentFigure getPrimaryShape() {
- return (RoundedCompartmentFigure)primaryShape;
+ return (RoundedCompartmentFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof DeploymentSpecificationNameEditPart) {
- ((DeploymentSpecificationNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof DeploymentSpecificationNameEditPart) {
+ ((DeploymentSpecificationNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
+
+
return false;
}
@@ -186,7 +193,7 @@ public class DeploymentSpecificationEditPart extends RoundedCompartmentEditPart
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof DeploymentSpecificationNameEditPart) {
+ if (childEditPart instanceof DeploymentSpecificationNameEditPart) {
return true;
}
return false;
@@ -196,7 +203,7 @@ public class DeploymentSpecificationEditPart extends RoundedCompartmentEditPart
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -206,7 +213,7 @@ public class DeploymentSpecificationEditPart extends RoundedCompartmentEditPart
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -216,7 +223,7 @@ public class DeploymentSpecificationEditPart extends RoundedCompartmentEditPart
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -226,7 +233,7 @@ public class DeploymentSpecificationEditPart extends RoundedCompartmentEditPart
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof DeploymentSpecificationFloatingLabelEditPart) {
+ if (borderItemEditPart instanceof DeploymentSpecificationFloatingLabelEditPart) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -249,16 +256,19 @@ public class DeploymentSpecificationEditPart extends RoundedCompartmentEditPart
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -270,7 +280,7 @@ public class DeploymentSpecificationEditPart extends RoundedCompartmentEditPart
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -280,7 +290,7 @@ public class DeploymentSpecificationEditPart extends RoundedCompartmentEditPart
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -296,8 +306,8 @@ public class DeploymentSpecificationEditPart extends RoundedCompartmentEditPart
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentSpecificationEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentSpecificationEditPartCN.java
index cf8af31a856..8b9dd443444 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentSpecificationEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentSpecificationEditPartCN.java
@@ -84,7 +84,9 @@ public class DeploymentSpecificationEditPartCN extends RoundedCompartmentEditPar
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
@@ -101,21 +103,21 @@ public class DeploymentSpecificationEditPartCN extends RoundedCompartmentEditPar
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case DeploymentSpecificationFloatingLabelEditPartCN.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -135,8 +137,9 @@ public class DeploymentSpecificationEditPartCN extends RoundedCompartmentEditPar
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -154,6 +157,7 @@ public class DeploymentSpecificationEditPartCN extends RoundedCompartmentEditPar
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -165,20 +169,23 @@ public class DeploymentSpecificationEditPartCN extends RoundedCompartmentEditPar
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure
+ *
* @generated
*/
public RoundedCompartmentFigure getPrimaryShape() {
- return (RoundedCompartmentFigure)primaryShape;
+ return (RoundedCompartmentFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof DeploymentSpecificationNameEditPartCN) {
- ((DeploymentSpecificationNameEditPartCN)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof DeploymentSpecificationNameEditPartCN) {
+ ((DeploymentSpecificationNameEditPartCN) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
+
+
return false;
}
@@ -186,7 +193,7 @@ public class DeploymentSpecificationEditPartCN extends RoundedCompartmentEditPar
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof DeploymentSpecificationNameEditPartCN) {
+ if (childEditPart instanceof DeploymentSpecificationNameEditPartCN) {
return true;
}
return false;
@@ -196,7 +203,7 @@ public class DeploymentSpecificationEditPartCN extends RoundedCompartmentEditPar
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -206,7 +213,7 @@ public class DeploymentSpecificationEditPartCN extends RoundedCompartmentEditPar
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -216,7 +223,7 @@ public class DeploymentSpecificationEditPartCN extends RoundedCompartmentEditPar
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -226,7 +233,7 @@ public class DeploymentSpecificationEditPartCN extends RoundedCompartmentEditPar
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof DeploymentSpecificationFloatingLabelEditPartCN) {
+ if (borderItemEditPart instanceof DeploymentSpecificationFloatingLabelEditPartCN) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -249,16 +256,19 @@ public class DeploymentSpecificationEditPartCN extends RoundedCompartmentEditPar
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -270,7 +280,7 @@ public class DeploymentSpecificationEditPartCN extends RoundedCompartmentEditPar
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -280,7 +290,7 @@ public class DeploymentSpecificationEditPartCN extends RoundedCompartmentEditPar
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -296,8 +306,8 @@ public class DeploymentSpecificationEditPartCN extends RoundedCompartmentEditPar
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentSpecificationFloatingLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentSpecificationFloatingLabelEditPart.java
index 7326effe643..34b33dd1f27 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentSpecificationFloatingLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentSpecificationFloatingLabelEditPart.java
@@ -113,15 +113,18 @@ public class DeploymentSpecificationFloatingLabelEditPart extends FloatingLabelE
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class DeploymentSpecificationFloatingLabelEditPart extends FloatingLabelE
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class DeploymentSpecificationFloatingLabelEditPart extends FloatingLabelE
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class DeploymentSpecificationFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class DeploymentSpecificationFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class DeploymentSpecificationFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class DeploymentSpecificationFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class DeploymentSpecificationFloatingLabelEditPart extends FloatingLabelE
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class DeploymentSpecificationFloatingLabelEditPart extends FloatingLabelE
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class DeploymentSpecificationFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class DeploymentSpecificationFloatingLabelEditPart extends FloatingLabelE
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class DeploymentSpecificationFloatingLabelEditPart extends FloatingLabelE
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class DeploymentSpecificationFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class DeploymentSpecificationFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.DeploymentSpecification_2078, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.DeploymentSpecificationFloatingLabelEditPart.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class DeploymentSpecificationFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class DeploymentSpecificationFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class DeploymentSpecificationFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class DeploymentSpecificationFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class DeploymentSpecificationFloatingLabelEditPart extends FloatingLabelE
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class DeploymentSpecificationFloatingLabelEditPart extends FloatingLabelE
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class DeploymentSpecificationFloatingLabelEditPart extends FloatingLabelE
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class DeploymentSpecificationFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class DeploymentSpecificationFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class DeploymentSpecificationFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class DeploymentSpecificationFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class DeploymentSpecificationFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class DeploymentSpecificationFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class DeploymentSpecificationFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class DeploymentSpecificationFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class DeploymentSpecificationFloatingLabelEditPart extends FloatingLabelE
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class DeploymentSpecificationFloatingLabelEditPart extends FloatingLabelE
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class DeploymentSpecificationFloatingLabelEditPart extends FloatingLabelE
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentSpecificationFloatingLabelEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentSpecificationFloatingLabelEditPartCN.java
index d8ac3748a09..c8de9bd975c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentSpecificationFloatingLabelEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentSpecificationFloatingLabelEditPartCN.java
@@ -113,15 +113,18 @@ public class DeploymentSpecificationFloatingLabelEditPartCN extends FloatingLabe
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class DeploymentSpecificationFloatingLabelEditPartCN extends FloatingLabe
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class DeploymentSpecificationFloatingLabelEditPartCN extends FloatingLabe
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class DeploymentSpecificationFloatingLabelEditPartCN extends FloatingLabe
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class DeploymentSpecificationFloatingLabelEditPartCN extends FloatingLabe
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class DeploymentSpecificationFloatingLabelEditPartCN extends FloatingLabe
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class DeploymentSpecificationFloatingLabelEditPartCN extends FloatingLabe
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class DeploymentSpecificationFloatingLabelEditPartCN extends FloatingLabe
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class DeploymentSpecificationFloatingLabelEditPartCN extends FloatingLabe
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class DeploymentSpecificationFloatingLabelEditPartCN extends FloatingLabe
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class DeploymentSpecificationFloatingLabelEditPartCN extends FloatingLabe
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class DeploymentSpecificationFloatingLabelEditPartCN extends FloatingLabe
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class DeploymentSpecificationFloatingLabelEditPartCN extends FloatingLabe
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class DeploymentSpecificationFloatingLabelEditPartCN extends FloatingLabe
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.DeploymentSpecification_3092, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.DeploymentSpecificationFloatingLabelEditPartCN.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class DeploymentSpecificationFloatingLabelEditPartCN extends FloatingLabe
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class DeploymentSpecificationFloatingLabelEditPartCN extends FloatingLabe
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class DeploymentSpecificationFloatingLabelEditPartCN extends FloatingLabe
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class DeploymentSpecificationFloatingLabelEditPartCN extends FloatingLabe
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class DeploymentSpecificationFloatingLabelEditPartCN extends FloatingLabe
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class DeploymentSpecificationFloatingLabelEditPartCN extends FloatingLabe
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class DeploymentSpecificationFloatingLabelEditPartCN extends FloatingLabe
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class DeploymentSpecificationFloatingLabelEditPartCN extends FloatingLabe
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class DeploymentSpecificationFloatingLabelEditPartCN extends FloatingLabe
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class DeploymentSpecificationFloatingLabelEditPartCN extends FloatingLabe
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class DeploymentSpecificationFloatingLabelEditPartCN extends FloatingLabe
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class DeploymentSpecificationFloatingLabelEditPartCN extends FloatingLabe
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class DeploymentSpecificationFloatingLabelEditPartCN extends FloatingLabe
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class DeploymentSpecificationFloatingLabelEditPartCN extends FloatingLabe
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class DeploymentSpecificationFloatingLabelEditPartCN extends FloatingLabe
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class DeploymentSpecificationFloatingLabelEditPartCN extends FloatingLabe
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class DeploymentSpecificationFloatingLabelEditPartCN extends FloatingLabe
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class DeploymentSpecificationFloatingLabelEditPartCN extends FloatingLabe
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentSpecificationNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentSpecificationNameEditPart.java
index 281d86c9cf9..e60cdcd7e10 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentSpecificationNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentSpecificationNameEditPart.java
@@ -114,12 +114,14 @@ public class DeploymentSpecificationNameEditPart extends PapyrusCompartmentEditP
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class DeploymentSpecificationNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class DeploymentSpecificationNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class DeploymentSpecificationNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class DeploymentSpecificationNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class DeploymentSpecificationNameEditPart extends PapyrusCompartmentEditP
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class DeploymentSpecificationNameEditPart extends PapyrusCompartmentEditP
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class DeploymentSpecificationNameEditPart extends PapyrusCompartmentEditP
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class DeploymentSpecificationNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class DeploymentSpecificationNameEditPart extends PapyrusCompartmentEditP
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class DeploymentSpecificationNameEditPart extends PapyrusCompartmentEditP
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class DeploymentSpecificationNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class DeploymentSpecificationNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.DeploymentSpecification_2078, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.DeploymentSpecificationNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class DeploymentSpecificationNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class DeploymentSpecificationNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class DeploymentSpecificationNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class DeploymentSpecificationNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class DeploymentSpecificationNameEditPart extends PapyrusCompartmentEditP
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class DeploymentSpecificationNameEditPart extends PapyrusCompartmentEditP
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class DeploymentSpecificationNameEditPart extends PapyrusCompartmentEditP
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class DeploymentSpecificationNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class DeploymentSpecificationNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class DeploymentSpecificationNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class DeploymentSpecificationNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class DeploymentSpecificationNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class DeploymentSpecificationNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class DeploymentSpecificationNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class DeploymentSpecificationNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class DeploymentSpecificationNameEditPart extends PapyrusCompartmentEditP
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class DeploymentSpecificationNameEditPart extends PapyrusCompartmentEditP
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class DeploymentSpecificationNameEditPart extends PapyrusCompartmentEditP
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class DeploymentSpecificationNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class DeploymentSpecificationNameEditPart extends PapyrusCompartmentEditP
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class DeploymentSpecificationNameEditPart extends PapyrusCompartmentEditP
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentSpecificationNameEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentSpecificationNameEditPartCN.java
index 03292db5dcd..7bbc5d4e42f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentSpecificationNameEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeploymentSpecificationNameEditPartCN.java
@@ -114,12 +114,14 @@ public class DeploymentSpecificationNameEditPartCN extends PapyrusCompartmentEdi
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class DeploymentSpecificationNameEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class DeploymentSpecificationNameEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class DeploymentSpecificationNameEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class DeploymentSpecificationNameEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class DeploymentSpecificationNameEditPartCN extends PapyrusCompartmentEdi
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class DeploymentSpecificationNameEditPartCN extends PapyrusCompartmentEdi
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class DeploymentSpecificationNameEditPartCN extends PapyrusCompartmentEdi
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class DeploymentSpecificationNameEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class DeploymentSpecificationNameEditPartCN extends PapyrusCompartmentEdi
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class DeploymentSpecificationNameEditPartCN extends PapyrusCompartmentEdi
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class DeploymentSpecificationNameEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class DeploymentSpecificationNameEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.DeploymentSpecification_3092, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.DeploymentSpecificationNameEditPartCN.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class DeploymentSpecificationNameEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class DeploymentSpecificationNameEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class DeploymentSpecificationNameEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class DeploymentSpecificationNameEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class DeploymentSpecificationNameEditPartCN extends PapyrusCompartmentEdi
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class DeploymentSpecificationNameEditPartCN extends PapyrusCompartmentEdi
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class DeploymentSpecificationNameEditPartCN extends PapyrusCompartmentEdi
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class DeploymentSpecificationNameEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class DeploymentSpecificationNameEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class DeploymentSpecificationNameEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class DeploymentSpecificationNameEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class DeploymentSpecificationNameEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class DeploymentSpecificationNameEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class DeploymentSpecificationNameEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class DeploymentSpecificationNameEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class DeploymentSpecificationNameEditPartCN extends PapyrusCompartmentEdi
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class DeploymentSpecificationNameEditPartCN extends PapyrusCompartmentEdi
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class DeploymentSpecificationNameEditPartCN extends PapyrusCompartmentEdi
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class DeploymentSpecificationNameEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class DeploymentSpecificationNameEditPartCN extends PapyrusCompartmentEdi
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class DeploymentSpecificationNameEditPartCN extends PapyrusCompartmentEdi
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeviceCompositeCompartmentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeviceCompositeCompartmentEditPart.java
index b20b1b3c40b..db4a1075c3f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeviceCompositeCompartmentEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeviceCompositeCompartmentEditPart.java
@@ -81,7 +81,7 @@ public class DeviceCompositeCompartmentEditPart extends LinkLFShapeCompartmentEd
* @generated
*/
protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
+ if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
super.setRatio(ratio);
}
}
@@ -90,6 +90,7 @@ public class DeviceCompositeCompartmentEditPart extends LinkLFShapeCompartmentEd
* @generated
*/
public EditPart getTargetEditPart(Request request) {
+
return super.getTargetEditPart(request);
}
@@ -98,7 +99,10 @@ public class DeviceCompositeCompartmentEditPart extends LinkLFShapeCompartmentEd
*/
protected void handleNotificationEvent(Notification notification) {
Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
+ if (NotationPackage.eINSTANCE.getSize_Width().equals(feature)
+ || NotationPackage.eINSTANCE.getSize_Height().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_X().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
refreshBounds();
}
super.handleNotificationEvent(notification);
@@ -108,13 +112,16 @@ public class DeviceCompositeCompartmentEditPart extends LinkLFShapeCompartmentEd
* @generated
*/
protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
+ ((GraphicalEditPart) getParent()).setLayoutConstraint(
+ this,
+ getFigure(),
+ new Rectangle(loc, size));
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeviceCompositeCompartmentEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeviceCompositeCompartmentEditPartCN.java
index cd4fa4511fd..04afbbe9f4a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeviceCompositeCompartmentEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeviceCompositeCompartmentEditPartCN.java
@@ -81,7 +81,7 @@ public class DeviceCompositeCompartmentEditPartCN extends LinkLFShapeCompartment
* @generated
*/
protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
+ if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
super.setRatio(ratio);
}
}
@@ -90,6 +90,7 @@ public class DeviceCompositeCompartmentEditPartCN extends LinkLFShapeCompartment
* @generated
*/
public EditPart getTargetEditPart(Request request) {
+
return super.getTargetEditPart(request);
}
@@ -98,7 +99,10 @@ public class DeviceCompositeCompartmentEditPartCN extends LinkLFShapeCompartment
*/
protected void handleNotificationEvent(Notification notification) {
Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
+ if (NotationPackage.eINSTANCE.getSize_Width().equals(feature)
+ || NotationPackage.eINSTANCE.getSize_Height().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_X().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
refreshBounds();
}
super.handleNotificationEvent(notification);
@@ -108,13 +112,16 @@ public class DeviceCompositeCompartmentEditPartCN extends LinkLFShapeCompartment
* @generated
*/
protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
+ ((GraphicalEditPart) getParent()).setLayoutConstraint(
+ this,
+ getFigure(),
+ new Rectangle(loc, size));
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeviceCompositeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeviceCompositeEditPart.java
index 7608c25de31..2709bfcd3a5 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeviceCompositeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeviceCompositeEditPart.java
@@ -96,7 +96,9 @@ public class DeviceCompositeEditPart extends RoundedCompartmentEditPart {
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new DefaultCreationEditPolicy());
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
@@ -120,14 +122,14 @@ public class DeviceCompositeEditPart extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case DeviceCompositeFloatingLabelEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
@@ -136,7 +138,7 @@ public class DeviceCompositeEditPart extends RoundedCompartmentEditPart {
return new BorderItemResizableEditPolicy();
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -156,8 +158,9 @@ public class DeviceCompositeEditPart extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -175,6 +178,7 @@ public class DeviceCompositeEditPart extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -186,32 +190,40 @@ public class DeviceCompositeEditPart extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.composite.custom.figures.DeviceCompositeFigure
+ *
* @generated
*/
public DeviceCompositeFigure getPrimaryShape() {
- return (DeviceCompositeFigure)primaryShape;
+ return (DeviceCompositeFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof DeviceCompositeNameEditPart) {
- ((DeviceCompositeNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof DeviceCompositeNameEditPart) {
+ ((DeviceCompositeNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
- if(childEditPart instanceof DeviceCompositeCompartmentEditPart) {
+
+
+ if (childEditPart instanceof DeviceCompositeCompartmentEditPart) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((DeviceCompositeCompartmentEditPart)childEditPart).getFigure());
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.add(((DeviceCompositeCompartmentEditPart) childEditPart).getFigure());
return true;
}
- //Papyrus Gencode :Affixed Port locator
- if(childEditPart instanceof PortEditPart) {
+
+
+
+ // Papyrus Gencode :Affixed Port locator
+ if (childEditPart instanceof PortEditPart) {
IBorderItemLocator locator = new PortPositionLocator(getMainFigure(), PositionConstants.NONE);
- getBorderedFigure().getBorderItemContainer().add(((PortEditPart)childEditPart).getFigure(), locator);
+ getBorderedFigure().getBorderItemContainer().add(((PortEditPart) childEditPart).getFigure(), locator);
return true;
}
+
+
return false;
}
@@ -219,16 +231,16 @@ public class DeviceCompositeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof DeviceCompositeNameEditPart) {
+ if (childEditPart instanceof DeviceCompositeNameEditPart) {
return true;
}
- if(childEditPart instanceof DeviceCompositeCompartmentEditPart) {
+ if (childEditPart instanceof DeviceCompositeCompartmentEditPart) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- pane.remove(((DeviceCompositeCompartmentEditPart)childEditPart).getFigure());
+ pane.remove(((DeviceCompositeCompartmentEditPart) childEditPart).getFigure());
return true;
}
- if(childEditPart instanceof PortEditPart) {
- getBorderedFigure().getBorderItemContainer().remove(((PortEditPart)childEditPart).getFigure());
+ if (childEditPart instanceof PortEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((PortEditPart) childEditPart).getFigure());
return true;
}
return false;
@@ -238,7 +250,7 @@ public class DeviceCompositeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -248,7 +260,7 @@ public class DeviceCompositeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -258,10 +270,10 @@ public class DeviceCompositeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof DeviceCompositeCompartmentEditPart) {
+ if (editPart instanceof DeviceCompositeCompartmentEditPart) {
return getPrimaryShape().getCompositeCompartmentFigure();
}
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -271,7 +283,7 @@ public class DeviceCompositeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof DeviceCompositeFloatingLabelEditPart) {
+ if (borderItemEditPart instanceof DeviceCompositeFloatingLabelEditPart) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -294,16 +306,19 @@ public class DeviceCompositeEditPart extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -315,7 +330,7 @@ public class DeviceCompositeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -325,7 +340,7 @@ public class DeviceCompositeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -341,8 +356,8 @@ public class DeviceCompositeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeviceCompositeEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeviceCompositeEditPartCN.java
index edaaec97a90..693c12ef13a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeviceCompositeEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeviceCompositeEditPartCN.java
@@ -96,7 +96,9 @@ public class DeviceCompositeEditPartCN extends RoundedCompartmentEditPart {
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new DefaultCreationEditPolicy());
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
@@ -120,14 +122,14 @@ public class DeviceCompositeEditPartCN extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case DeviceCompositeFloatingLabelEditPartCN.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
@@ -136,7 +138,7 @@ public class DeviceCompositeEditPartCN extends RoundedCompartmentEditPart {
return new BorderItemResizableEditPolicy();
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -156,8 +158,9 @@ public class DeviceCompositeEditPartCN extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -175,6 +178,7 @@ public class DeviceCompositeEditPartCN extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -186,32 +190,40 @@ public class DeviceCompositeEditPartCN extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.composite.custom.figures.DeviceCompositeFigure
+ *
* @generated
*/
public DeviceCompositeFigure getPrimaryShape() {
- return (DeviceCompositeFigure)primaryShape;
+ return (DeviceCompositeFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof DeviceCompositeNameEditPartCN) {
- ((DeviceCompositeNameEditPartCN)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof DeviceCompositeNameEditPartCN) {
+ ((DeviceCompositeNameEditPartCN) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
- if(childEditPart instanceof DeviceCompositeCompartmentEditPartCN) {
+
+
+ if (childEditPart instanceof DeviceCompositeCompartmentEditPartCN) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((DeviceCompositeCompartmentEditPartCN)childEditPart).getFigure());
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.add(((DeviceCompositeCompartmentEditPartCN) childEditPart).getFigure());
return true;
}
- //Papyrus Gencode :Affixed Port locator
- if(childEditPart instanceof PortEditPart) {
+
+
+
+ // Papyrus Gencode :Affixed Port locator
+ if (childEditPart instanceof PortEditPart) {
IBorderItemLocator locator = new PortPositionLocator(getMainFigure(), PositionConstants.NONE);
- getBorderedFigure().getBorderItemContainer().add(((PortEditPart)childEditPart).getFigure(), locator);
+ getBorderedFigure().getBorderItemContainer().add(((PortEditPart) childEditPart).getFigure(), locator);
return true;
}
+
+
return false;
}
@@ -219,16 +231,16 @@ public class DeviceCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof DeviceCompositeNameEditPartCN) {
+ if (childEditPart instanceof DeviceCompositeNameEditPartCN) {
return true;
}
- if(childEditPart instanceof DeviceCompositeCompartmentEditPartCN) {
+ if (childEditPart instanceof DeviceCompositeCompartmentEditPartCN) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- pane.remove(((DeviceCompositeCompartmentEditPartCN)childEditPart).getFigure());
+ pane.remove(((DeviceCompositeCompartmentEditPartCN) childEditPart).getFigure());
return true;
}
- if(childEditPart instanceof PortEditPart) {
- getBorderedFigure().getBorderItemContainer().remove(((PortEditPart)childEditPart).getFigure());
+ if (childEditPart instanceof PortEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((PortEditPart) childEditPart).getFigure());
return true;
}
return false;
@@ -238,7 +250,7 @@ public class DeviceCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -248,7 +260,7 @@ public class DeviceCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -258,10 +270,10 @@ public class DeviceCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof DeviceCompositeCompartmentEditPartCN) {
+ if (editPart instanceof DeviceCompositeCompartmentEditPartCN) {
return getPrimaryShape().getCompositeCompartmentFigure();
}
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -271,7 +283,7 @@ public class DeviceCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof DeviceCompositeFloatingLabelEditPartCN) {
+ if (borderItemEditPart instanceof DeviceCompositeFloatingLabelEditPartCN) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -294,16 +306,19 @@ public class DeviceCompositeEditPartCN extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -315,7 +330,7 @@ public class DeviceCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -325,7 +340,7 @@ public class DeviceCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -341,8 +356,8 @@ public class DeviceCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeviceCompositeFloatingLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeviceCompositeFloatingLabelEditPart.java
index cf2974a9aa0..6b9510ba945 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeviceCompositeFloatingLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeviceCompositeFloatingLabelEditPart.java
@@ -113,15 +113,18 @@ public class DeviceCompositeFloatingLabelEditPart extends FloatingLabelEditPart
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class DeviceCompositeFloatingLabelEditPart extends FloatingLabelEditPart
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class DeviceCompositeFloatingLabelEditPart extends FloatingLabelEditPart
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class DeviceCompositeFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class DeviceCompositeFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class DeviceCompositeFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class DeviceCompositeFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class DeviceCompositeFloatingLabelEditPart extends FloatingLabelEditPart
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class DeviceCompositeFloatingLabelEditPart extends FloatingLabelEditPart
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class DeviceCompositeFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class DeviceCompositeFloatingLabelEditPart extends FloatingLabelEditPart
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class DeviceCompositeFloatingLabelEditPart extends FloatingLabelEditPart
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class DeviceCompositeFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class DeviceCompositeFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Device_2070, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.DeviceCompositeFloatingLabelEditPart.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class DeviceCompositeFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class DeviceCompositeFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class DeviceCompositeFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class DeviceCompositeFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class DeviceCompositeFloatingLabelEditPart extends FloatingLabelEditPart
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class DeviceCompositeFloatingLabelEditPart extends FloatingLabelEditPart
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class DeviceCompositeFloatingLabelEditPart extends FloatingLabelEditPart
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class DeviceCompositeFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class DeviceCompositeFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class DeviceCompositeFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class DeviceCompositeFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class DeviceCompositeFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class DeviceCompositeFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class DeviceCompositeFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class DeviceCompositeFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class DeviceCompositeFloatingLabelEditPart extends FloatingLabelEditPart
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class DeviceCompositeFloatingLabelEditPart extends FloatingLabelEditPart
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class DeviceCompositeFloatingLabelEditPart extends FloatingLabelEditPart
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeviceCompositeFloatingLabelEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeviceCompositeFloatingLabelEditPartCN.java
index b60a71e2f5e..a0cfd8b0211 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeviceCompositeFloatingLabelEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeviceCompositeFloatingLabelEditPartCN.java
@@ -113,15 +113,18 @@ public class DeviceCompositeFloatingLabelEditPartCN extends FloatingLabelEditPar
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class DeviceCompositeFloatingLabelEditPartCN extends FloatingLabelEditPar
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class DeviceCompositeFloatingLabelEditPartCN extends FloatingLabelEditPar
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class DeviceCompositeFloatingLabelEditPartCN extends FloatingLabelEditPar
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class DeviceCompositeFloatingLabelEditPartCN extends FloatingLabelEditPar
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class DeviceCompositeFloatingLabelEditPartCN extends FloatingLabelEditPar
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class DeviceCompositeFloatingLabelEditPartCN extends FloatingLabelEditPar
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class DeviceCompositeFloatingLabelEditPartCN extends FloatingLabelEditPar
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class DeviceCompositeFloatingLabelEditPartCN extends FloatingLabelEditPar
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class DeviceCompositeFloatingLabelEditPartCN extends FloatingLabelEditPar
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class DeviceCompositeFloatingLabelEditPartCN extends FloatingLabelEditPar
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class DeviceCompositeFloatingLabelEditPartCN extends FloatingLabelEditPar
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class DeviceCompositeFloatingLabelEditPartCN extends FloatingLabelEditPar
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class DeviceCompositeFloatingLabelEditPartCN extends FloatingLabelEditPar
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Device_3082, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.DeviceCompositeFloatingLabelEditPartCN.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class DeviceCompositeFloatingLabelEditPartCN extends FloatingLabelEditPar
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class DeviceCompositeFloatingLabelEditPartCN extends FloatingLabelEditPar
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class DeviceCompositeFloatingLabelEditPartCN extends FloatingLabelEditPar
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class DeviceCompositeFloatingLabelEditPartCN extends FloatingLabelEditPar
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class DeviceCompositeFloatingLabelEditPartCN extends FloatingLabelEditPar
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class DeviceCompositeFloatingLabelEditPartCN extends FloatingLabelEditPar
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class DeviceCompositeFloatingLabelEditPartCN extends FloatingLabelEditPar
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class DeviceCompositeFloatingLabelEditPartCN extends FloatingLabelEditPar
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class DeviceCompositeFloatingLabelEditPartCN extends FloatingLabelEditPar
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class DeviceCompositeFloatingLabelEditPartCN extends FloatingLabelEditPar
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class DeviceCompositeFloatingLabelEditPartCN extends FloatingLabelEditPar
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class DeviceCompositeFloatingLabelEditPartCN extends FloatingLabelEditPar
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class DeviceCompositeFloatingLabelEditPartCN extends FloatingLabelEditPar
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class DeviceCompositeFloatingLabelEditPartCN extends FloatingLabelEditPar
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class DeviceCompositeFloatingLabelEditPartCN extends FloatingLabelEditPar
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class DeviceCompositeFloatingLabelEditPartCN extends FloatingLabelEditPar
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class DeviceCompositeFloatingLabelEditPartCN extends FloatingLabelEditPar
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class DeviceCompositeFloatingLabelEditPartCN extends FloatingLabelEditPar
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeviceCompositeNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeviceCompositeNameEditPart.java
index a8931512428..9175f20bcb5 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeviceCompositeNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeviceCompositeNameEditPart.java
@@ -114,12 +114,14 @@ public class DeviceCompositeNameEditPart extends PapyrusCompartmentEditPart impl
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class DeviceCompositeNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class DeviceCompositeNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class DeviceCompositeNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class DeviceCompositeNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class DeviceCompositeNameEditPart extends PapyrusCompartmentEditPart impl
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class DeviceCompositeNameEditPart extends PapyrusCompartmentEditPart impl
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class DeviceCompositeNameEditPart extends PapyrusCompartmentEditPart impl
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class DeviceCompositeNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class DeviceCompositeNameEditPart extends PapyrusCompartmentEditPart impl
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class DeviceCompositeNameEditPart extends PapyrusCompartmentEditPart impl
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class DeviceCompositeNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class DeviceCompositeNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Device_2070, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.DeviceCompositeNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class DeviceCompositeNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class DeviceCompositeNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class DeviceCompositeNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class DeviceCompositeNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class DeviceCompositeNameEditPart extends PapyrusCompartmentEditPart impl
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class DeviceCompositeNameEditPart extends PapyrusCompartmentEditPart impl
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class DeviceCompositeNameEditPart extends PapyrusCompartmentEditPart impl
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class DeviceCompositeNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class DeviceCompositeNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class DeviceCompositeNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class DeviceCompositeNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class DeviceCompositeNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class DeviceCompositeNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class DeviceCompositeNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class DeviceCompositeNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class DeviceCompositeNameEditPart extends PapyrusCompartmentEditPart impl
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class DeviceCompositeNameEditPart extends PapyrusCompartmentEditPart impl
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class DeviceCompositeNameEditPart extends PapyrusCompartmentEditPart impl
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class DeviceCompositeNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class DeviceCompositeNameEditPart extends PapyrusCompartmentEditPart impl
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class DeviceCompositeNameEditPart extends PapyrusCompartmentEditPart impl
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeviceCompositeNameEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeviceCompositeNameEditPartCN.java
index c7a8bae4a6a..f1b411d3352 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeviceCompositeNameEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DeviceCompositeNameEditPartCN.java
@@ -114,12 +114,14 @@ public class DeviceCompositeNameEditPartCN extends PapyrusCompartmentEditPart im
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class DeviceCompositeNameEditPartCN extends PapyrusCompartmentEditPart im
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class DeviceCompositeNameEditPartCN extends PapyrusCompartmentEditPart im
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class DeviceCompositeNameEditPartCN extends PapyrusCompartmentEditPart im
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class DeviceCompositeNameEditPartCN extends PapyrusCompartmentEditPart im
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class DeviceCompositeNameEditPartCN extends PapyrusCompartmentEditPart im
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class DeviceCompositeNameEditPartCN extends PapyrusCompartmentEditPart im
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class DeviceCompositeNameEditPartCN extends PapyrusCompartmentEditPart im
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class DeviceCompositeNameEditPartCN extends PapyrusCompartmentEditPart im
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class DeviceCompositeNameEditPartCN extends PapyrusCompartmentEditPart im
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class DeviceCompositeNameEditPartCN extends PapyrusCompartmentEditPart im
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class DeviceCompositeNameEditPartCN extends PapyrusCompartmentEditPart im
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class DeviceCompositeNameEditPartCN extends PapyrusCompartmentEditPart im
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Device_3082, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.DeviceCompositeNameEditPartCN.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class DeviceCompositeNameEditPartCN extends PapyrusCompartmentEditPart im
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class DeviceCompositeNameEditPartCN extends PapyrusCompartmentEditPart im
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class DeviceCompositeNameEditPartCN extends PapyrusCompartmentEditPart im
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class DeviceCompositeNameEditPartCN extends PapyrusCompartmentEditPart im
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class DeviceCompositeNameEditPartCN extends PapyrusCompartmentEditPart im
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class DeviceCompositeNameEditPartCN extends PapyrusCompartmentEditPart im
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class DeviceCompositeNameEditPartCN extends PapyrusCompartmentEditPart im
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class DeviceCompositeNameEditPartCN extends PapyrusCompartmentEditPart im
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class DeviceCompositeNameEditPartCN extends PapyrusCompartmentEditPart im
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class DeviceCompositeNameEditPartCN extends PapyrusCompartmentEditPart im
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class DeviceCompositeNameEditPartCN extends PapyrusCompartmentEditPart im
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class DeviceCompositeNameEditPartCN extends PapyrusCompartmentEditPart im
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class DeviceCompositeNameEditPartCN extends PapyrusCompartmentEditPart im
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class DeviceCompositeNameEditPartCN extends PapyrusCompartmentEditPart im
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class DeviceCompositeNameEditPartCN extends PapyrusCompartmentEditPart im
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class DeviceCompositeNameEditPartCN extends PapyrusCompartmentEditPart im
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class DeviceCompositeNameEditPartCN extends PapyrusCompartmentEditPart im
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class DeviceCompositeNameEditPartCN extends PapyrusCompartmentEditPart im
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class DeviceCompositeNameEditPartCN extends PapyrusCompartmentEditPart im
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class DeviceCompositeNameEditPartCN extends PapyrusCompartmentEditPart im
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class DeviceCompositeNameEditPartCN extends PapyrusCompartmentEditPart im
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationConstraintEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationConstraintEditPart.java
index feee70e0f18..8a9eefe4dec 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationConstraintEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationConstraintEditPart.java
@@ -70,7 +70,9 @@ public class DurationConstraintEditPart extends AbstractConstraintEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
// XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
@@ -86,7 +88,7 @@ public class DurationConstraintEditPart extends AbstractConstraintEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -106,11 +108,13 @@ public class DurationConstraintEditPart extends AbstractConstraintEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
super.handleNotificationEvent(event);
+
}
/**
@@ -122,24 +126,27 @@ public class DurationConstraintEditPart extends AbstractConstraintEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.ConstraintFigure
+ *
* @generated
*/
public ConstraintFigure getPrimaryShape() {
- return (ConstraintFigure)primaryShape;
+ return (ConstraintFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof DurationConstraintNameEditPart) {
- ((DurationConstraintNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof DurationConstraintNameEditPart) {
+ ((DurationConstraintNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
- if(childEditPart instanceof DurationConstraintSpecificationEditPart) {
- ((DurationConstraintSpecificationEditPart)childEditPart).setLabel(getPrimaryShape().getConstraintFigure());
+ if (childEditPart instanceof DurationConstraintSpecificationEditPart) {
+ ((DurationConstraintSpecificationEditPart) childEditPart).setLabel(getPrimaryShape().getConstraintFigure());
return true;
}
+
+
return false;
}
@@ -147,10 +154,10 @@ public class DurationConstraintEditPart extends AbstractConstraintEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof DurationConstraintNameEditPart) {
+ if (childEditPart instanceof DurationConstraintNameEditPart) {
return true;
}
- if(childEditPart instanceof DurationConstraintSpecificationEditPart) {
+ if (childEditPart instanceof DurationConstraintSpecificationEditPart) {
return true;
}
return false;
@@ -160,7 +167,7 @@ public class DurationConstraintEditPart extends AbstractConstraintEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -170,7 +177,7 @@ public class DurationConstraintEditPart extends AbstractConstraintEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -198,16 +205,19 @@ public class DurationConstraintEditPart extends AbstractConstraintEditPart {
*/
protected NodeFigure createNodeFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -219,7 +229,7 @@ public class DurationConstraintEditPart extends AbstractConstraintEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -229,7 +239,7 @@ public class DurationConstraintEditPart extends AbstractConstraintEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -245,8 +255,8 @@ public class DurationConstraintEditPart extends AbstractConstraintEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationConstraintEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationConstraintEditPartCN.java
index f335e059438..787f33fa295 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationConstraintEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationConstraintEditPartCN.java
@@ -70,7 +70,9 @@ public class DurationConstraintEditPartCN extends AbstractConstraintEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
// XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
@@ -86,7 +88,7 @@ public class DurationConstraintEditPartCN extends AbstractConstraintEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -106,11 +108,13 @@ public class DurationConstraintEditPartCN extends AbstractConstraintEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
super.handleNotificationEvent(event);
+
}
/**
@@ -122,24 +126,27 @@ public class DurationConstraintEditPartCN extends AbstractConstraintEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.ConstraintFigure
+ *
* @generated
*/
public ConstraintFigure getPrimaryShape() {
- return (ConstraintFigure)primaryShape;
+ return (ConstraintFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof DurationConstraintNameEditPartCN) {
- ((DurationConstraintNameEditPartCN)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof DurationConstraintNameEditPartCN) {
+ ((DurationConstraintNameEditPartCN) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
- if(childEditPart instanceof DurationConstraintSpecificationEditPartCN) {
- ((DurationConstraintSpecificationEditPartCN)childEditPart).setLabel(getPrimaryShape().getConstraintFigure());
+ if (childEditPart instanceof DurationConstraintSpecificationEditPartCN) {
+ ((DurationConstraintSpecificationEditPartCN) childEditPart).setLabel(getPrimaryShape().getConstraintFigure());
return true;
}
+
+
return false;
}
@@ -147,10 +154,10 @@ public class DurationConstraintEditPartCN extends AbstractConstraintEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof DurationConstraintNameEditPartCN) {
+ if (childEditPart instanceof DurationConstraintNameEditPartCN) {
return true;
}
- if(childEditPart instanceof DurationConstraintSpecificationEditPartCN) {
+ if (childEditPart instanceof DurationConstraintSpecificationEditPartCN) {
return true;
}
return false;
@@ -160,7 +167,7 @@ public class DurationConstraintEditPartCN extends AbstractConstraintEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -170,7 +177,7 @@ public class DurationConstraintEditPartCN extends AbstractConstraintEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -198,16 +205,19 @@ public class DurationConstraintEditPartCN extends AbstractConstraintEditPart {
*/
protected NodeFigure createNodeFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -219,7 +229,7 @@ public class DurationConstraintEditPartCN extends AbstractConstraintEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -229,7 +239,7 @@ public class DurationConstraintEditPartCN extends AbstractConstraintEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -245,8 +255,8 @@ public class DurationConstraintEditPartCN extends AbstractConstraintEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationConstraintNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationConstraintNameEditPart.java
index f9b3c827153..98fb81404c1 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationConstraintNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationConstraintNameEditPart.java
@@ -114,12 +114,14 @@ public class DurationConstraintNameEditPart extends PapyrusCompartmentEditPart i
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class DurationConstraintNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class DurationConstraintNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class DurationConstraintNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class DurationConstraintNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class DurationConstraintNameEditPart extends PapyrusCompartmentEditPart i
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class DurationConstraintNameEditPart extends PapyrusCompartmentEditPart i
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class DurationConstraintNameEditPart extends PapyrusCompartmentEditPart i
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class DurationConstraintNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class DurationConstraintNameEditPart extends PapyrusCompartmentEditPart i
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class DurationConstraintNameEditPart extends PapyrusCompartmentEditPart i
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class DurationConstraintNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class DurationConstraintNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.DurationConstraint_2110, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.DurationConstraintNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class DurationConstraintNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class DurationConstraintNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class DurationConstraintNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class DurationConstraintNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class DurationConstraintNameEditPart extends PapyrusCompartmentEditPart i
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class DurationConstraintNameEditPart extends PapyrusCompartmentEditPart i
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class DurationConstraintNameEditPart extends PapyrusCompartmentEditPart i
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class DurationConstraintNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class DurationConstraintNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class DurationConstraintNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class DurationConstraintNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class DurationConstraintNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class DurationConstraintNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class DurationConstraintNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class DurationConstraintNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class DurationConstraintNameEditPart extends PapyrusCompartmentEditPart i
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class DurationConstraintNameEditPart extends PapyrusCompartmentEditPart i
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class DurationConstraintNameEditPart extends PapyrusCompartmentEditPart i
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class DurationConstraintNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class DurationConstraintNameEditPart extends PapyrusCompartmentEditPart i
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class DurationConstraintNameEditPart extends PapyrusCompartmentEditPart i
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationConstraintNameEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationConstraintNameEditPartCN.java
index 78120417337..be48db360c1 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationConstraintNameEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationConstraintNameEditPartCN.java
@@ -114,12 +114,14 @@ public class DurationConstraintNameEditPartCN extends PapyrusCompartmentEditPart
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class DurationConstraintNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class DurationConstraintNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class DurationConstraintNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class DurationConstraintNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class DurationConstraintNameEditPartCN extends PapyrusCompartmentEditPart
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class DurationConstraintNameEditPartCN extends PapyrusCompartmentEditPart
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class DurationConstraintNameEditPartCN extends PapyrusCompartmentEditPart
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class DurationConstraintNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class DurationConstraintNameEditPartCN extends PapyrusCompartmentEditPart
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class DurationConstraintNameEditPartCN extends PapyrusCompartmentEditPart
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class DurationConstraintNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class DurationConstraintNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.DurationConstraint_3116, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.DurationConstraintNameEditPartCN.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class DurationConstraintNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class DurationConstraintNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class DurationConstraintNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class DurationConstraintNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class DurationConstraintNameEditPartCN extends PapyrusCompartmentEditPart
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class DurationConstraintNameEditPartCN extends PapyrusCompartmentEditPart
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class DurationConstraintNameEditPartCN extends PapyrusCompartmentEditPart
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class DurationConstraintNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class DurationConstraintNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class DurationConstraintNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class DurationConstraintNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class DurationConstraintNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class DurationConstraintNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class DurationConstraintNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class DurationConstraintNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class DurationConstraintNameEditPartCN extends PapyrusCompartmentEditPart
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class DurationConstraintNameEditPartCN extends PapyrusCompartmentEditPart
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class DurationConstraintNameEditPartCN extends PapyrusCompartmentEditPart
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class DurationConstraintNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class DurationConstraintNameEditPartCN extends PapyrusCompartmentEditPart
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class DurationConstraintNameEditPartCN extends PapyrusCompartmentEditPart
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationConstraintSpecificationEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationConstraintSpecificationEditPart.java
index bff86286196..c2adb5dac9d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationConstraintSpecificationEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationConstraintSpecificationEditPart.java
@@ -110,12 +110,14 @@ public class DurationConstraintSpecificationEditPart extends PapyrusCompartmentE
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -141,12 +143,12 @@ public class DurationConstraintSpecificationEditPart extends PapyrusCompartmentE
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -154,12 +156,12 @@ public class DurationConstraintSpecificationEditPart extends PapyrusCompartmentE
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -167,12 +169,12 @@ public class DurationConstraintSpecificationEditPart extends PapyrusCompartmentE
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -180,12 +182,12 @@ public class DurationConstraintSpecificationEditPart extends PapyrusCompartmentE
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -241,10 +243,12 @@ public class DurationConstraintSpecificationEditPart extends PapyrusCompartmentE
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -256,12 +260,12 @@ public class DurationConstraintSpecificationEditPart extends PapyrusCompartmentE
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -269,10 +273,12 @@ public class DurationConstraintSpecificationEditPart extends PapyrusCompartmentE
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -290,15 +296,16 @@ public class DurationConstraintSpecificationEditPart extends PapyrusCompartmentE
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -306,6 +313,7 @@ public class DurationConstraintSpecificationEditPart extends PapyrusCompartmentE
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -316,7 +324,7 @@ public class DurationConstraintSpecificationEditPart extends PapyrusCompartmentE
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -333,7 +341,7 @@ public class DurationConstraintSpecificationEditPart extends PapyrusCompartmentE
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.DurationConstraint_2110, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.DurationConstraintSpecificationEditPart.VISUAL_ID));
}
return parser;
@@ -343,8 +351,10 @@ public class DurationConstraintSpecificationEditPart extends PapyrusCompartmentE
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -373,8 +383,8 @@ public class DurationConstraintSpecificationEditPart extends PapyrusCompartmentE
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -382,8 +392,8 @@ public class DurationConstraintSpecificationEditPart extends PapyrusCompartmentE
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -393,46 +403,52 @@ public class DurationConstraintSpecificationEditPart extends PapyrusCompartmentE
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -454,12 +470,12 @@ public class DurationConstraintSpecificationEditPart extends PapyrusCompartmentE
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -489,12 +505,12 @@ public class DurationConstraintSpecificationEditPart extends PapyrusCompartmentE
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -503,12 +519,12 @@ public class DurationConstraintSpecificationEditPart extends PapyrusCompartmentE
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -516,15 +532,16 @@ public class DurationConstraintSpecificationEditPart extends PapyrusCompartmentE
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -533,9 +550,10 @@ public class DurationConstraintSpecificationEditPart extends PapyrusCompartmentE
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -543,9 +561,12 @@ public class DurationConstraintSpecificationEditPart extends PapyrusCompartmentE
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -561,11 +582,11 @@ public class DurationConstraintSpecificationEditPart extends PapyrusCompartmentE
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -576,8 +597,8 @@ public class DurationConstraintSpecificationEditPart extends PapyrusCompartmentE
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -589,7 +610,7 @@ public class DurationConstraintSpecificationEditPart extends PapyrusCompartmentE
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -615,13 +636,14 @@ public class DurationConstraintSpecificationEditPart extends PapyrusCompartmentE
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -633,8 +655,8 @@ public class DurationConstraintSpecificationEditPart extends PapyrusCompartmentE
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -651,35 +673,40 @@ public class DurationConstraintSpecificationEditPart extends PapyrusCompartmentE
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -689,12 +716,13 @@ public class DurationConstraintSpecificationEditPart extends PapyrusCompartmentE
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -729,24 +757,25 @@ public class DurationConstraintSpecificationEditPart extends PapyrusCompartmentE
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -781,7 +810,8 @@ public class DurationConstraintSpecificationEditPart extends PapyrusCompartmentE
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -790,6 +820,7 @@ public class DurationConstraintSpecificationEditPart extends PapyrusCompartmentE
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -797,5 +828,6 @@ public class DurationConstraintSpecificationEditPart extends PapyrusCompartmentE
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationConstraintSpecificationEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationConstraintSpecificationEditPartCN.java
index 3e8367b8974..72e57fd0cdd 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationConstraintSpecificationEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationConstraintSpecificationEditPartCN.java
@@ -110,12 +110,14 @@ public class DurationConstraintSpecificationEditPartCN extends PapyrusCompartmen
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -141,12 +143,12 @@ public class DurationConstraintSpecificationEditPartCN extends PapyrusCompartmen
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -154,12 +156,12 @@ public class DurationConstraintSpecificationEditPartCN extends PapyrusCompartmen
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -167,12 +169,12 @@ public class DurationConstraintSpecificationEditPartCN extends PapyrusCompartmen
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -180,12 +182,12 @@ public class DurationConstraintSpecificationEditPartCN extends PapyrusCompartmen
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -241,10 +243,12 @@ public class DurationConstraintSpecificationEditPartCN extends PapyrusCompartmen
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -256,12 +260,12 @@ public class DurationConstraintSpecificationEditPartCN extends PapyrusCompartmen
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -269,10 +273,12 @@ public class DurationConstraintSpecificationEditPartCN extends PapyrusCompartmen
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -290,15 +296,16 @@ public class DurationConstraintSpecificationEditPartCN extends PapyrusCompartmen
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -306,6 +313,7 @@ public class DurationConstraintSpecificationEditPartCN extends PapyrusCompartmen
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -316,7 +324,7 @@ public class DurationConstraintSpecificationEditPartCN extends PapyrusCompartmen
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -333,7 +341,7 @@ public class DurationConstraintSpecificationEditPartCN extends PapyrusCompartmen
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.DurationConstraint_3116, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.DurationConstraintSpecificationEditPartCN.VISUAL_ID));
}
return parser;
@@ -343,8 +351,10 @@ public class DurationConstraintSpecificationEditPartCN extends PapyrusCompartmen
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -373,8 +383,8 @@ public class DurationConstraintSpecificationEditPartCN extends PapyrusCompartmen
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -382,8 +392,8 @@ public class DurationConstraintSpecificationEditPartCN extends PapyrusCompartmen
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -393,46 +403,52 @@ public class DurationConstraintSpecificationEditPartCN extends PapyrusCompartmen
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -454,12 +470,12 @@ public class DurationConstraintSpecificationEditPartCN extends PapyrusCompartmen
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -489,12 +505,12 @@ public class DurationConstraintSpecificationEditPartCN extends PapyrusCompartmen
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -503,12 +519,12 @@ public class DurationConstraintSpecificationEditPartCN extends PapyrusCompartmen
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -516,15 +532,16 @@ public class DurationConstraintSpecificationEditPartCN extends PapyrusCompartmen
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -533,9 +550,10 @@ public class DurationConstraintSpecificationEditPartCN extends PapyrusCompartmen
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -543,9 +561,12 @@ public class DurationConstraintSpecificationEditPartCN extends PapyrusCompartmen
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -561,11 +582,11 @@ public class DurationConstraintSpecificationEditPartCN extends PapyrusCompartmen
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -576,8 +597,8 @@ public class DurationConstraintSpecificationEditPartCN extends PapyrusCompartmen
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -589,7 +610,7 @@ public class DurationConstraintSpecificationEditPartCN extends PapyrusCompartmen
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -615,13 +636,14 @@ public class DurationConstraintSpecificationEditPartCN extends PapyrusCompartmen
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -633,8 +655,8 @@ public class DurationConstraintSpecificationEditPartCN extends PapyrusCompartmen
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -651,35 +673,40 @@ public class DurationConstraintSpecificationEditPartCN extends PapyrusCompartmen
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -689,12 +716,13 @@ public class DurationConstraintSpecificationEditPartCN extends PapyrusCompartmen
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -729,24 +757,25 @@ public class DurationConstraintSpecificationEditPartCN extends PapyrusCompartmen
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -781,7 +810,8 @@ public class DurationConstraintSpecificationEditPartCN extends PapyrusCompartmen
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -790,6 +820,7 @@ public class DurationConstraintSpecificationEditPartCN extends PapyrusCompartmen
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -797,5 +828,6 @@ public class DurationConstraintSpecificationEditPartCN extends PapyrusCompartmen
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationEditPart.java
index e112aef36e5..89c05298b67 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationEditPart.java
@@ -84,7 +84,9 @@ public class DurationEditPart extends RoundedCompartmentEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
@@ -101,21 +103,21 @@ public class DurationEditPart extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case DurationFloatingLabelEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -135,8 +137,9 @@ public class DurationEditPart extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -154,6 +157,7 @@ public class DurationEditPart extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -165,20 +169,23 @@ public class DurationEditPart extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure
+ *
* @generated
*/
public RoundedCompartmentFigure getPrimaryShape() {
- return (RoundedCompartmentFigure)primaryShape;
+ return (RoundedCompartmentFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof DurationNameEditPart) {
- ((DurationNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof DurationNameEditPart) {
+ ((DurationNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
+
+
return false;
}
@@ -186,7 +193,7 @@ public class DurationEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof DurationNameEditPart) {
+ if (childEditPart instanceof DurationNameEditPart) {
return true;
}
return false;
@@ -196,7 +203,7 @@ public class DurationEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -206,7 +213,7 @@ public class DurationEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -216,7 +223,7 @@ public class DurationEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -226,7 +233,7 @@ public class DurationEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof DurationFloatingLabelEditPart) {
+ if (borderItemEditPart instanceof DurationFloatingLabelEditPart) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -249,16 +256,19 @@ public class DurationEditPart extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -270,7 +280,7 @@ public class DurationEditPart extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -280,7 +290,7 @@ public class DurationEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -296,8 +306,8 @@ public class DurationEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationFloatingLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationFloatingLabelEditPart.java
index 4c090f7724c..89f972d35fe 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationFloatingLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationFloatingLabelEditPart.java
@@ -113,15 +113,18 @@ public class DurationFloatingLabelEditPart extends FloatingLabelEditPart impleme
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class DurationFloatingLabelEditPart extends FloatingLabelEditPart impleme
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class DurationFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class DurationFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class DurationFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class DurationFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class DurationFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class DurationFloatingLabelEditPart extends FloatingLabelEditPart impleme
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class DurationFloatingLabelEditPart extends FloatingLabelEditPart impleme
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class DurationFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class DurationFloatingLabelEditPart extends FloatingLabelEditPart impleme
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class DurationFloatingLabelEditPart extends FloatingLabelEditPart impleme
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class DurationFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class DurationFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Duration_2104, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.DurationFloatingLabelEditPart.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class DurationFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class DurationFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class DurationFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class DurationFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class DurationFloatingLabelEditPart extends FloatingLabelEditPart impleme
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class DurationFloatingLabelEditPart extends FloatingLabelEditPart impleme
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class DurationFloatingLabelEditPart extends FloatingLabelEditPart impleme
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class DurationFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class DurationFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class DurationFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class DurationFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class DurationFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class DurationFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class DurationFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class DurationFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class DurationFloatingLabelEditPart extends FloatingLabelEditPart impleme
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class DurationFloatingLabelEditPart extends FloatingLabelEditPart impleme
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class DurationFloatingLabelEditPart extends FloatingLabelEditPart impleme
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationIntervalEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationIntervalEditPart.java
index cf3f01ede6d..b7d426120b3 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationIntervalEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationIntervalEditPart.java
@@ -84,7 +84,9 @@ public class DurationIntervalEditPart extends RoundedCompartmentEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
@@ -101,21 +103,21 @@ public class DurationIntervalEditPart extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case DurationIntervalFloatingLabelEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -135,8 +137,9 @@ public class DurationIntervalEditPart extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -154,6 +157,7 @@ public class DurationIntervalEditPart extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -165,20 +169,23 @@ public class DurationIntervalEditPart extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure
+ *
* @generated
*/
public RoundedCompartmentFigure getPrimaryShape() {
- return (RoundedCompartmentFigure)primaryShape;
+ return (RoundedCompartmentFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof DurationIntervalNameEditPart) {
- ((DurationIntervalNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof DurationIntervalNameEditPart) {
+ ((DurationIntervalNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
+
+
return false;
}
@@ -186,7 +193,7 @@ public class DurationIntervalEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof DurationIntervalNameEditPart) {
+ if (childEditPart instanceof DurationIntervalNameEditPart) {
return true;
}
return false;
@@ -196,7 +203,7 @@ public class DurationIntervalEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -206,7 +213,7 @@ public class DurationIntervalEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -216,7 +223,7 @@ public class DurationIntervalEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -226,7 +233,7 @@ public class DurationIntervalEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof DurationIntervalFloatingLabelEditPart) {
+ if (borderItemEditPart instanceof DurationIntervalFloatingLabelEditPart) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -249,16 +256,19 @@ public class DurationIntervalEditPart extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -270,7 +280,7 @@ public class DurationIntervalEditPart extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -280,7 +290,7 @@ public class DurationIntervalEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -296,8 +306,8 @@ public class DurationIntervalEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationIntervalFloatingLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationIntervalFloatingLabelEditPart.java
index a03c9114764..2070e377af4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationIntervalFloatingLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationIntervalFloatingLabelEditPart.java
@@ -113,15 +113,18 @@ public class DurationIntervalFloatingLabelEditPart extends FloatingLabelEditPart
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class DurationIntervalFloatingLabelEditPart extends FloatingLabelEditPart
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class DurationIntervalFloatingLabelEditPart extends FloatingLabelEditPart
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class DurationIntervalFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class DurationIntervalFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class DurationIntervalFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class DurationIntervalFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class DurationIntervalFloatingLabelEditPart extends FloatingLabelEditPart
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class DurationIntervalFloatingLabelEditPart extends FloatingLabelEditPart
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class DurationIntervalFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class DurationIntervalFloatingLabelEditPart extends FloatingLabelEditPart
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class DurationIntervalFloatingLabelEditPart extends FloatingLabelEditPart
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class DurationIntervalFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class DurationIntervalFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.DurationInterval_2106, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.DurationIntervalFloatingLabelEditPart.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class DurationIntervalFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class DurationIntervalFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class DurationIntervalFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class DurationIntervalFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class DurationIntervalFloatingLabelEditPart extends FloatingLabelEditPart
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class DurationIntervalFloatingLabelEditPart extends FloatingLabelEditPart
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class DurationIntervalFloatingLabelEditPart extends FloatingLabelEditPart
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class DurationIntervalFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class DurationIntervalFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class DurationIntervalFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class DurationIntervalFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class DurationIntervalFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class DurationIntervalFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class DurationIntervalFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class DurationIntervalFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class DurationIntervalFloatingLabelEditPart extends FloatingLabelEditPart
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class DurationIntervalFloatingLabelEditPart extends FloatingLabelEditPart
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class DurationIntervalFloatingLabelEditPart extends FloatingLabelEditPart
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationIntervalNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationIntervalNameEditPart.java
index 1e19ba1106e..9a346e20eea 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationIntervalNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationIntervalNameEditPart.java
@@ -114,12 +114,14 @@ public class DurationIntervalNameEditPart extends PapyrusCompartmentEditPart imp
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class DurationIntervalNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class DurationIntervalNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class DurationIntervalNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class DurationIntervalNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class DurationIntervalNameEditPart extends PapyrusCompartmentEditPart imp
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class DurationIntervalNameEditPart extends PapyrusCompartmentEditPart imp
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class DurationIntervalNameEditPart extends PapyrusCompartmentEditPart imp
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class DurationIntervalNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class DurationIntervalNameEditPart extends PapyrusCompartmentEditPart imp
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class DurationIntervalNameEditPart extends PapyrusCompartmentEditPart imp
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class DurationIntervalNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class DurationIntervalNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.DurationInterval_2106, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.DurationIntervalNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class DurationIntervalNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class DurationIntervalNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class DurationIntervalNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class DurationIntervalNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class DurationIntervalNameEditPart extends PapyrusCompartmentEditPart imp
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class DurationIntervalNameEditPart extends PapyrusCompartmentEditPart imp
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class DurationIntervalNameEditPart extends PapyrusCompartmentEditPart imp
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class DurationIntervalNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class DurationIntervalNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class DurationIntervalNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class DurationIntervalNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class DurationIntervalNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class DurationIntervalNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class DurationIntervalNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class DurationIntervalNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class DurationIntervalNameEditPart extends PapyrusCompartmentEditPart imp
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class DurationIntervalNameEditPart extends PapyrusCompartmentEditPart imp
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class DurationIntervalNameEditPart extends PapyrusCompartmentEditPart imp
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class DurationIntervalNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class DurationIntervalNameEditPart extends PapyrusCompartmentEditPart imp
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class DurationIntervalNameEditPart extends PapyrusCompartmentEditPart imp
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationNameEditPart.java
index e3bb6bcc5b5..2e3484e6e19 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationNameEditPart.java
@@ -114,12 +114,14 @@ public class DurationNameEditPart extends PapyrusCompartmentEditPart implements
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class DurationNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class DurationNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class DurationNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class DurationNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class DurationNameEditPart extends PapyrusCompartmentEditPart implements
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class DurationNameEditPart extends PapyrusCompartmentEditPart implements
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class DurationNameEditPart extends PapyrusCompartmentEditPart implements
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class DurationNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class DurationNameEditPart extends PapyrusCompartmentEditPart implements
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class DurationNameEditPart extends PapyrusCompartmentEditPart implements
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class DurationNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class DurationNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Duration_2104, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.DurationNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class DurationNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class DurationNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class DurationNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class DurationNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class DurationNameEditPart extends PapyrusCompartmentEditPart implements
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class DurationNameEditPart extends PapyrusCompartmentEditPart implements
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class DurationNameEditPart extends PapyrusCompartmentEditPart implements
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class DurationNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class DurationNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class DurationNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class DurationNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class DurationNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class DurationNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class DurationNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class DurationNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class DurationNameEditPart extends PapyrusCompartmentEditPart implements
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class DurationNameEditPart extends PapyrusCompartmentEditPart implements
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class DurationNameEditPart extends PapyrusCompartmentEditPart implements
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class DurationNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class DurationNameEditPart extends PapyrusCompartmentEditPart implements
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class DurationNameEditPart extends PapyrusCompartmentEditPart implements
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationObservationEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationObservationEditPart.java
index 430f2704712..421007cd2e6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationObservationEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationObservationEditPart.java
@@ -85,7 +85,9 @@ public class DurationObservationEditPart extends RoundedCompartmentEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeIconlDisplayEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
@@ -104,22 +106,22 @@ public class DurationObservationEditPart extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case DurationObservationNameEditPart.VISUAL_ID:
case DurationObservationStereotypeLabelEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -139,8 +141,9 @@ public class DurationObservationEditPart extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -158,6 +161,7 @@ public class DurationObservationEditPart extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -169,20 +173,22 @@ public class DurationObservationEditPart extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure
+ *
* @generated
*/
public RoundedCompartmentFigure getPrimaryShape() {
- return (RoundedCompartmentFigure)primaryShape;
+ return (RoundedCompartmentFigure) primaryShape;
}
/**
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof DurationObservationNameEditPart) {
+ if (borderItemEditPart instanceof DurationObservationNameEditPart) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
- } else if(borderItemEditPart instanceof DurationObservationStereotypeLabelEditPart) {
+ } else
+ if (borderItemEditPart instanceof DurationObservationStereotypeLabelEditPart) {
IBorderItemLocator locator = new ExternalLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -205,12 +211,15 @@ public class DurationObservationEditPart extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
@@ -221,7 +230,7 @@ public class DurationObservationEditPart extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -231,7 +240,7 @@ public class DurationObservationEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -247,8 +256,8 @@ public class DurationObservationEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationObservationEventEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationObservationEventEditPart.java
index 7e568b7f119..f3ed1673b7c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationObservationEventEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationObservationEventEditPart.java
@@ -60,6 +60,6 @@ public class DurationObservationEventEditPart extends ConnectionEditPart impleme
* @generated
*/
public SimpleDashedEdgeFigure getPrimaryShape() {
- return (SimpleDashedEdgeFigure)getFigure();
+ return (SimpleDashedEdgeFigure) getFigure();
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationObservationNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationObservationNameEditPart.java
index 886ceb700a4..f8bfa6e00d5 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationObservationNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationObservationNameEditPart.java
@@ -125,6 +125,7 @@ public class DurationObservationNameEditPart extends FloatingLabelEditPart imple
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -230,8 +231,7 @@ public class DurationObservationNameEditPart extends FloatingLabelEditPart imple
/**
* @generated
*/
- public void setLabel(IFigure
- figure) {
+ public void setLabel(IFigure figure) {
unregisterVisuals();
setFigure(figure);
defaultText = getLabelTextHelper(figure);
@@ -342,15 +342,14 @@ public class DurationObservationNameEditPart extends FloatingLabelEditPart imple
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid =
- (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
@@ -479,8 +478,7 @@ public class DurationObservationNameEditPart extends FloatingLabelEditPart imple
IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- }
- else if (configuration instanceof IAdvancedEditorConfiguration) {
+ } 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);
@@ -525,8 +523,7 @@ public class DurationObservationNameEditPart extends FloatingLabelEditPart imple
RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- }
- else {
+ } else {
performDirectEdit();
}
}
@@ -563,8 +560,7 @@ public class DurationObservationNameEditPart extends FloatingLabelEditPart imple
if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
- }
- else {
+ } else {
setLabelTextHelper(getFigure(), ""); //$NON-NLS-1$
setLabelIconHelper(getFigure(), null);
}
@@ -583,17 +579,15 @@ public class DurationObservationNameEditPart extends FloatingLabelEditPart imple
* @generated
*/
protected void refreshUnderline() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
if (resolveSemanticElement() instanceof Feature) {
if (((Feature) resolveSemanticElement()).isStatic()) {
((WrappingLabel) getFigure()).setTextUnderline(true);
- }
- else {
+ } else {
((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
@@ -603,9 +597,8 @@ public class DurationObservationNameEditPart extends FloatingLabelEditPart imple
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
@@ -616,14 +609,12 @@ public class DurationObservationNameEditPart extends FloatingLabelEditPart imple
*/
@Override
protected void refreshFont() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ 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));
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -717,7 +708,7 @@ public class DurationObservationNameEditPart extends FloatingLabelEditPart imple
*/
protected boolean checkExtendedEditor() {
if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -741,9 +732,9 @@ public class DurationObservationNameEditPart extends FloatingLabelEditPart imple
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());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
@@ -757,8 +748,7 @@ public class DurationObservationNameEditPart extends FloatingLabelEditPart imple
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement()
- .eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
@@ -810,18 +800,15 @@ public class DurationObservationNameEditPart extends FloatingLabelEditPart imple
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)) {
+ } 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();
+ ISemanticParser modelParser = (ISemanticParser) getParser();
if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
if (resolveSemanticElement() != null) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationObservationStereotypeLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationObservationStereotypeLabelEditPart.java
index 59bb50fc62d..6e812373643 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationObservationStereotypeLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/DurationObservationStereotypeLabelEditPart.java
@@ -127,6 +127,7 @@ public class DurationObservationStereotypeLabelEditPart extends AbstractLabelEdi
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -233,8 +234,7 @@ public class DurationObservationStereotypeLabelEditPart extends AbstractLabelEdi
/**
* @generated
*/
- public void setLabel(IFigure
- figure) {
+ public void setLabel(IFigure figure) {
unregisterVisuals();
setFigure(figure);
defaultText = getLabelTextHelper(figure);
@@ -345,15 +345,14 @@ public class DurationObservationStereotypeLabelEditPart extends AbstractLabelEdi
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid =
- (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
@@ -482,8 +481,7 @@ public class DurationObservationStereotypeLabelEditPart extends AbstractLabelEdi
IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- }
- else if (configuration instanceof IAdvancedEditorConfiguration) {
+ } 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);
@@ -528,8 +526,7 @@ public class DurationObservationStereotypeLabelEditPart extends AbstractLabelEdi
RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- }
- else {
+ } else {
performDirectEdit();
}
}
@@ -566,8 +563,7 @@ public class DurationObservationStereotypeLabelEditPart extends AbstractLabelEdi
if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
- }
- else {
+ } else {
setLabelTextHelper(getFigure(), ""); //$NON-NLS-1$
setLabelIconHelper(getFigure(), null);
}
@@ -586,17 +582,15 @@ public class DurationObservationStereotypeLabelEditPart extends AbstractLabelEdi
* @generated
*/
protected void refreshUnderline() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
if (resolveSemanticElement() instanceof Feature) {
if (((Feature) resolveSemanticElement()).isStatic()) {
((WrappingLabel) getFigure()).setTextUnderline(true);
- }
- else {
+ } else {
((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
@@ -606,9 +600,8 @@ public class DurationObservationStereotypeLabelEditPart extends AbstractLabelEdi
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
@@ -619,14 +612,12 @@ public class DurationObservationStereotypeLabelEditPart extends AbstractLabelEdi
*/
@Override
protected void refreshFont() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ 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));
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -720,7 +711,7 @@ public class DurationObservationStereotypeLabelEditPart extends AbstractLabelEdi
*/
protected boolean checkExtendedEditor() {
if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -744,9 +735,9 @@ public class DurationObservationStereotypeLabelEditPart extends AbstractLabelEdi
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());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
@@ -760,8 +751,7 @@ public class DurationObservationStereotypeLabelEditPart extends AbstractLabelEdi
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement()
- .eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
@@ -813,18 +803,15 @@ public class DurationObservationStereotypeLabelEditPart extends AbstractLabelEdi
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)) {
+ } 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();
+ ISemanticParser modelParser = (ISemanticParser) getParser();
if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
if (resolveSemanticElement() != null) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationEditPart.java
index 4c6757bf7b1..fc7e55839d6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationEditPart.java
@@ -93,7 +93,9 @@ public class EnumerationEditPart extends RoundedCompartmentEditPart {
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new DefaultCreationEditPolicy());
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
@@ -113,21 +115,21 @@ public class EnumerationEditPart extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case EnumerationFloatingLabelEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -147,8 +149,9 @@ public class EnumerationEditPart extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -166,6 +169,7 @@ public class EnumerationEditPart extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -177,26 +181,30 @@ public class EnumerationEditPart extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.EnumerationFigure
+ *
* @generated
*/
public EnumerationFigure getPrimaryShape() {
- return (EnumerationFigure)primaryShape;
+ return (EnumerationFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof EnumerationNameEditPart) {
- ((EnumerationNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof EnumerationNameEditPart) {
+ ((EnumerationNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
- if(childEditPart instanceof EnumerationEnumerationLiteralCompartmentEditPart) {
+
+
+ if (childEditPart instanceof EnumerationEnumerationLiteralCompartmentEditPart) {
IFigure pane = getPrimaryShape().getEnumerationLiteralCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((EnumerationEnumerationLiteralCompartmentEditPart)childEditPart).getFigure());
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.add(((EnumerationEnumerationLiteralCompartmentEditPart) childEditPart).getFigure());
return true;
}
+
return false;
}
@@ -204,12 +212,12 @@ public class EnumerationEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof EnumerationNameEditPart) {
+ if (childEditPart instanceof EnumerationNameEditPart) {
return true;
}
- if(childEditPart instanceof EnumerationEnumerationLiteralCompartmentEditPart) {
+ if (childEditPart instanceof EnumerationEnumerationLiteralCompartmentEditPart) {
IFigure pane = getPrimaryShape().getEnumerationLiteralCompartmentFigure();
- pane.remove(((EnumerationEnumerationLiteralCompartmentEditPart)childEditPart).getFigure());
+ pane.remove(((EnumerationEnumerationLiteralCompartmentEditPart) childEditPart).getFigure());
return true;
}
return false;
@@ -219,7 +227,7 @@ public class EnumerationEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -229,7 +237,7 @@ public class EnumerationEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -239,10 +247,10 @@ public class EnumerationEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof EnumerationEnumerationLiteralCompartmentEditPart) {
+ if (editPart instanceof EnumerationEnumerationLiteralCompartmentEditPart) {
return getPrimaryShape().getEnumerationLiteralCompartmentFigure();
}
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -252,7 +260,7 @@ public class EnumerationEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof EnumerationFloatingLabelEditPart) {
+ if (borderItemEditPart instanceof EnumerationFloatingLabelEditPart) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -275,16 +283,19 @@ public class EnumerationEditPart extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -296,7 +307,7 @@ public class EnumerationEditPart extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -306,7 +317,7 @@ public class EnumerationEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -322,8 +333,8 @@ public class EnumerationEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
@@ -338,10 +349,10 @@ public class EnumerationEditPart extends RoundedCompartmentEditPart {
* @generated
*/
public EditPart getTargetEditPart(Request request) {
- if(request instanceof CreateViewAndElementRequest) {
- CreateElementRequestAdapter adapter = ((CreateViewAndElementRequest)request).getViewAndElementDescriptor().getCreateElementRequestAdapter();
- IElementType type = (IElementType)adapter.getAdapter(IElementType.class);
- if(UMLElementTypes.isKindOf(type, UMLElementTypes.EnumerationLiteral_3066)) {
+ if (request instanceof CreateViewAndElementRequest) {
+ CreateElementRequestAdapter adapter = ((CreateViewAndElementRequest) request).getViewAndElementDescriptor().getCreateElementRequestAdapter();
+ IElementType type = (IElementType) adapter.getAdapter(IElementType.class);
+ if (UMLElementTypes.isKindOf(type, UMLElementTypes.EnumerationLiteral_3066)) {
return getChildBySemanticHint(UMLVisualIDRegistry.getType(EnumerationEnumerationLiteralCompartmentEditPart.VISUAL_ID));
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationEditPartCN.java
index 25cd9689d1b..5bc15862626 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationEditPartCN.java
@@ -93,7 +93,9 @@ public class EnumerationEditPartCN extends RoundedCompartmentEditPart {
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new DefaultCreationEditPolicy());
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
@@ -113,21 +115,21 @@ public class EnumerationEditPartCN extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case EnumerationFloatingLabelEditPartCN.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -147,8 +149,9 @@ public class EnumerationEditPartCN extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -166,6 +169,7 @@ public class EnumerationEditPartCN extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -177,26 +181,30 @@ public class EnumerationEditPartCN extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.EnumerationFigure
+ *
* @generated
*/
public EnumerationFigure getPrimaryShape() {
- return (EnumerationFigure)primaryShape;
+ return (EnumerationFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof EnumerationNameEditPartCN) {
- ((EnumerationNameEditPartCN)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof EnumerationNameEditPartCN) {
+ ((EnumerationNameEditPartCN) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
- if(childEditPart instanceof EnumerationEnumerationLiteralCompartmentEditPartCN) {
+
+
+ if (childEditPart instanceof EnumerationEnumerationLiteralCompartmentEditPartCN) {
IFigure pane = getPrimaryShape().getEnumerationLiteralCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((EnumerationEnumerationLiteralCompartmentEditPartCN)childEditPart).getFigure());
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.add(((EnumerationEnumerationLiteralCompartmentEditPartCN) childEditPart).getFigure());
return true;
}
+
return false;
}
@@ -204,12 +212,12 @@ public class EnumerationEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof EnumerationNameEditPartCN) {
+ if (childEditPart instanceof EnumerationNameEditPartCN) {
return true;
}
- if(childEditPart instanceof EnumerationEnumerationLiteralCompartmentEditPartCN) {
+ if (childEditPart instanceof EnumerationEnumerationLiteralCompartmentEditPartCN) {
IFigure pane = getPrimaryShape().getEnumerationLiteralCompartmentFigure();
- pane.remove(((EnumerationEnumerationLiteralCompartmentEditPartCN)childEditPart).getFigure());
+ pane.remove(((EnumerationEnumerationLiteralCompartmentEditPartCN) childEditPart).getFigure());
return true;
}
return false;
@@ -219,7 +227,7 @@ public class EnumerationEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -229,7 +237,7 @@ public class EnumerationEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -239,10 +247,10 @@ public class EnumerationEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof EnumerationEnumerationLiteralCompartmentEditPartCN) {
+ if (editPart instanceof EnumerationEnumerationLiteralCompartmentEditPartCN) {
return getPrimaryShape().getEnumerationLiteralCompartmentFigure();
}
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -252,7 +260,7 @@ public class EnumerationEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof EnumerationFloatingLabelEditPartCN) {
+ if (borderItemEditPart instanceof EnumerationFloatingLabelEditPartCN) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -275,16 +283,19 @@ public class EnumerationEditPartCN extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -296,7 +307,7 @@ public class EnumerationEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -306,7 +317,7 @@ public class EnumerationEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -322,8 +333,8 @@ public class EnumerationEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
@@ -338,10 +349,10 @@ public class EnumerationEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
public EditPart getTargetEditPart(Request request) {
- if(request instanceof CreateViewAndElementRequest) {
- CreateElementRequestAdapter adapter = ((CreateViewAndElementRequest)request).getViewAndElementDescriptor().getCreateElementRequestAdapter();
- IElementType type = (IElementType)adapter.getAdapter(IElementType.class);
- if(UMLElementTypes.isKindOf(type, UMLElementTypes.EnumerationLiteral_3066)) {
+ if (request instanceof CreateViewAndElementRequest) {
+ CreateElementRequestAdapter adapter = ((CreateViewAndElementRequest) request).getViewAndElementDescriptor().getCreateElementRequestAdapter();
+ IElementType type = (IElementType) adapter.getAdapter(IElementType.class);
+ if (UMLElementTypes.isKindOf(type, UMLElementTypes.EnumerationLiteral_3066)) {
return getChildBySemanticHint(UMLVisualIDRegistry.getType(EnumerationEnumerationLiteralCompartmentEditPartCN.VISUAL_ID));
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationEnumerationLiteralCompartmentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationEnumerationLiteralCompartmentEditPart.java
index a8c90563602..3ce08d1c683 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationEnumerationLiteralCompartmentEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationEnumerationLiteralCompartmentEditPart.java
@@ -84,7 +84,7 @@ public class EnumerationEnumerationLiteralCompartmentEditPart extends ListCompar
* @generated
*/
protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
+ if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
super.setRatio(ratio);
}
}
@@ -93,6 +93,7 @@ public class EnumerationEnumerationLiteralCompartmentEditPart extends ListCompar
* @generated
*/
public EditPart getTargetEditPart(Request request) {
+
return super.getTargetEditPart(request);
}
@@ -101,7 +102,10 @@ public class EnumerationEnumerationLiteralCompartmentEditPart extends ListCompar
*/
protected void handleNotificationEvent(Notification notification) {
Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
+ if (NotationPackage.eINSTANCE.getSize_Width().equals(feature)
+ || NotationPackage.eINSTANCE.getSize_Height().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_X().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
refreshBounds();
}
super.handleNotificationEvent(notification);
@@ -111,13 +115,16 @@ public class EnumerationEnumerationLiteralCompartmentEditPart extends ListCompar
* @generated
*/
protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
+ ((GraphicalEditPart) getParent()).setLayoutConstraint(
+ this,
+ getFigure(),
+ new Rectangle(loc, size));
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationEnumerationLiteralCompartmentEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationEnumerationLiteralCompartmentEditPartCN.java
index 6a3e0bb3204..6db36997579 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationEnumerationLiteralCompartmentEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationEnumerationLiteralCompartmentEditPartCN.java
@@ -84,7 +84,7 @@ public class EnumerationEnumerationLiteralCompartmentEditPartCN extends ListComp
* @generated
*/
protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
+ if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
super.setRatio(ratio);
}
}
@@ -93,6 +93,7 @@ public class EnumerationEnumerationLiteralCompartmentEditPartCN extends ListComp
* @generated
*/
public EditPart getTargetEditPart(Request request) {
+
return super.getTargetEditPart(request);
}
@@ -101,7 +102,10 @@ public class EnumerationEnumerationLiteralCompartmentEditPartCN extends ListComp
*/
protected void handleNotificationEvent(Notification notification) {
Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
+ if (NotationPackage.eINSTANCE.getSize_Width().equals(feature)
+ || NotationPackage.eINSTANCE.getSize_Height().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_X().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
refreshBounds();
}
super.handleNotificationEvent(notification);
@@ -111,13 +115,16 @@ public class EnumerationEnumerationLiteralCompartmentEditPartCN extends ListComp
* @generated
*/
protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
+ ((GraphicalEditPart) getParent()).setLayoutConstraint(
+ this,
+ getFigure(),
+ new Rectangle(loc, size));
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationFloatingLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationFloatingLabelEditPart.java
index 1190510e97a..a5b05388aff 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationFloatingLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationFloatingLabelEditPart.java
@@ -113,15 +113,18 @@ public class EnumerationFloatingLabelEditPart extends FloatingLabelEditPart impl
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class EnumerationFloatingLabelEditPart extends FloatingLabelEditPart impl
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class EnumerationFloatingLabelEditPart extends FloatingLabelEditPart impl
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class EnumerationFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class EnumerationFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class EnumerationFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class EnumerationFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class EnumerationFloatingLabelEditPart extends FloatingLabelEditPart impl
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class EnumerationFloatingLabelEditPart extends FloatingLabelEditPart impl
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class EnumerationFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class EnumerationFloatingLabelEditPart extends FloatingLabelEditPart impl
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class EnumerationFloatingLabelEditPart extends FloatingLabelEditPart impl
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class EnumerationFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class EnumerationFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Enumeration_2067, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.EnumerationFloatingLabelEditPart.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class EnumerationFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class EnumerationFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class EnumerationFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class EnumerationFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class EnumerationFloatingLabelEditPart extends FloatingLabelEditPart impl
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class EnumerationFloatingLabelEditPart extends FloatingLabelEditPart impl
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class EnumerationFloatingLabelEditPart extends FloatingLabelEditPart impl
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class EnumerationFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class EnumerationFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class EnumerationFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class EnumerationFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class EnumerationFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class EnumerationFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class EnumerationFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class EnumerationFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class EnumerationFloatingLabelEditPart extends FloatingLabelEditPart impl
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class EnumerationFloatingLabelEditPart extends FloatingLabelEditPart impl
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class EnumerationFloatingLabelEditPart extends FloatingLabelEditPart impl
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationFloatingLabelEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationFloatingLabelEditPartCN.java
index 47040590599..ed3861ac1c1 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationFloatingLabelEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationFloatingLabelEditPartCN.java
@@ -113,15 +113,18 @@ public class EnumerationFloatingLabelEditPartCN extends FloatingLabelEditPart im
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class EnumerationFloatingLabelEditPartCN extends FloatingLabelEditPart im
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class EnumerationFloatingLabelEditPartCN extends FloatingLabelEditPart im
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class EnumerationFloatingLabelEditPartCN extends FloatingLabelEditPart im
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class EnumerationFloatingLabelEditPartCN extends FloatingLabelEditPart im
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class EnumerationFloatingLabelEditPartCN extends FloatingLabelEditPart im
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class EnumerationFloatingLabelEditPartCN extends FloatingLabelEditPart im
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class EnumerationFloatingLabelEditPartCN extends FloatingLabelEditPart im
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class EnumerationFloatingLabelEditPartCN extends FloatingLabelEditPart im
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class EnumerationFloatingLabelEditPartCN extends FloatingLabelEditPart im
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class EnumerationFloatingLabelEditPartCN extends FloatingLabelEditPart im
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class EnumerationFloatingLabelEditPartCN extends FloatingLabelEditPart im
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class EnumerationFloatingLabelEditPartCN extends FloatingLabelEditPart im
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class EnumerationFloatingLabelEditPartCN extends FloatingLabelEditPart im
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Enumeration_3079, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.EnumerationFloatingLabelEditPartCN.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class EnumerationFloatingLabelEditPartCN extends FloatingLabelEditPart im
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class EnumerationFloatingLabelEditPartCN extends FloatingLabelEditPart im
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class EnumerationFloatingLabelEditPartCN extends FloatingLabelEditPart im
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class EnumerationFloatingLabelEditPartCN extends FloatingLabelEditPart im
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class EnumerationFloatingLabelEditPartCN extends FloatingLabelEditPart im
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class EnumerationFloatingLabelEditPartCN extends FloatingLabelEditPart im
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class EnumerationFloatingLabelEditPartCN extends FloatingLabelEditPart im
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class EnumerationFloatingLabelEditPartCN extends FloatingLabelEditPart im
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class EnumerationFloatingLabelEditPartCN extends FloatingLabelEditPart im
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class EnumerationFloatingLabelEditPartCN extends FloatingLabelEditPart im
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class EnumerationFloatingLabelEditPartCN extends FloatingLabelEditPart im
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class EnumerationFloatingLabelEditPartCN extends FloatingLabelEditPart im
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class EnumerationFloatingLabelEditPartCN extends FloatingLabelEditPart im
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class EnumerationFloatingLabelEditPartCN extends FloatingLabelEditPart im
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class EnumerationFloatingLabelEditPartCN extends FloatingLabelEditPart im
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class EnumerationFloatingLabelEditPartCN extends FloatingLabelEditPart im
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class EnumerationFloatingLabelEditPartCN extends FloatingLabelEditPart im
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class EnumerationFloatingLabelEditPartCN extends FloatingLabelEditPart im
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationLiteralEditPartCLN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationLiteralEditPartCLN.java
index 47e5fc362d0..93613bee4e3 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationLiteralEditPartCLN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationLiteralEditPartCLN.java
@@ -122,12 +122,14 @@ public class EnumerationLiteralEditPartCLN extends CompartmentEditPart implement
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -143,7 +145,7 @@ public class EnumerationLiteralEditPartCLN extends CompartmentEditPart implement
* @generated
*/
public DragTracker getDragTracker(Request request) {
- if(request instanceof SelectionRequest && ((SelectionRequest)request).getLastButtonPressed() == 3) {
+ if (request instanceof SelectionRequest && ((SelectionRequest) request).getLastButtonPressed() == 3) {
return null;
}
return new DragEditPartsTrackerEx(this);
@@ -164,12 +166,12 @@ public class EnumerationLiteralEditPartCLN extends CompartmentEditPart implement
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -177,12 +179,12 @@ public class EnumerationLiteralEditPartCLN extends CompartmentEditPart implement
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -190,12 +192,12 @@ public class EnumerationLiteralEditPartCLN extends CompartmentEditPart implement
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -203,12 +205,12 @@ public class EnumerationLiteralEditPartCLN extends CompartmentEditPart implement
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -256,12 +258,12 @@ public class EnumerationLiteralEditPartCLN extends CompartmentEditPart implement
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -274,10 +276,12 @@ public class EnumerationLiteralEditPartCLN extends CompartmentEditPart implement
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -289,12 +293,12 @@ public class EnumerationLiteralEditPartCLN extends CompartmentEditPart implement
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -302,10 +306,12 @@ public class EnumerationLiteralEditPartCLN extends CompartmentEditPart implement
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -323,15 +329,16 @@ public class EnumerationLiteralEditPartCLN extends CompartmentEditPart implement
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -339,6 +346,7 @@ public class EnumerationLiteralEditPartCLN extends CompartmentEditPart implement
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -349,7 +357,7 @@ public class EnumerationLiteralEditPartCLN extends CompartmentEditPart implement
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -366,7 +374,7 @@ public class EnumerationLiteralEditPartCLN extends CompartmentEditPart implement
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.EnumerationLiteral_3066, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.EnumerationLiteralEditPartCLN.VISUAL_ID));
}
return parser;
@@ -376,8 +384,10 @@ public class EnumerationLiteralEditPartCLN extends CompartmentEditPart implement
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -406,8 +416,8 @@ public class EnumerationLiteralEditPartCLN extends CompartmentEditPart implement
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -415,8 +425,8 @@ public class EnumerationLiteralEditPartCLN extends CompartmentEditPart implement
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -426,46 +436,52 @@ public class EnumerationLiteralEditPartCLN extends CompartmentEditPart implement
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -487,12 +503,12 @@ public class EnumerationLiteralEditPartCLN extends CompartmentEditPart implement
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -522,12 +538,12 @@ public class EnumerationLiteralEditPartCLN extends CompartmentEditPart implement
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -536,12 +552,12 @@ public class EnumerationLiteralEditPartCLN extends CompartmentEditPart implement
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -549,15 +565,16 @@ public class EnumerationLiteralEditPartCLN extends CompartmentEditPart implement
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -566,9 +583,10 @@ public class EnumerationLiteralEditPartCLN extends CompartmentEditPart implement
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -576,9 +594,12 @@ public class EnumerationLiteralEditPartCLN extends CompartmentEditPart implement
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -594,11 +615,11 @@ public class EnumerationLiteralEditPartCLN extends CompartmentEditPart implement
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -609,8 +630,8 @@ public class EnumerationLiteralEditPartCLN extends CompartmentEditPart implement
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -622,7 +643,7 @@ public class EnumerationLiteralEditPartCLN extends CompartmentEditPart implement
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -648,13 +669,14 @@ public class EnumerationLiteralEditPartCLN extends CompartmentEditPart implement
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -666,8 +688,8 @@ public class EnumerationLiteralEditPartCLN extends CompartmentEditPart implement
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -684,35 +706,40 @@ public class EnumerationLiteralEditPartCLN extends CompartmentEditPart implement
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -722,12 +749,13 @@ public class EnumerationLiteralEditPartCLN extends CompartmentEditPart implement
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -761,34 +789,35 @@ public class EnumerationLiteralEditPartCLN extends CompartmentEditPart implement
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
- if(UMLPackage.eINSTANCE.getFeature_IsStatic().equals(feature)) {
+ if (UMLPackage.eINSTANCE.getFeature_IsStatic().equals(feature)) {
refreshUnderline();
}
super.handleNotificationEvent(event);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationNameEditPart.java
index a4f778d9c3d..c25e34ef34f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationNameEditPart.java
@@ -114,12 +114,14 @@ public class EnumerationNameEditPart extends PapyrusCompartmentEditPart implemen
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class EnumerationNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class EnumerationNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class EnumerationNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class EnumerationNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class EnumerationNameEditPart extends PapyrusCompartmentEditPart implemen
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class EnumerationNameEditPart extends PapyrusCompartmentEditPart implemen
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class EnumerationNameEditPart extends PapyrusCompartmentEditPart implemen
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class EnumerationNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class EnumerationNameEditPart extends PapyrusCompartmentEditPart implemen
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class EnumerationNameEditPart extends PapyrusCompartmentEditPart implemen
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class EnumerationNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class EnumerationNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Enumeration_2067, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.EnumerationNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class EnumerationNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class EnumerationNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class EnumerationNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class EnumerationNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class EnumerationNameEditPart extends PapyrusCompartmentEditPart implemen
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class EnumerationNameEditPart extends PapyrusCompartmentEditPart implemen
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class EnumerationNameEditPart extends PapyrusCompartmentEditPart implemen
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class EnumerationNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class EnumerationNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class EnumerationNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class EnumerationNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class EnumerationNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class EnumerationNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class EnumerationNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class EnumerationNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class EnumerationNameEditPart extends PapyrusCompartmentEditPart implemen
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class EnumerationNameEditPart extends PapyrusCompartmentEditPart implemen
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class EnumerationNameEditPart extends PapyrusCompartmentEditPart implemen
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class EnumerationNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class EnumerationNameEditPart extends PapyrusCompartmentEditPart implemen
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class EnumerationNameEditPart extends PapyrusCompartmentEditPart implemen
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationNameEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationNameEditPartCN.java
index 4d9ff0d61df..1ca34793baa 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationNameEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/EnumerationNameEditPartCN.java
@@ -114,12 +114,14 @@ public class EnumerationNameEditPartCN extends PapyrusCompartmentEditPart implem
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class EnumerationNameEditPartCN extends PapyrusCompartmentEditPart implem
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class EnumerationNameEditPartCN extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class EnumerationNameEditPartCN extends PapyrusCompartmentEditPart implem
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class EnumerationNameEditPartCN extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class EnumerationNameEditPartCN extends PapyrusCompartmentEditPart implem
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class EnumerationNameEditPartCN extends PapyrusCompartmentEditPart implem
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class EnumerationNameEditPartCN extends PapyrusCompartmentEditPart implem
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class EnumerationNameEditPartCN extends PapyrusCompartmentEditPart implem
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class EnumerationNameEditPartCN extends PapyrusCompartmentEditPart implem
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class EnumerationNameEditPartCN extends PapyrusCompartmentEditPart implem
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class EnumerationNameEditPartCN extends PapyrusCompartmentEditPart implem
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class EnumerationNameEditPartCN extends PapyrusCompartmentEditPart implem
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Enumeration_3079, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.EnumerationNameEditPartCN.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class EnumerationNameEditPartCN extends PapyrusCompartmentEditPart implem
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class EnumerationNameEditPartCN extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class EnumerationNameEditPartCN extends PapyrusCompartmentEditPart implem
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class EnumerationNameEditPartCN extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class EnumerationNameEditPartCN extends PapyrusCompartmentEditPart implem
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class EnumerationNameEditPartCN extends PapyrusCompartmentEditPart implem
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class EnumerationNameEditPartCN extends PapyrusCompartmentEditPart implem
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class EnumerationNameEditPartCN extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class EnumerationNameEditPartCN extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class EnumerationNameEditPartCN extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class EnumerationNameEditPartCN extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class EnumerationNameEditPartCN extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class EnumerationNameEditPartCN extends PapyrusCompartmentEditPart implem
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class EnumerationNameEditPartCN extends PapyrusCompartmentEditPart implem
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class EnumerationNameEditPartCN extends PapyrusCompartmentEditPart implem
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class EnumerationNameEditPartCN extends PapyrusCompartmentEditPart implem
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class EnumerationNameEditPartCN extends PapyrusCompartmentEditPart implem
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class EnumerationNameEditPartCN extends PapyrusCompartmentEditPart implem
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class EnumerationNameEditPartCN extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class EnumerationNameEditPartCN extends PapyrusCompartmentEditPart implem
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class EnumerationNameEditPartCN extends PapyrusCompartmentEditPart implem
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExecutionEnvironmentCompositeCompartmentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExecutionEnvironmentCompositeCompartmentEditPart.java
index be60409a839..64d8d33fe4b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExecutionEnvironmentCompositeCompartmentEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExecutionEnvironmentCompositeCompartmentEditPart.java
@@ -81,7 +81,7 @@ public class ExecutionEnvironmentCompositeCompartmentEditPart extends LinkLFShap
* @generated
*/
protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
+ if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
super.setRatio(ratio);
}
}
@@ -90,6 +90,7 @@ public class ExecutionEnvironmentCompositeCompartmentEditPart extends LinkLFShap
* @generated
*/
public EditPart getTargetEditPart(Request request) {
+
return super.getTargetEditPart(request);
}
@@ -98,7 +99,10 @@ public class ExecutionEnvironmentCompositeCompartmentEditPart extends LinkLFShap
*/
protected void handleNotificationEvent(Notification notification) {
Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
+ if (NotationPackage.eINSTANCE.getSize_Width().equals(feature)
+ || NotationPackage.eINSTANCE.getSize_Height().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_X().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
refreshBounds();
}
super.handleNotificationEvent(notification);
@@ -108,13 +112,16 @@ public class ExecutionEnvironmentCompositeCompartmentEditPart extends LinkLFShap
* @generated
*/
protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
+ ((GraphicalEditPart) getParent()).setLayoutConstraint(
+ this,
+ getFigure(),
+ new Rectangle(loc, size));
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExecutionEnvironmentCompositeCompartmentEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExecutionEnvironmentCompositeCompartmentEditPartCN.java
index 2e8acfa7e66..8efefe69787 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExecutionEnvironmentCompositeCompartmentEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExecutionEnvironmentCompositeCompartmentEditPartCN.java
@@ -81,7 +81,7 @@ public class ExecutionEnvironmentCompositeCompartmentEditPartCN extends LinkLFSh
* @generated
*/
protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
+ if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
super.setRatio(ratio);
}
}
@@ -90,6 +90,7 @@ public class ExecutionEnvironmentCompositeCompartmentEditPartCN extends LinkLFSh
* @generated
*/
public EditPart getTargetEditPart(Request request) {
+
return super.getTargetEditPart(request);
}
@@ -98,7 +99,10 @@ public class ExecutionEnvironmentCompositeCompartmentEditPartCN extends LinkLFSh
*/
protected void handleNotificationEvent(Notification notification) {
Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
+ if (NotationPackage.eINSTANCE.getSize_Width().equals(feature)
+ || NotationPackage.eINSTANCE.getSize_Height().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_X().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
refreshBounds();
}
super.handleNotificationEvent(notification);
@@ -108,13 +112,16 @@ public class ExecutionEnvironmentCompositeCompartmentEditPartCN extends LinkLFSh
* @generated
*/
protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
+ ((GraphicalEditPart) getParent()).setLayoutConstraint(
+ this,
+ getFigure(),
+ new Rectangle(loc, size));
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExecutionEnvironmentCompositeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExecutionEnvironmentCompositeEditPart.java
index 11fa9da6f08..0c4ae4d9e96 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExecutionEnvironmentCompositeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExecutionEnvironmentCompositeEditPart.java
@@ -96,7 +96,9 @@ public class ExecutionEnvironmentCompositeEditPart extends RoundedCompartmentEdi
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new DefaultCreationEditPolicy());
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
@@ -120,14 +122,14 @@ public class ExecutionEnvironmentCompositeEditPart extends RoundedCompartmentEdi
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case ExecutionEnvironmentCompositeFloatingLabelEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
@@ -136,7 +138,7 @@ public class ExecutionEnvironmentCompositeEditPart extends RoundedCompartmentEdi
return new BorderItemResizableEditPolicy();
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -156,8 +158,9 @@ public class ExecutionEnvironmentCompositeEditPart extends RoundedCompartmentEdi
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -175,6 +178,7 @@ public class ExecutionEnvironmentCompositeEditPart extends RoundedCompartmentEdi
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -186,32 +190,40 @@ public class ExecutionEnvironmentCompositeEditPart extends RoundedCompartmentEdi
/**
* org.eclipse.papyrus.uml.diagram.composite.custom.figures.ExecutionEnvironmentCompositeFigure
+ *
* @generated
*/
public ExecutionEnvironmentCompositeFigure getPrimaryShape() {
- return (ExecutionEnvironmentCompositeFigure)primaryShape;
+ return (ExecutionEnvironmentCompositeFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ExecutionEnvironmentCompositeNameEditPart) {
- ((ExecutionEnvironmentCompositeNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof ExecutionEnvironmentCompositeNameEditPart) {
+ ((ExecutionEnvironmentCompositeNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
- if(childEditPart instanceof ExecutionEnvironmentCompositeCompartmentEditPart) {
+
+
+ if (childEditPart instanceof ExecutionEnvironmentCompositeCompartmentEditPart) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((ExecutionEnvironmentCompositeCompartmentEditPart)childEditPart).getFigure());
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.add(((ExecutionEnvironmentCompositeCompartmentEditPart) childEditPart).getFigure());
return true;
}
- //Papyrus Gencode :Affixed Port locator
- if(childEditPart instanceof PortEditPart) {
+
+
+
+ // Papyrus Gencode :Affixed Port locator
+ if (childEditPart instanceof PortEditPart) {
IBorderItemLocator locator = new PortPositionLocator(getMainFigure(), PositionConstants.NONE);
- getBorderedFigure().getBorderItemContainer().add(((PortEditPart)childEditPart).getFigure(), locator);
+ getBorderedFigure().getBorderItemContainer().add(((PortEditPart) childEditPart).getFigure(), locator);
return true;
}
+
+
return false;
}
@@ -219,16 +231,16 @@ public class ExecutionEnvironmentCompositeEditPart extends RoundedCompartmentEdi
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ExecutionEnvironmentCompositeNameEditPart) {
+ if (childEditPart instanceof ExecutionEnvironmentCompositeNameEditPart) {
return true;
}
- if(childEditPart instanceof ExecutionEnvironmentCompositeCompartmentEditPart) {
+ if (childEditPart instanceof ExecutionEnvironmentCompositeCompartmentEditPart) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- pane.remove(((ExecutionEnvironmentCompositeCompartmentEditPart)childEditPart).getFigure());
+ pane.remove(((ExecutionEnvironmentCompositeCompartmentEditPart) childEditPart).getFigure());
return true;
}
- if(childEditPart instanceof PortEditPart) {
- getBorderedFigure().getBorderItemContainer().remove(((PortEditPart)childEditPart).getFigure());
+ if (childEditPart instanceof PortEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((PortEditPart) childEditPart).getFigure());
return true;
}
return false;
@@ -238,7 +250,7 @@ public class ExecutionEnvironmentCompositeEditPart extends RoundedCompartmentEdi
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -248,7 +260,7 @@ public class ExecutionEnvironmentCompositeEditPart extends RoundedCompartmentEdi
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -258,10 +270,10 @@ public class ExecutionEnvironmentCompositeEditPart extends RoundedCompartmentEdi
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof ExecutionEnvironmentCompositeCompartmentEditPart) {
+ if (editPart instanceof ExecutionEnvironmentCompositeCompartmentEditPart) {
return getPrimaryShape().getCompositeCompartmentFigure();
}
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -271,7 +283,7 @@ public class ExecutionEnvironmentCompositeEditPart extends RoundedCompartmentEdi
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof ExecutionEnvironmentCompositeFloatingLabelEditPart) {
+ if (borderItemEditPart instanceof ExecutionEnvironmentCompositeFloatingLabelEditPart) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -294,16 +306,19 @@ public class ExecutionEnvironmentCompositeEditPart extends RoundedCompartmentEdi
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -315,7 +330,7 @@ public class ExecutionEnvironmentCompositeEditPart extends RoundedCompartmentEdi
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -325,7 +340,7 @@ public class ExecutionEnvironmentCompositeEditPart extends RoundedCompartmentEdi
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -341,8 +356,8 @@ public class ExecutionEnvironmentCompositeEditPart extends RoundedCompartmentEdi
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExecutionEnvironmentCompositeEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExecutionEnvironmentCompositeEditPartCN.java
index b372a610bc8..847f77621ad 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExecutionEnvironmentCompositeEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExecutionEnvironmentCompositeEditPartCN.java
@@ -96,7 +96,9 @@ public class ExecutionEnvironmentCompositeEditPartCN extends RoundedCompartmentE
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new DefaultCreationEditPolicy());
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
@@ -120,14 +122,14 @@ public class ExecutionEnvironmentCompositeEditPartCN extends RoundedCompartmentE
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case ExecutionEnvironmentCompositeFloatingLabelEditPartCN.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
@@ -136,7 +138,7 @@ public class ExecutionEnvironmentCompositeEditPartCN extends RoundedCompartmentE
return new BorderItemResizableEditPolicy();
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -156,8 +158,9 @@ public class ExecutionEnvironmentCompositeEditPartCN extends RoundedCompartmentE
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -175,6 +178,7 @@ public class ExecutionEnvironmentCompositeEditPartCN extends RoundedCompartmentE
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -186,32 +190,40 @@ public class ExecutionEnvironmentCompositeEditPartCN extends RoundedCompartmentE
/**
* org.eclipse.papyrus.uml.diagram.composite.custom.figures.ExecutionEnvironmentCompositeFigure
+ *
* @generated
*/
public ExecutionEnvironmentCompositeFigure getPrimaryShape() {
- return (ExecutionEnvironmentCompositeFigure)primaryShape;
+ return (ExecutionEnvironmentCompositeFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ExecutionEnvironmentCompositeNameEditPartCN) {
- ((ExecutionEnvironmentCompositeNameEditPartCN)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof ExecutionEnvironmentCompositeNameEditPartCN) {
+ ((ExecutionEnvironmentCompositeNameEditPartCN) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
- if(childEditPart instanceof ExecutionEnvironmentCompositeCompartmentEditPartCN) {
+
+
+ if (childEditPart instanceof ExecutionEnvironmentCompositeCompartmentEditPartCN) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((ExecutionEnvironmentCompositeCompartmentEditPartCN)childEditPart).getFigure());
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.add(((ExecutionEnvironmentCompositeCompartmentEditPartCN) childEditPart).getFigure());
return true;
}
- //Papyrus Gencode :Affixed Port locator
- if(childEditPart instanceof PortEditPart) {
+
+
+
+ // Papyrus Gencode :Affixed Port locator
+ if (childEditPart instanceof PortEditPart) {
IBorderItemLocator locator = new PortPositionLocator(getMainFigure(), PositionConstants.NONE);
- getBorderedFigure().getBorderItemContainer().add(((PortEditPart)childEditPart).getFigure(), locator);
+ getBorderedFigure().getBorderItemContainer().add(((PortEditPart) childEditPart).getFigure(), locator);
return true;
}
+
+
return false;
}
@@ -219,16 +231,16 @@ public class ExecutionEnvironmentCompositeEditPartCN extends RoundedCompartmentE
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ExecutionEnvironmentCompositeNameEditPartCN) {
+ if (childEditPart instanceof ExecutionEnvironmentCompositeNameEditPartCN) {
return true;
}
- if(childEditPart instanceof ExecutionEnvironmentCompositeCompartmentEditPartCN) {
+ if (childEditPart instanceof ExecutionEnvironmentCompositeCompartmentEditPartCN) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- pane.remove(((ExecutionEnvironmentCompositeCompartmentEditPartCN)childEditPart).getFigure());
+ pane.remove(((ExecutionEnvironmentCompositeCompartmentEditPartCN) childEditPart).getFigure());
return true;
}
- if(childEditPart instanceof PortEditPart) {
- getBorderedFigure().getBorderItemContainer().remove(((PortEditPart)childEditPart).getFigure());
+ if (childEditPart instanceof PortEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((PortEditPart) childEditPart).getFigure());
return true;
}
return false;
@@ -238,7 +250,7 @@ public class ExecutionEnvironmentCompositeEditPartCN extends RoundedCompartmentE
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -248,7 +260,7 @@ public class ExecutionEnvironmentCompositeEditPartCN extends RoundedCompartmentE
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -258,10 +270,10 @@ public class ExecutionEnvironmentCompositeEditPartCN extends RoundedCompartmentE
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof ExecutionEnvironmentCompositeCompartmentEditPartCN) {
+ if (editPart instanceof ExecutionEnvironmentCompositeCompartmentEditPartCN) {
return getPrimaryShape().getCompositeCompartmentFigure();
}
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -271,7 +283,7 @@ public class ExecutionEnvironmentCompositeEditPartCN extends RoundedCompartmentE
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof ExecutionEnvironmentCompositeFloatingLabelEditPartCN) {
+ if (borderItemEditPart instanceof ExecutionEnvironmentCompositeFloatingLabelEditPartCN) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -294,16 +306,19 @@ public class ExecutionEnvironmentCompositeEditPartCN extends RoundedCompartmentE
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -315,7 +330,7 @@ public class ExecutionEnvironmentCompositeEditPartCN extends RoundedCompartmentE
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -325,7 +340,7 @@ public class ExecutionEnvironmentCompositeEditPartCN extends RoundedCompartmentE
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -341,8 +356,8 @@ public class ExecutionEnvironmentCompositeEditPartCN extends RoundedCompartmentE
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExecutionEnvironmentCompositeFloatingLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExecutionEnvironmentCompositeFloatingLabelEditPart.java
index a70a5b82dd7..965b7271ea2 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExecutionEnvironmentCompositeFloatingLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExecutionEnvironmentCompositeFloatingLabelEditPart.java
@@ -113,15 +113,18 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPart extends Floating
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPart extends Floating
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPart extends Floating
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPart extends Floating
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPart extends Floating
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPart extends Floating
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPart extends Floating
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPart extends Floating
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPart extends Floating
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPart extends Floating
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPart extends Floating
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPart extends Floating
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPart extends Floating
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPart extends Floating
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.ExecutionEnvironment_2071, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.ExecutionEnvironmentCompositeFloatingLabelEditPart.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPart extends Floating
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPart extends Floating
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPart extends Floating
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPart extends Floating
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPart extends Floating
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPart extends Floating
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPart extends Floating
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPart extends Floating
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPart extends Floating
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPart extends Floating
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPart extends Floating
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPart extends Floating
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPart extends Floating
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPart extends Floating
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPart extends Floating
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPart extends Floating
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPart extends Floating
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPart extends Floating
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExecutionEnvironmentCompositeFloatingLabelEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExecutionEnvironmentCompositeFloatingLabelEditPartCN.java
index cd3570904dc..1c69fdd1bfc 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExecutionEnvironmentCompositeFloatingLabelEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExecutionEnvironmentCompositeFloatingLabelEditPartCN.java
@@ -113,15 +113,18 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPartCN extends Floati
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPartCN extends Floati
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPartCN extends Floati
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPartCN extends Floati
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPartCN extends Floati
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPartCN extends Floati
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPartCN extends Floati
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPartCN extends Floati
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPartCN extends Floati
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPartCN extends Floati
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPartCN extends Floati
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPartCN extends Floati
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPartCN extends Floati
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPartCN extends Floati
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.ExecutionEnvironment_3083, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.ExecutionEnvironmentCompositeFloatingLabelEditPartCN.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPartCN extends Floati
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPartCN extends Floati
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPartCN extends Floati
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPartCN extends Floati
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPartCN extends Floati
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPartCN extends Floati
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPartCN extends Floati
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPartCN extends Floati
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPartCN extends Floati
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPartCN extends Floati
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPartCN extends Floati
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPartCN extends Floati
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPartCN extends Floati
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPartCN extends Floati
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPartCN extends Floati
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPartCN extends Floati
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPartCN extends Floati
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class ExecutionEnvironmentCompositeFloatingLabelEditPartCN extends Floati
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExecutionEnvironmentCompositeNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExecutionEnvironmentCompositeNameEditPart.java
index fd391c710d5..f26eecdcf55 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExecutionEnvironmentCompositeNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExecutionEnvironmentCompositeNameEditPart.java
@@ -114,12 +114,14 @@ public class ExecutionEnvironmentCompositeNameEditPart extends PapyrusCompartmen
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class ExecutionEnvironmentCompositeNameEditPart extends PapyrusCompartmen
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class ExecutionEnvironmentCompositeNameEditPart extends PapyrusCompartmen
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class ExecutionEnvironmentCompositeNameEditPart extends PapyrusCompartmen
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class ExecutionEnvironmentCompositeNameEditPart extends PapyrusCompartmen
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class ExecutionEnvironmentCompositeNameEditPart extends PapyrusCompartmen
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class ExecutionEnvironmentCompositeNameEditPart extends PapyrusCompartmen
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class ExecutionEnvironmentCompositeNameEditPart extends PapyrusCompartmen
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class ExecutionEnvironmentCompositeNameEditPart extends PapyrusCompartmen
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class ExecutionEnvironmentCompositeNameEditPart extends PapyrusCompartmen
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class ExecutionEnvironmentCompositeNameEditPart extends PapyrusCompartmen
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class ExecutionEnvironmentCompositeNameEditPart extends PapyrusCompartmen
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class ExecutionEnvironmentCompositeNameEditPart extends PapyrusCompartmen
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.ExecutionEnvironment_2071, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.ExecutionEnvironmentCompositeNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class ExecutionEnvironmentCompositeNameEditPart extends PapyrusCompartmen
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class ExecutionEnvironmentCompositeNameEditPart extends PapyrusCompartmen
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class ExecutionEnvironmentCompositeNameEditPart extends PapyrusCompartmen
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class ExecutionEnvironmentCompositeNameEditPart extends PapyrusCompartmen
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class ExecutionEnvironmentCompositeNameEditPart extends PapyrusCompartmen
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class ExecutionEnvironmentCompositeNameEditPart extends PapyrusCompartmen
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class ExecutionEnvironmentCompositeNameEditPart extends PapyrusCompartmen
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class ExecutionEnvironmentCompositeNameEditPart extends PapyrusCompartmen
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class ExecutionEnvironmentCompositeNameEditPart extends PapyrusCompartmen
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class ExecutionEnvironmentCompositeNameEditPart extends PapyrusCompartmen
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class ExecutionEnvironmentCompositeNameEditPart extends PapyrusCompartmen
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class ExecutionEnvironmentCompositeNameEditPart extends PapyrusCompartmen
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class ExecutionEnvironmentCompositeNameEditPart extends PapyrusCompartmen
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class ExecutionEnvironmentCompositeNameEditPart extends PapyrusCompartmen
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class ExecutionEnvironmentCompositeNameEditPart extends PapyrusCompartmen
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class ExecutionEnvironmentCompositeNameEditPart extends PapyrusCompartmen
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class ExecutionEnvironmentCompositeNameEditPart extends PapyrusCompartmen
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class ExecutionEnvironmentCompositeNameEditPart extends PapyrusCompartmen
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class ExecutionEnvironmentCompositeNameEditPart extends PapyrusCompartmen
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class ExecutionEnvironmentCompositeNameEditPart extends PapyrusCompartmen
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class ExecutionEnvironmentCompositeNameEditPart extends PapyrusCompartmen
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExecutionEnvironmentCompositeNameEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExecutionEnvironmentCompositeNameEditPartCN.java
index 11a20704afa..bde249ae787 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExecutionEnvironmentCompositeNameEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExecutionEnvironmentCompositeNameEditPartCN.java
@@ -114,12 +114,14 @@ public class ExecutionEnvironmentCompositeNameEditPartCN extends PapyrusCompartm
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class ExecutionEnvironmentCompositeNameEditPartCN extends PapyrusCompartm
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class ExecutionEnvironmentCompositeNameEditPartCN extends PapyrusCompartm
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class ExecutionEnvironmentCompositeNameEditPartCN extends PapyrusCompartm
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class ExecutionEnvironmentCompositeNameEditPartCN extends PapyrusCompartm
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class ExecutionEnvironmentCompositeNameEditPartCN extends PapyrusCompartm
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class ExecutionEnvironmentCompositeNameEditPartCN extends PapyrusCompartm
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class ExecutionEnvironmentCompositeNameEditPartCN extends PapyrusCompartm
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class ExecutionEnvironmentCompositeNameEditPartCN extends PapyrusCompartm
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class ExecutionEnvironmentCompositeNameEditPartCN extends PapyrusCompartm
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class ExecutionEnvironmentCompositeNameEditPartCN extends PapyrusCompartm
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class ExecutionEnvironmentCompositeNameEditPartCN extends PapyrusCompartm
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class ExecutionEnvironmentCompositeNameEditPartCN extends PapyrusCompartm
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.ExecutionEnvironment_3083, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.ExecutionEnvironmentCompositeNameEditPartCN.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class ExecutionEnvironmentCompositeNameEditPartCN extends PapyrusCompartm
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class ExecutionEnvironmentCompositeNameEditPartCN extends PapyrusCompartm
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class ExecutionEnvironmentCompositeNameEditPartCN extends PapyrusCompartm
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class ExecutionEnvironmentCompositeNameEditPartCN extends PapyrusCompartm
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class ExecutionEnvironmentCompositeNameEditPartCN extends PapyrusCompartm
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class ExecutionEnvironmentCompositeNameEditPartCN extends PapyrusCompartm
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class ExecutionEnvironmentCompositeNameEditPartCN extends PapyrusCompartm
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class ExecutionEnvironmentCompositeNameEditPartCN extends PapyrusCompartm
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class ExecutionEnvironmentCompositeNameEditPartCN extends PapyrusCompartm
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class ExecutionEnvironmentCompositeNameEditPartCN extends PapyrusCompartm
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class ExecutionEnvironmentCompositeNameEditPartCN extends PapyrusCompartm
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class ExecutionEnvironmentCompositeNameEditPartCN extends PapyrusCompartm
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class ExecutionEnvironmentCompositeNameEditPartCN extends PapyrusCompartm
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class ExecutionEnvironmentCompositeNameEditPartCN extends PapyrusCompartm
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class ExecutionEnvironmentCompositeNameEditPartCN extends PapyrusCompartm
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class ExecutionEnvironmentCompositeNameEditPartCN extends PapyrusCompartm
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class ExecutionEnvironmentCompositeNameEditPartCN extends PapyrusCompartm
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class ExecutionEnvironmentCompositeNameEditPartCN extends PapyrusCompartm
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class ExecutionEnvironmentCompositeNameEditPartCN extends PapyrusCompartm
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class ExecutionEnvironmentCompositeNameEditPartCN extends PapyrusCompartm
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class ExecutionEnvironmentCompositeNameEditPartCN extends PapyrusCompartm
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExpressionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExpressionEditPart.java
index 12c6aa80811..35ad1ebcab0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExpressionEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExpressionEditPart.java
@@ -84,7 +84,9 @@ public class ExpressionEditPart extends RoundedCompartmentEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
@@ -101,21 +103,21 @@ public class ExpressionEditPart extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case ExpressionFloatingLabelEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -135,8 +137,9 @@ public class ExpressionEditPart extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -154,6 +157,7 @@ public class ExpressionEditPart extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -165,20 +169,23 @@ public class ExpressionEditPart extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure
+ *
* @generated
*/
public RoundedCompartmentFigure getPrimaryShape() {
- return (RoundedCompartmentFigure)primaryShape;
+ return (RoundedCompartmentFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ExpressionNameEditPart) {
- ((ExpressionNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof ExpressionNameEditPart) {
+ ((ExpressionNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
+
+
return false;
}
@@ -186,7 +193,7 @@ public class ExpressionEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ExpressionNameEditPart) {
+ if (childEditPart instanceof ExpressionNameEditPart) {
return true;
}
return false;
@@ -196,7 +203,7 @@ public class ExpressionEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -206,7 +213,7 @@ public class ExpressionEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -216,7 +223,7 @@ public class ExpressionEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -226,7 +233,7 @@ public class ExpressionEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof ExpressionFloatingLabelEditPart) {
+ if (borderItemEditPart instanceof ExpressionFloatingLabelEditPart) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -249,16 +256,19 @@ public class ExpressionEditPart extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -270,7 +280,7 @@ public class ExpressionEditPart extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -280,7 +290,7 @@ public class ExpressionEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -296,8 +306,8 @@ public class ExpressionEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExpressionFloatingLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExpressionFloatingLabelEditPart.java
index f8bc91ccffc..b9c0354831b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExpressionFloatingLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExpressionFloatingLabelEditPart.java
@@ -113,15 +113,18 @@ public class ExpressionFloatingLabelEditPart extends FloatingLabelEditPart imple
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class ExpressionFloatingLabelEditPart extends FloatingLabelEditPart imple
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class ExpressionFloatingLabelEditPart extends FloatingLabelEditPart imple
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class ExpressionFloatingLabelEditPart extends FloatingLabelEditPart imple
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class ExpressionFloatingLabelEditPart extends FloatingLabelEditPart imple
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class ExpressionFloatingLabelEditPart extends FloatingLabelEditPart imple
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class ExpressionFloatingLabelEditPart extends FloatingLabelEditPart imple
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class ExpressionFloatingLabelEditPart extends FloatingLabelEditPart imple
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class ExpressionFloatingLabelEditPart extends FloatingLabelEditPart imple
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class ExpressionFloatingLabelEditPart extends FloatingLabelEditPart imple
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class ExpressionFloatingLabelEditPart extends FloatingLabelEditPart imple
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class ExpressionFloatingLabelEditPart extends FloatingLabelEditPart imple
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class ExpressionFloatingLabelEditPart extends FloatingLabelEditPart imple
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class ExpressionFloatingLabelEditPart extends FloatingLabelEditPart imple
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Expression_2103, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.ExpressionFloatingLabelEditPart.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class ExpressionFloatingLabelEditPart extends FloatingLabelEditPart imple
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class ExpressionFloatingLabelEditPart extends FloatingLabelEditPart imple
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class ExpressionFloatingLabelEditPart extends FloatingLabelEditPart imple
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class ExpressionFloatingLabelEditPart extends FloatingLabelEditPart imple
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class ExpressionFloatingLabelEditPart extends FloatingLabelEditPart imple
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class ExpressionFloatingLabelEditPart extends FloatingLabelEditPart imple
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class ExpressionFloatingLabelEditPart extends FloatingLabelEditPart imple
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class ExpressionFloatingLabelEditPart extends FloatingLabelEditPart imple
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class ExpressionFloatingLabelEditPart extends FloatingLabelEditPart imple
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class ExpressionFloatingLabelEditPart extends FloatingLabelEditPart imple
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class ExpressionFloatingLabelEditPart extends FloatingLabelEditPart imple
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class ExpressionFloatingLabelEditPart extends FloatingLabelEditPart imple
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class ExpressionFloatingLabelEditPart extends FloatingLabelEditPart imple
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class ExpressionFloatingLabelEditPart extends FloatingLabelEditPart imple
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class ExpressionFloatingLabelEditPart extends FloatingLabelEditPart imple
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class ExpressionFloatingLabelEditPart extends FloatingLabelEditPart imple
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class ExpressionFloatingLabelEditPart extends FloatingLabelEditPart imple
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class ExpressionFloatingLabelEditPart extends FloatingLabelEditPart imple
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExpressionNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExpressionNameEditPart.java
index 8071116eed2..4eb13cabe16 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExpressionNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ExpressionNameEditPart.java
@@ -114,12 +114,14 @@ public class ExpressionNameEditPart extends PapyrusCompartmentEditPart implement
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class ExpressionNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class ExpressionNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class ExpressionNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class ExpressionNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class ExpressionNameEditPart extends PapyrusCompartmentEditPart implement
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class ExpressionNameEditPart extends PapyrusCompartmentEditPart implement
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class ExpressionNameEditPart extends PapyrusCompartmentEditPart implement
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class ExpressionNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class ExpressionNameEditPart extends PapyrusCompartmentEditPart implement
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class ExpressionNameEditPart extends PapyrusCompartmentEditPart implement
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class ExpressionNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class ExpressionNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Expression_2103, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.ExpressionNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class ExpressionNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class ExpressionNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class ExpressionNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class ExpressionNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class ExpressionNameEditPart extends PapyrusCompartmentEditPart implement
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class ExpressionNameEditPart extends PapyrusCompartmentEditPart implement
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class ExpressionNameEditPart extends PapyrusCompartmentEditPart implement
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class ExpressionNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class ExpressionNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class ExpressionNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class ExpressionNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class ExpressionNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class ExpressionNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class ExpressionNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class ExpressionNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class ExpressionNameEditPart extends PapyrusCompartmentEditPart implement
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class ExpressionNameEditPart extends PapyrusCompartmentEditPart implement
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class ExpressionNameEditPart extends PapyrusCompartmentEditPart implement
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class ExpressionNameEditPart extends PapyrusCompartmentEditPart implement
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class ExpressionNameEditPart extends PapyrusCompartmentEditPart implement
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class ExpressionNameEditPart extends PapyrusCompartmentEditPart implement
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/FunctionBehaviorCompositeCompartmentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/FunctionBehaviorCompositeCompartmentEditPart.java
index 26289d961eb..634c4ad9a05 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/FunctionBehaviorCompositeCompartmentEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/FunctionBehaviorCompositeCompartmentEditPart.java
@@ -81,7 +81,7 @@ public class FunctionBehaviorCompositeCompartmentEditPart extends LinkLFShapeCom
* @generated
*/
protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
+ if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
super.setRatio(ratio);
}
}
@@ -90,6 +90,7 @@ public class FunctionBehaviorCompositeCompartmentEditPart extends LinkLFShapeCom
* @generated
*/
public EditPart getTargetEditPart(Request request) {
+
return super.getTargetEditPart(request);
}
@@ -98,7 +99,10 @@ public class FunctionBehaviorCompositeCompartmentEditPart extends LinkLFShapeCom
*/
protected void handleNotificationEvent(Notification notification) {
Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
+ if (NotationPackage.eINSTANCE.getSize_Width().equals(feature)
+ || NotationPackage.eINSTANCE.getSize_Height().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_X().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
refreshBounds();
}
super.handleNotificationEvent(notification);
@@ -108,13 +112,16 @@ public class FunctionBehaviorCompositeCompartmentEditPart extends LinkLFShapeCom
* @generated
*/
protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
+ ((GraphicalEditPart) getParent()).setLayoutConstraint(
+ this,
+ getFigure(),
+ new Rectangle(loc, size));
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/FunctionBehaviorCompositeCompartmentEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/FunctionBehaviorCompositeCompartmentEditPartCN.java
index b986e8911b3..f7e03a41508 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/FunctionBehaviorCompositeCompartmentEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/FunctionBehaviorCompositeCompartmentEditPartCN.java
@@ -81,7 +81,7 @@ public class FunctionBehaviorCompositeCompartmentEditPartCN extends LinkLFShapeC
* @generated
*/
protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
+ if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
super.setRatio(ratio);
}
}
@@ -90,6 +90,7 @@ public class FunctionBehaviorCompositeCompartmentEditPartCN extends LinkLFShapeC
* @generated
*/
public EditPart getTargetEditPart(Request request) {
+
return super.getTargetEditPart(request);
}
@@ -98,7 +99,10 @@ public class FunctionBehaviorCompositeCompartmentEditPartCN extends LinkLFShapeC
*/
protected void handleNotificationEvent(Notification notification) {
Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
+ if (NotationPackage.eINSTANCE.getSize_Width().equals(feature)
+ || NotationPackage.eINSTANCE.getSize_Height().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_X().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
refreshBounds();
}
super.handleNotificationEvent(notification);
@@ -108,13 +112,16 @@ public class FunctionBehaviorCompositeCompartmentEditPartCN extends LinkLFShapeC
* @generated
*/
protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
+ ((GraphicalEditPart) getParent()).setLayoutConstraint(
+ this,
+ getFigure(),
+ new Rectangle(loc, size));
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/FunctionBehaviorCompositeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/FunctionBehaviorCompositeEditPart.java
index 0f49c37c040..159664117c9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/FunctionBehaviorCompositeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/FunctionBehaviorCompositeEditPart.java
@@ -96,7 +96,9 @@ public class FunctionBehaviorCompositeEditPart extends RoundedCompartmentEditPar
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new DefaultCreationEditPolicy());
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
@@ -120,14 +122,14 @@ public class FunctionBehaviorCompositeEditPart extends RoundedCompartmentEditPar
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case FunctionBehaviorCompositeFloatingLabelEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
@@ -137,7 +139,7 @@ public class FunctionBehaviorCompositeEditPart extends RoundedCompartmentEditPar
return new BorderItemResizableEditPolicy();
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -157,8 +159,9 @@ public class FunctionBehaviorCompositeEditPart extends RoundedCompartmentEditPar
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -176,6 +179,7 @@ public class FunctionBehaviorCompositeEditPart extends RoundedCompartmentEditPar
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -187,38 +191,50 @@ public class FunctionBehaviorCompositeEditPart extends RoundedCompartmentEditPar
/**
* org.eclipse.papyrus.uml.diagram.composite.custom.figures.FunctionBehaviorCompositeFigure
+ *
* @generated
*/
public FunctionBehaviorCompositeFigure getPrimaryShape() {
- return (FunctionBehaviorCompositeFigure)primaryShape;
+ return (FunctionBehaviorCompositeFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof FunctionBehaviorCompositeNameEditPart) {
- ((FunctionBehaviorCompositeNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof FunctionBehaviorCompositeNameEditPart) {
+ ((FunctionBehaviorCompositeNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
- if(childEditPart instanceof FunctionBehaviorCompositeCompartmentEditPart) {
+
+
+ if (childEditPart instanceof FunctionBehaviorCompositeCompartmentEditPart) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((FunctionBehaviorCompositeCompartmentEditPart)childEditPart).getFigure());
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.add(((FunctionBehaviorCompositeCompartmentEditPart) childEditPart).getFigure());
return true;
}
- //Papyrus Gencode :Affixed Port locator
- if(childEditPart instanceof PortEditPart) {
+
+
+
+ // Papyrus Gencode :Affixed Port locator
+ if (childEditPart instanceof PortEditPart) {
IBorderItemLocator locator = new PortPositionLocator(getMainFigure(), PositionConstants.NONE);
- getBorderedFigure().getBorderItemContainer().add(((PortEditPart)childEditPart).getFigure(), locator);
+ getBorderedFigure().getBorderItemContainer().add(((PortEditPart) childEditPart).getFigure(), locator);
return true;
}
- //Papyrus Gencode :Affixed Port locator
- if(childEditPart instanceof ParameterEditPart) {
+
+
+
+
+ // Papyrus Gencode :Affixed Port locator
+ if (childEditPart instanceof ParameterEditPart) {
IBorderItemLocator locator = new PortPositionLocator(getMainFigure(), PositionConstants.NONE);
- getBorderedFigure().getBorderItemContainer().add(((ParameterEditPart)childEditPart).getFigure(), locator);
+ getBorderedFigure().getBorderItemContainer().add(((ParameterEditPart) childEditPart).getFigure(), locator);
return true;
}
+
+
return false;
}
@@ -226,20 +242,20 @@ public class FunctionBehaviorCompositeEditPart extends RoundedCompartmentEditPar
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof FunctionBehaviorCompositeNameEditPart) {
+ if (childEditPart instanceof FunctionBehaviorCompositeNameEditPart) {
return true;
}
- if(childEditPart instanceof FunctionBehaviorCompositeCompartmentEditPart) {
+ if (childEditPart instanceof FunctionBehaviorCompositeCompartmentEditPart) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- pane.remove(((FunctionBehaviorCompositeCompartmentEditPart)childEditPart).getFigure());
+ pane.remove(((FunctionBehaviorCompositeCompartmentEditPart) childEditPart).getFigure());
return true;
}
- if(childEditPart instanceof PortEditPart) {
- getBorderedFigure().getBorderItemContainer().remove(((PortEditPart)childEditPart).getFigure());
+ if (childEditPart instanceof PortEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((PortEditPart) childEditPart).getFigure());
return true;
}
- if(childEditPart instanceof ParameterEditPart) {
- getBorderedFigure().getBorderItemContainer().remove(((ParameterEditPart)childEditPart).getFigure());
+ if (childEditPart instanceof ParameterEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((ParameterEditPart) childEditPart).getFigure());
return true;
}
return false;
@@ -249,7 +265,7 @@ public class FunctionBehaviorCompositeEditPart extends RoundedCompartmentEditPar
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -259,7 +275,7 @@ public class FunctionBehaviorCompositeEditPart extends RoundedCompartmentEditPar
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -269,10 +285,10 @@ public class FunctionBehaviorCompositeEditPart extends RoundedCompartmentEditPar
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof FunctionBehaviorCompositeCompartmentEditPart) {
+ if (editPart instanceof FunctionBehaviorCompositeCompartmentEditPart) {
return getPrimaryShape().getCompositeCompartmentFigure();
}
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -282,7 +298,7 @@ public class FunctionBehaviorCompositeEditPart extends RoundedCompartmentEditPar
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof FunctionBehaviorCompositeFloatingLabelEditPart) {
+ if (borderItemEditPart instanceof FunctionBehaviorCompositeFloatingLabelEditPart) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -305,16 +321,19 @@ public class FunctionBehaviorCompositeEditPart extends RoundedCompartmentEditPar
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -326,7 +345,7 @@ public class FunctionBehaviorCompositeEditPart extends RoundedCompartmentEditPar
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -336,7 +355,7 @@ public class FunctionBehaviorCompositeEditPart extends RoundedCompartmentEditPar
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -352,8 +371,8 @@ public class FunctionBehaviorCompositeEditPart extends RoundedCompartmentEditPar
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/FunctionBehaviorCompositeEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/FunctionBehaviorCompositeEditPartCN.java
index 29aad7ce4e2..48cf13f9b02 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/FunctionBehaviorCompositeEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/FunctionBehaviorCompositeEditPartCN.java
@@ -96,7 +96,9 @@ public class FunctionBehaviorCompositeEditPartCN extends RoundedCompartmentEditP
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new DefaultCreationEditPolicy());
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
@@ -120,14 +122,14 @@ public class FunctionBehaviorCompositeEditPartCN extends RoundedCompartmentEditP
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case FunctionBehaviorCompositeFloatingLabelEditPartCN.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
@@ -137,7 +139,7 @@ public class FunctionBehaviorCompositeEditPartCN extends RoundedCompartmentEditP
return new BorderItemResizableEditPolicy();
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -157,8 +159,9 @@ public class FunctionBehaviorCompositeEditPartCN extends RoundedCompartmentEditP
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -176,6 +179,7 @@ public class FunctionBehaviorCompositeEditPartCN extends RoundedCompartmentEditP
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -187,38 +191,50 @@ public class FunctionBehaviorCompositeEditPartCN extends RoundedCompartmentEditP
/**
* org.eclipse.papyrus.uml.diagram.composite.custom.figures.FunctionBehaviorCompositeFigure
+ *
* @generated
*/
public FunctionBehaviorCompositeFigure getPrimaryShape() {
- return (FunctionBehaviorCompositeFigure)primaryShape;
+ return (FunctionBehaviorCompositeFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof FunctionBehaviorCompositeNameEditPartCN) {
- ((FunctionBehaviorCompositeNameEditPartCN)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof FunctionBehaviorCompositeNameEditPartCN) {
+ ((FunctionBehaviorCompositeNameEditPartCN) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
- if(childEditPart instanceof FunctionBehaviorCompositeCompartmentEditPartCN) {
+
+
+ if (childEditPart instanceof FunctionBehaviorCompositeCompartmentEditPartCN) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((FunctionBehaviorCompositeCompartmentEditPartCN)childEditPart).getFigure());
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.add(((FunctionBehaviorCompositeCompartmentEditPartCN) childEditPart).getFigure());
return true;
}
- //Papyrus Gencode :Affixed Port locator
- if(childEditPart instanceof PortEditPart) {
+
+
+
+ // Papyrus Gencode :Affixed Port locator
+ if (childEditPart instanceof PortEditPart) {
IBorderItemLocator locator = new PortPositionLocator(getMainFigure(), PositionConstants.NONE);
- getBorderedFigure().getBorderItemContainer().add(((PortEditPart)childEditPart).getFigure(), locator);
+ getBorderedFigure().getBorderItemContainer().add(((PortEditPart) childEditPart).getFigure(), locator);
return true;
}
- //Papyrus Gencode :Affixed Port locator
- if(childEditPart instanceof ParameterEditPart) {
+
+
+
+
+ // Papyrus Gencode :Affixed Port locator
+ if (childEditPart instanceof ParameterEditPart) {
IBorderItemLocator locator = new PortPositionLocator(getMainFigure(), PositionConstants.NONE);
- getBorderedFigure().getBorderItemContainer().add(((ParameterEditPart)childEditPart).getFigure(), locator);
+ getBorderedFigure().getBorderItemContainer().add(((ParameterEditPart) childEditPart).getFigure(), locator);
return true;
}
+
+
return false;
}
@@ -226,20 +242,20 @@ public class FunctionBehaviorCompositeEditPartCN extends RoundedCompartmentEditP
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof FunctionBehaviorCompositeNameEditPartCN) {
+ if (childEditPart instanceof FunctionBehaviorCompositeNameEditPartCN) {
return true;
}
- if(childEditPart instanceof FunctionBehaviorCompositeCompartmentEditPartCN) {
+ if (childEditPart instanceof FunctionBehaviorCompositeCompartmentEditPartCN) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- pane.remove(((FunctionBehaviorCompositeCompartmentEditPartCN)childEditPart).getFigure());
+ pane.remove(((FunctionBehaviorCompositeCompartmentEditPartCN) childEditPart).getFigure());
return true;
}
- if(childEditPart instanceof PortEditPart) {
- getBorderedFigure().getBorderItemContainer().remove(((PortEditPart)childEditPart).getFigure());
+ if (childEditPart instanceof PortEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((PortEditPart) childEditPart).getFigure());
return true;
}
- if(childEditPart instanceof ParameterEditPart) {
- getBorderedFigure().getBorderItemContainer().remove(((ParameterEditPart)childEditPart).getFigure());
+ if (childEditPart instanceof ParameterEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((ParameterEditPart) childEditPart).getFigure());
return true;
}
return false;
@@ -249,7 +265,7 @@ public class FunctionBehaviorCompositeEditPartCN extends RoundedCompartmentEditP
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -259,7 +275,7 @@ public class FunctionBehaviorCompositeEditPartCN extends RoundedCompartmentEditP
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -269,10 +285,10 @@ public class FunctionBehaviorCompositeEditPartCN extends RoundedCompartmentEditP
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof FunctionBehaviorCompositeCompartmentEditPartCN) {
+ if (editPart instanceof FunctionBehaviorCompositeCompartmentEditPartCN) {
return getPrimaryShape().getCompositeCompartmentFigure();
}
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -282,7 +298,7 @@ public class FunctionBehaviorCompositeEditPartCN extends RoundedCompartmentEditP
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof FunctionBehaviorCompositeFloatingLabelEditPartCN) {
+ if (borderItemEditPart instanceof FunctionBehaviorCompositeFloatingLabelEditPartCN) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -305,16 +321,19 @@ public class FunctionBehaviorCompositeEditPartCN extends RoundedCompartmentEditP
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -326,7 +345,7 @@ public class FunctionBehaviorCompositeEditPartCN extends RoundedCompartmentEditP
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -336,7 +355,7 @@ public class FunctionBehaviorCompositeEditPartCN extends RoundedCompartmentEditP
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -352,8 +371,8 @@ public class FunctionBehaviorCompositeEditPartCN extends RoundedCompartmentEditP
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/FunctionBehaviorCompositeFloatingLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/FunctionBehaviorCompositeFloatingLabelEditPart.java
index 9b6ab255e3e..08509814125 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/FunctionBehaviorCompositeFloatingLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/FunctionBehaviorCompositeFloatingLabelEditPart.java
@@ -113,15 +113,18 @@ public class FunctionBehaviorCompositeFloatingLabelEditPart extends FloatingLabe
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class FunctionBehaviorCompositeFloatingLabelEditPart extends FloatingLabe
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class FunctionBehaviorCompositeFloatingLabelEditPart extends FloatingLabe
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class FunctionBehaviorCompositeFloatingLabelEditPart extends FloatingLabe
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class FunctionBehaviorCompositeFloatingLabelEditPart extends FloatingLabe
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class FunctionBehaviorCompositeFloatingLabelEditPart extends FloatingLabe
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class FunctionBehaviorCompositeFloatingLabelEditPart extends FloatingLabe
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class FunctionBehaviorCompositeFloatingLabelEditPart extends FloatingLabe
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class FunctionBehaviorCompositeFloatingLabelEditPart extends FloatingLabe
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class FunctionBehaviorCompositeFloatingLabelEditPart extends FloatingLabe
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class FunctionBehaviorCompositeFloatingLabelEditPart extends FloatingLabe
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class FunctionBehaviorCompositeFloatingLabelEditPart extends FloatingLabe
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class FunctionBehaviorCompositeFloatingLabelEditPart extends FloatingLabe
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class FunctionBehaviorCompositeFloatingLabelEditPart extends FloatingLabe
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.FunctionBehavior_2064, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.FunctionBehaviorCompositeFloatingLabelEditPart.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class FunctionBehaviorCompositeFloatingLabelEditPart extends FloatingLabe
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class FunctionBehaviorCompositeFloatingLabelEditPart extends FloatingLabe
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class FunctionBehaviorCompositeFloatingLabelEditPart extends FloatingLabe
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class FunctionBehaviorCompositeFloatingLabelEditPart extends FloatingLabe
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class FunctionBehaviorCompositeFloatingLabelEditPart extends FloatingLabe
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class FunctionBehaviorCompositeFloatingLabelEditPart extends FloatingLabe
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class FunctionBehaviorCompositeFloatingLabelEditPart extends FloatingLabe
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class FunctionBehaviorCompositeFloatingLabelEditPart extends FloatingLabe
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class FunctionBehaviorCompositeFloatingLabelEditPart extends FloatingLabe
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class FunctionBehaviorCompositeFloatingLabelEditPart extends FloatingLabe
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class FunctionBehaviorCompositeFloatingLabelEditPart extends FloatingLabe
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class FunctionBehaviorCompositeFloatingLabelEditPart extends FloatingLabe
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class FunctionBehaviorCompositeFloatingLabelEditPart extends FloatingLabe
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class FunctionBehaviorCompositeFloatingLabelEditPart extends FloatingLabe
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class FunctionBehaviorCompositeFloatingLabelEditPart extends FloatingLabe
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class FunctionBehaviorCompositeFloatingLabelEditPart extends FloatingLabe
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class FunctionBehaviorCompositeFloatingLabelEditPart extends FloatingLabe
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class FunctionBehaviorCompositeFloatingLabelEditPart extends FloatingLabe
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/FunctionBehaviorCompositeFloatingLabelEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/FunctionBehaviorCompositeFloatingLabelEditPartCN.java
index 8ca943af557..6b8723a6229 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/FunctionBehaviorCompositeFloatingLabelEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/FunctionBehaviorCompositeFloatingLabelEditPartCN.java
@@ -113,15 +113,18 @@ public class FunctionBehaviorCompositeFloatingLabelEditPartCN extends FloatingLa
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class FunctionBehaviorCompositeFloatingLabelEditPartCN extends FloatingLa
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class FunctionBehaviorCompositeFloatingLabelEditPartCN extends FloatingLa
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class FunctionBehaviorCompositeFloatingLabelEditPartCN extends FloatingLa
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class FunctionBehaviorCompositeFloatingLabelEditPartCN extends FloatingLa
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class FunctionBehaviorCompositeFloatingLabelEditPartCN extends FloatingLa
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class FunctionBehaviorCompositeFloatingLabelEditPartCN extends FloatingLa
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class FunctionBehaviorCompositeFloatingLabelEditPartCN extends FloatingLa
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class FunctionBehaviorCompositeFloatingLabelEditPartCN extends FloatingLa
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class FunctionBehaviorCompositeFloatingLabelEditPartCN extends FloatingLa
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class FunctionBehaviorCompositeFloatingLabelEditPartCN extends FloatingLa
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class FunctionBehaviorCompositeFloatingLabelEditPartCN extends FloatingLa
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class FunctionBehaviorCompositeFloatingLabelEditPartCN extends FloatingLa
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class FunctionBehaviorCompositeFloatingLabelEditPartCN extends FloatingLa
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.FunctionBehavior_3076, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.FunctionBehaviorCompositeFloatingLabelEditPartCN.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class FunctionBehaviorCompositeFloatingLabelEditPartCN extends FloatingLa
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class FunctionBehaviorCompositeFloatingLabelEditPartCN extends FloatingLa
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class FunctionBehaviorCompositeFloatingLabelEditPartCN extends FloatingLa
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class FunctionBehaviorCompositeFloatingLabelEditPartCN extends FloatingLa
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class FunctionBehaviorCompositeFloatingLabelEditPartCN extends FloatingLa
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class FunctionBehaviorCompositeFloatingLabelEditPartCN extends FloatingLa
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class FunctionBehaviorCompositeFloatingLabelEditPartCN extends FloatingLa
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class FunctionBehaviorCompositeFloatingLabelEditPartCN extends FloatingLa
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class FunctionBehaviorCompositeFloatingLabelEditPartCN extends FloatingLa
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class FunctionBehaviorCompositeFloatingLabelEditPartCN extends FloatingLa
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class FunctionBehaviorCompositeFloatingLabelEditPartCN extends FloatingLa
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class FunctionBehaviorCompositeFloatingLabelEditPartCN extends FloatingLa
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class FunctionBehaviorCompositeFloatingLabelEditPartCN extends FloatingLa
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class FunctionBehaviorCompositeFloatingLabelEditPartCN extends FloatingLa
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class FunctionBehaviorCompositeFloatingLabelEditPartCN extends FloatingLa
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class FunctionBehaviorCompositeFloatingLabelEditPartCN extends FloatingLa
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class FunctionBehaviorCompositeFloatingLabelEditPartCN extends FloatingLa
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class FunctionBehaviorCompositeFloatingLabelEditPartCN extends FloatingLa
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/FunctionBehaviorCompositeNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/FunctionBehaviorCompositeNameEditPart.java
index fa5c1a50102..4bf0a88aefa 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/FunctionBehaviorCompositeNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/FunctionBehaviorCompositeNameEditPart.java
@@ -114,12 +114,14 @@ public class FunctionBehaviorCompositeNameEditPart extends PapyrusCompartmentEdi
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class FunctionBehaviorCompositeNameEditPart extends PapyrusCompartmentEdi
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class FunctionBehaviorCompositeNameEditPart extends PapyrusCompartmentEdi
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class FunctionBehaviorCompositeNameEditPart extends PapyrusCompartmentEdi
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class FunctionBehaviorCompositeNameEditPart extends PapyrusCompartmentEdi
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class FunctionBehaviorCompositeNameEditPart extends PapyrusCompartmentEdi
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class FunctionBehaviorCompositeNameEditPart extends PapyrusCompartmentEdi
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class FunctionBehaviorCompositeNameEditPart extends PapyrusCompartmentEdi
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class FunctionBehaviorCompositeNameEditPart extends PapyrusCompartmentEdi
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class FunctionBehaviorCompositeNameEditPart extends PapyrusCompartmentEdi
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class FunctionBehaviorCompositeNameEditPart extends PapyrusCompartmentEdi
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class FunctionBehaviorCompositeNameEditPart extends PapyrusCompartmentEdi
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class FunctionBehaviorCompositeNameEditPart extends PapyrusCompartmentEdi
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.FunctionBehavior_2064, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.FunctionBehaviorCompositeNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class FunctionBehaviorCompositeNameEditPart extends PapyrusCompartmentEdi
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class FunctionBehaviorCompositeNameEditPart extends PapyrusCompartmentEdi
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class FunctionBehaviorCompositeNameEditPart extends PapyrusCompartmentEdi
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class FunctionBehaviorCompositeNameEditPart extends PapyrusCompartmentEdi
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class FunctionBehaviorCompositeNameEditPart extends PapyrusCompartmentEdi
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class FunctionBehaviorCompositeNameEditPart extends PapyrusCompartmentEdi
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class FunctionBehaviorCompositeNameEditPart extends PapyrusCompartmentEdi
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class FunctionBehaviorCompositeNameEditPart extends PapyrusCompartmentEdi
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class FunctionBehaviorCompositeNameEditPart extends PapyrusCompartmentEdi
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class FunctionBehaviorCompositeNameEditPart extends PapyrusCompartmentEdi
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class FunctionBehaviorCompositeNameEditPart extends PapyrusCompartmentEdi
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class FunctionBehaviorCompositeNameEditPart extends PapyrusCompartmentEdi
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class FunctionBehaviorCompositeNameEditPart extends PapyrusCompartmentEdi
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class FunctionBehaviorCompositeNameEditPart extends PapyrusCompartmentEdi
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class FunctionBehaviorCompositeNameEditPart extends PapyrusCompartmentEdi
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class FunctionBehaviorCompositeNameEditPart extends PapyrusCompartmentEdi
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class FunctionBehaviorCompositeNameEditPart extends PapyrusCompartmentEdi
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class FunctionBehaviorCompositeNameEditPart extends PapyrusCompartmentEdi
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class FunctionBehaviorCompositeNameEditPart extends PapyrusCompartmentEdi
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class FunctionBehaviorCompositeNameEditPart extends PapyrusCompartmentEdi
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class FunctionBehaviorCompositeNameEditPart extends PapyrusCompartmentEdi
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/FunctionBehaviorCompositeNameEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/FunctionBehaviorCompositeNameEditPartCN.java
index 136fce6bc5c..480402188ec 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/FunctionBehaviorCompositeNameEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/FunctionBehaviorCompositeNameEditPartCN.java
@@ -114,12 +114,14 @@ public class FunctionBehaviorCompositeNameEditPartCN extends PapyrusCompartmentE
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class FunctionBehaviorCompositeNameEditPartCN extends PapyrusCompartmentE
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class FunctionBehaviorCompositeNameEditPartCN extends PapyrusCompartmentE
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class FunctionBehaviorCompositeNameEditPartCN extends PapyrusCompartmentE
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class FunctionBehaviorCompositeNameEditPartCN extends PapyrusCompartmentE
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class FunctionBehaviorCompositeNameEditPartCN extends PapyrusCompartmentE
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class FunctionBehaviorCompositeNameEditPartCN extends PapyrusCompartmentE
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class FunctionBehaviorCompositeNameEditPartCN extends PapyrusCompartmentE
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class FunctionBehaviorCompositeNameEditPartCN extends PapyrusCompartmentE
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class FunctionBehaviorCompositeNameEditPartCN extends PapyrusCompartmentE
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class FunctionBehaviorCompositeNameEditPartCN extends PapyrusCompartmentE
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class FunctionBehaviorCompositeNameEditPartCN extends PapyrusCompartmentE
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class FunctionBehaviorCompositeNameEditPartCN extends PapyrusCompartmentE
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.FunctionBehavior_3076, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.FunctionBehaviorCompositeNameEditPartCN.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class FunctionBehaviorCompositeNameEditPartCN extends PapyrusCompartmentE
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class FunctionBehaviorCompositeNameEditPartCN extends PapyrusCompartmentE
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class FunctionBehaviorCompositeNameEditPartCN extends PapyrusCompartmentE
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class FunctionBehaviorCompositeNameEditPartCN extends PapyrusCompartmentE
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class FunctionBehaviorCompositeNameEditPartCN extends PapyrusCompartmentE
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class FunctionBehaviorCompositeNameEditPartCN extends PapyrusCompartmentE
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class FunctionBehaviorCompositeNameEditPartCN extends PapyrusCompartmentE
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class FunctionBehaviorCompositeNameEditPartCN extends PapyrusCompartmentE
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class FunctionBehaviorCompositeNameEditPartCN extends PapyrusCompartmentE
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class FunctionBehaviorCompositeNameEditPartCN extends PapyrusCompartmentE
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class FunctionBehaviorCompositeNameEditPartCN extends PapyrusCompartmentE
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class FunctionBehaviorCompositeNameEditPartCN extends PapyrusCompartmentE
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class FunctionBehaviorCompositeNameEditPartCN extends PapyrusCompartmentE
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class FunctionBehaviorCompositeNameEditPartCN extends PapyrusCompartmentE
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class FunctionBehaviorCompositeNameEditPartCN extends PapyrusCompartmentE
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class FunctionBehaviorCompositeNameEditPartCN extends PapyrusCompartmentE
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class FunctionBehaviorCompositeNameEditPartCN extends PapyrusCompartmentE
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class FunctionBehaviorCompositeNameEditPartCN extends PapyrusCompartmentE
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class FunctionBehaviorCompositeNameEditPartCN extends PapyrusCompartmentE
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class FunctionBehaviorCompositeNameEditPartCN extends PapyrusCompartmentE
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class FunctionBehaviorCompositeNameEditPartCN extends PapyrusCompartmentE
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/GeneralizationAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/GeneralizationAppliedStereotypeEditPart.java
index 868c2339ace..f3519300dbd 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/GeneralizationAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/GeneralizationAppliedStereotypeEditPart.java
@@ -123,6 +123,7 @@ public class GeneralizationAppliedStereotypeEditPart extends PapyrusLabelEditPar
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -211,8 +212,7 @@ public class GeneralizationAppliedStereotypeEditPart extends PapyrusLabelEditPar
/**
* @generated
*/
- public void setLabel(IFigure
- figure) {
+ public void setLabel(IFigure figure) {
unregisterVisuals();
setFigure(figure);
defaultText = getLabelTextHelper(figure);
@@ -324,15 +324,14 @@ public class GeneralizationAppliedStereotypeEditPart extends PapyrusLabelEditPar
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid =
- (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
@@ -461,8 +460,7 @@ public class GeneralizationAppliedStereotypeEditPart extends PapyrusLabelEditPar
IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- }
- else if (configuration instanceof IAdvancedEditorConfiguration) {
+ } 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);
@@ -507,8 +505,7 @@ public class GeneralizationAppliedStereotypeEditPart extends PapyrusLabelEditPar
RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- }
- else {
+ } else {
performDirectEdit();
}
}
@@ -558,17 +555,15 @@ public class GeneralizationAppliedStereotypeEditPart extends PapyrusLabelEditPar
* @generated
*/
protected void refreshUnderline() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
if (resolveSemanticElement() instanceof Feature) {
if (((Feature) resolveSemanticElement()).isStatic()) {
((WrappingLabel) getFigure()).setTextUnderline(true);
- }
- else {
+ } else {
((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
@@ -578,9 +573,8 @@ public class GeneralizationAppliedStereotypeEditPart extends PapyrusLabelEditPar
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
@@ -591,14 +585,12 @@ public class GeneralizationAppliedStereotypeEditPart extends PapyrusLabelEditPar
*/
@Override
protected void refreshFont() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ 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));
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -684,7 +676,7 @@ public class GeneralizationAppliedStereotypeEditPart extends PapyrusLabelEditPar
*/
protected boolean checkExtendedEditor() {
if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -708,9 +700,9 @@ public class GeneralizationAppliedStereotypeEditPart extends PapyrusLabelEditPar
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());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
@@ -724,8 +716,7 @@ public class GeneralizationAppliedStereotypeEditPart extends PapyrusLabelEditPar
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement()
- .eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
@@ -777,18 +768,15 @@ public class GeneralizationAppliedStereotypeEditPart extends PapyrusLabelEditPar
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)) {
+ } 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();
+ ISemanticParser modelParser = (ISemanticParser) getParser();
if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
if (resolveSemanticElement() != null) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/GeneralizationEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/GeneralizationEditPart.java
index 99ac9af0b96..f909bb5b98c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/GeneralizationEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/GeneralizationEditPart.java
@@ -51,8 +51,9 @@ public class GeneralizationEditPart extends UMLConnectionNodeEditPart implements
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof GeneralizationAppliedStereotypeEditPart) {
- ((GeneralizationAppliedStereotypeEditPart)childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
+ if (childEditPart instanceof GeneralizationAppliedStereotypeEditPart) {
+ ((GeneralizationAppliedStereotypeEditPart) childEditPart).setLabel(
+ getPrimaryShape().getAppliedStereotypeLabel());
}
return false;
}
@@ -61,7 +62,7 @@ public class GeneralizationEditPart extends UMLConnectionNodeEditPart implements
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -71,7 +72,7 @@ public class GeneralizationEditPart extends UMLConnectionNodeEditPart implements
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof GeneralizationAppliedStereotypeEditPart) {
+ if (childEditPart instanceof GeneralizationAppliedStereotypeEditPart) {
return true;
}
return false;
@@ -81,7 +82,7 @@ public class GeneralizationEditPart extends UMLConnectionNodeEditPart implements
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -103,6 +104,6 @@ public class GeneralizationEditPart extends UMLConnectionNodeEditPart implements
* @generated
*/
public GeneralizationFigure getPrimaryShape() {
- return (GeneralizationFigure)getFigure();
+ return (GeneralizationFigure) getFigure();
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationFlowAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationFlowAppliedStereotypeEditPart.java
index 419f8615ff6..1c9f0374885 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationFlowAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationFlowAppliedStereotypeEditPart.java
@@ -123,6 +123,7 @@ public class InformationFlowAppliedStereotypeEditPart extends PapyrusLabelEditPa
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -211,8 +212,7 @@ public class InformationFlowAppliedStereotypeEditPart extends PapyrusLabelEditPa
/**
* @generated
*/
- public void setLabel(IFigure
- figure) {
+ public void setLabel(IFigure figure) {
unregisterVisuals();
setFigure(figure);
defaultText = getLabelTextHelper(figure);
@@ -324,15 +324,14 @@ public class InformationFlowAppliedStereotypeEditPart extends PapyrusLabelEditPa
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid =
- (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
@@ -461,8 +460,7 @@ public class InformationFlowAppliedStereotypeEditPart extends PapyrusLabelEditPa
IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- }
- else if (configuration instanceof IAdvancedEditorConfiguration) {
+ } 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);
@@ -507,8 +505,7 @@ public class InformationFlowAppliedStereotypeEditPart extends PapyrusLabelEditPa
RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- }
- else {
+ } else {
performDirectEdit();
}
}
@@ -558,17 +555,15 @@ public class InformationFlowAppliedStereotypeEditPart extends PapyrusLabelEditPa
* @generated
*/
protected void refreshUnderline() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
if (resolveSemanticElement() instanceof Feature) {
if (((Feature) resolveSemanticElement()).isStatic()) {
((WrappingLabel) getFigure()).setTextUnderline(true);
- }
- else {
+ } else {
((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
@@ -578,9 +573,8 @@ public class InformationFlowAppliedStereotypeEditPart extends PapyrusLabelEditPa
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
@@ -591,14 +585,12 @@ public class InformationFlowAppliedStereotypeEditPart extends PapyrusLabelEditPa
*/
@Override
protected void refreshFont() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ 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));
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -684,7 +676,7 @@ public class InformationFlowAppliedStereotypeEditPart extends PapyrusLabelEditPa
*/
protected boolean checkExtendedEditor() {
if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -708,9 +700,9 @@ public class InformationFlowAppliedStereotypeEditPart extends PapyrusLabelEditPa
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());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
@@ -724,8 +716,7 @@ public class InformationFlowAppliedStereotypeEditPart extends PapyrusLabelEditPa
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement()
- .eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
@@ -777,18 +768,15 @@ public class InformationFlowAppliedStereotypeEditPart extends PapyrusLabelEditPa
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)) {
+ } 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();
+ ISemanticParser modelParser = (ISemanticParser) getParser();
if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
if (resolveSemanticElement() != null) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationFlowConveyedLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationFlowConveyedLabelEditPart.java
index 21bc79cd455..190cbcc261d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationFlowConveyedLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationFlowConveyedLabelEditPart.java
@@ -125,6 +125,7 @@ public class InformationFlowConveyedLabelEditPart extends PapyrusLabelEditPart i
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -214,8 +215,7 @@ public class InformationFlowConveyedLabelEditPart extends PapyrusLabelEditPart i
/**
* @generated
*/
- public void setLabel(IFigure
- figure) {
+ public void setLabel(IFigure figure) {
unregisterVisuals();
setFigure(figure);
defaultText = getLabelTextHelper(figure);
@@ -328,15 +328,14 @@ public class InformationFlowConveyedLabelEditPart extends PapyrusLabelEditPart i
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid =
- (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
@@ -465,8 +464,7 @@ public class InformationFlowConveyedLabelEditPart extends PapyrusLabelEditPart i
IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- }
- else if (configuration instanceof IAdvancedEditorConfiguration) {
+ } 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);
@@ -511,8 +509,7 @@ public class InformationFlowConveyedLabelEditPart extends PapyrusLabelEditPart i
RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- }
- else {
+ } else {
performDirectEdit();
}
}
@@ -562,17 +559,15 @@ public class InformationFlowConveyedLabelEditPart extends PapyrusLabelEditPart i
* @generated
*/
protected void refreshUnderline() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
if (resolveSemanticElement() instanceof Feature) {
if (((Feature) resolveSemanticElement()).isStatic()) {
((WrappingLabel) getFigure()).setTextUnderline(true);
- }
- else {
+ } else {
((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
@@ -582,9 +577,8 @@ public class InformationFlowConveyedLabelEditPart extends PapyrusLabelEditPart i
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
@@ -595,14 +589,12 @@ public class InformationFlowConveyedLabelEditPart extends PapyrusLabelEditPart i
*/
@Override
protected void refreshFont() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ 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));
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -696,7 +688,7 @@ public class InformationFlowConveyedLabelEditPart extends PapyrusLabelEditPart i
*/
protected boolean checkExtendedEditor() {
if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -720,9 +712,9 @@ public class InformationFlowConveyedLabelEditPart extends PapyrusLabelEditPart i
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());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
@@ -736,8 +728,7 @@ public class InformationFlowConveyedLabelEditPart extends PapyrusLabelEditPart i
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement()
- .eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
@@ -789,18 +780,15 @@ public class InformationFlowConveyedLabelEditPart extends PapyrusLabelEditPart i
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)) {
+ } 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();
+ ISemanticParser modelParser = (ISemanticParser) getParser();
if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
if (resolveSemanticElement() != null) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationFlowEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationFlowEditPart.java
index aedd78e214e..435560be2de 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationFlowEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationFlowEditPart.java
@@ -52,10 +52,12 @@ public class InformationFlowEditPart extends UMLConnectionNodeEditPart implement
*/
protected boolean addFixedChild(EditPart childEditPart) {
if (childEditPart instanceof InformationFlowConveyedLabelEditPart) {
- ((InformationFlowConveyedLabelEditPart) childEditPart).setLabel(getPrimaryShape().getConveyedLabel());
+ ((InformationFlowConveyedLabelEditPart) childEditPart).setLabel(
+ getPrimaryShape().getConveyedLabel());
}
if (childEditPart instanceof InformationFlowAppliedStereotypeEditPart) {
- ((InformationFlowAppliedStereotypeEditPart) childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
+ ((InformationFlowAppliedStereotypeEditPart) childEditPart).setLabel(
+ getPrimaryShape().getAppliedStereotypeLabel());
}
return false;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationItemEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationItemEditPart.java
index 146115b35f2..8d7740094ab 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationItemEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationItemEditPart.java
@@ -85,7 +85,9 @@ public class InformationItemEditPart extends RoundedCompartmentEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
@@ -103,21 +105,21 @@ public class InformationItemEditPart extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case InformationItemFloatingLabelEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -157,6 +159,7 @@ public class InformationItemEditPart extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -168,20 +171,23 @@ public class InformationItemEditPart extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.composite.custom.figures.InformationItemFigure
+ *
* @generated
*/
public InformationItemFigure getPrimaryShape() {
- return (InformationItemFigure)primaryShape;
+ return (InformationItemFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof InformationItemNameEditPart) {
- ((InformationItemNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof InformationItemNameEditPart) {
+ ((InformationItemNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
+
+
return false;
}
@@ -189,7 +195,7 @@ public class InformationItemEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof InformationItemNameEditPart) {
+ if (childEditPart instanceof InformationItemNameEditPart) {
return true;
}
return false;
@@ -199,7 +205,7 @@ public class InformationItemEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -209,7 +215,7 @@ public class InformationItemEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -219,7 +225,7 @@ public class InformationItemEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -229,7 +235,7 @@ public class InformationItemEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof InformationItemFloatingLabelEditPart) {
+ if (borderItemEditPart instanceof InformationItemFloatingLabelEditPart) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -252,16 +258,19 @@ public class InformationItemEditPart extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -273,7 +282,7 @@ public class InformationItemEditPart extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -283,7 +292,7 @@ public class InformationItemEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -299,8 +308,8 @@ public class InformationItemEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationItemEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationItemEditPartCN.java
index 91bf21fbbfe..ce9416687c2 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationItemEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationItemEditPartCN.java
@@ -85,7 +85,9 @@ public class InformationItemEditPartCN extends RoundedCompartmentEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
@@ -103,21 +105,21 @@ public class InformationItemEditPartCN extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case InformationItemFloatingLabelEditPartCN.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -137,8 +139,9 @@ public class InformationItemEditPartCN extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -156,6 +159,7 @@ public class InformationItemEditPartCN extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -167,20 +171,23 @@ public class InformationItemEditPartCN extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.composite.custom.figures.InformationItemFigure
+ *
* @generated
*/
public InformationItemFigure getPrimaryShape() {
- return (InformationItemFigure)primaryShape;
+ return (InformationItemFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof InformationItemNameEditPartCN) {
- ((InformationItemNameEditPartCN)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof InformationItemNameEditPartCN) {
+ ((InformationItemNameEditPartCN) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
+
+
return false;
}
@@ -188,7 +195,7 @@ public class InformationItemEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof InformationItemNameEditPartCN) {
+ if (childEditPart instanceof InformationItemNameEditPartCN) {
return true;
}
return false;
@@ -198,7 +205,7 @@ public class InformationItemEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -208,7 +215,7 @@ public class InformationItemEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -218,7 +225,7 @@ public class InformationItemEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -228,7 +235,7 @@ public class InformationItemEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof InformationItemFloatingLabelEditPartCN) {
+ if (borderItemEditPart instanceof InformationItemFloatingLabelEditPartCN) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -251,16 +258,19 @@ public class InformationItemEditPartCN extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -272,7 +282,7 @@ public class InformationItemEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -282,7 +292,7 @@ public class InformationItemEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -298,8 +308,8 @@ public class InformationItemEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationItemFloatingLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationItemFloatingLabelEditPart.java
index 039c5f60b38..836546e7f07 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationItemFloatingLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationItemFloatingLabelEditPart.java
@@ -113,15 +113,18 @@ public class InformationItemFloatingLabelEditPart extends FloatingLabelEditPart
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class InformationItemFloatingLabelEditPart extends FloatingLabelEditPart
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class InformationItemFloatingLabelEditPart extends FloatingLabelEditPart
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class InformationItemFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class InformationItemFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class InformationItemFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class InformationItemFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class InformationItemFloatingLabelEditPart extends FloatingLabelEditPart
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class InformationItemFloatingLabelEditPart extends FloatingLabelEditPart
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class InformationItemFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class InformationItemFloatingLabelEditPart extends FloatingLabelEditPart
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class InformationItemFloatingLabelEditPart extends FloatingLabelEditPart
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class InformationItemFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class InformationItemFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.InformationItem_2080, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.InformationItemFloatingLabelEditPart.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class InformationItemFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class InformationItemFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class InformationItemFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class InformationItemFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class InformationItemFloatingLabelEditPart extends FloatingLabelEditPart
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class InformationItemFloatingLabelEditPart extends FloatingLabelEditPart
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class InformationItemFloatingLabelEditPart extends FloatingLabelEditPart
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class InformationItemFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class InformationItemFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class InformationItemFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class InformationItemFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class InformationItemFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class InformationItemFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class InformationItemFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class InformationItemFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class InformationItemFloatingLabelEditPart extends FloatingLabelEditPart
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class InformationItemFloatingLabelEditPart extends FloatingLabelEditPart
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class InformationItemFloatingLabelEditPart extends FloatingLabelEditPart
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationItemFloatingLabelEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationItemFloatingLabelEditPartCN.java
index 512f34892cf..93bf0c778af 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationItemFloatingLabelEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationItemFloatingLabelEditPartCN.java
@@ -113,15 +113,18 @@ public class InformationItemFloatingLabelEditPartCN extends FloatingLabelEditPar
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class InformationItemFloatingLabelEditPartCN extends FloatingLabelEditPar
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class InformationItemFloatingLabelEditPartCN extends FloatingLabelEditPar
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class InformationItemFloatingLabelEditPartCN extends FloatingLabelEditPar
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class InformationItemFloatingLabelEditPartCN extends FloatingLabelEditPar
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class InformationItemFloatingLabelEditPartCN extends FloatingLabelEditPar
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class InformationItemFloatingLabelEditPartCN extends FloatingLabelEditPar
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class InformationItemFloatingLabelEditPartCN extends FloatingLabelEditPar
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class InformationItemFloatingLabelEditPartCN extends FloatingLabelEditPar
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class InformationItemFloatingLabelEditPartCN extends FloatingLabelEditPar
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class InformationItemFloatingLabelEditPartCN extends FloatingLabelEditPar
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class InformationItemFloatingLabelEditPartCN extends FloatingLabelEditPar
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class InformationItemFloatingLabelEditPartCN extends FloatingLabelEditPar
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class InformationItemFloatingLabelEditPartCN extends FloatingLabelEditPar
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.InformationItem_3094, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.InformationItemFloatingLabelEditPartCN.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class InformationItemFloatingLabelEditPartCN extends FloatingLabelEditPar
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class InformationItemFloatingLabelEditPartCN extends FloatingLabelEditPar
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class InformationItemFloatingLabelEditPartCN extends FloatingLabelEditPar
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class InformationItemFloatingLabelEditPartCN extends FloatingLabelEditPar
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class InformationItemFloatingLabelEditPartCN extends FloatingLabelEditPar
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class InformationItemFloatingLabelEditPartCN extends FloatingLabelEditPar
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class InformationItemFloatingLabelEditPartCN extends FloatingLabelEditPar
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class InformationItemFloatingLabelEditPartCN extends FloatingLabelEditPar
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class InformationItemFloatingLabelEditPartCN extends FloatingLabelEditPar
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class InformationItemFloatingLabelEditPartCN extends FloatingLabelEditPar
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class InformationItemFloatingLabelEditPartCN extends FloatingLabelEditPar
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class InformationItemFloatingLabelEditPartCN extends FloatingLabelEditPar
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class InformationItemFloatingLabelEditPartCN extends FloatingLabelEditPar
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class InformationItemFloatingLabelEditPartCN extends FloatingLabelEditPar
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class InformationItemFloatingLabelEditPartCN extends FloatingLabelEditPar
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class InformationItemFloatingLabelEditPartCN extends FloatingLabelEditPar
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class InformationItemFloatingLabelEditPartCN extends FloatingLabelEditPar
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class InformationItemFloatingLabelEditPartCN extends FloatingLabelEditPar
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationItemNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationItemNameEditPart.java
index 68563f6e4ea..5f7e0080900 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationItemNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationItemNameEditPart.java
@@ -114,12 +114,14 @@ public class InformationItemNameEditPart extends PapyrusCompartmentEditPart impl
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class InformationItemNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class InformationItemNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class InformationItemNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class InformationItemNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class InformationItemNameEditPart extends PapyrusCompartmentEditPart impl
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class InformationItemNameEditPart extends PapyrusCompartmentEditPart impl
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class InformationItemNameEditPart extends PapyrusCompartmentEditPart impl
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class InformationItemNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class InformationItemNameEditPart extends PapyrusCompartmentEditPart impl
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class InformationItemNameEditPart extends PapyrusCompartmentEditPart impl
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class InformationItemNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class InformationItemNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.InformationItem_2080, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.InformationItemNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class InformationItemNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class InformationItemNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class InformationItemNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class InformationItemNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class InformationItemNameEditPart extends PapyrusCompartmentEditPart impl
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class InformationItemNameEditPart extends PapyrusCompartmentEditPart impl
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class InformationItemNameEditPart extends PapyrusCompartmentEditPart impl
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class InformationItemNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class InformationItemNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class InformationItemNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class InformationItemNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class InformationItemNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class InformationItemNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class InformationItemNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class InformationItemNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class InformationItemNameEditPart extends PapyrusCompartmentEditPart impl
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class InformationItemNameEditPart extends PapyrusCompartmentEditPart impl
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class InformationItemNameEditPart extends PapyrusCompartmentEditPart impl
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class InformationItemNameEditPart extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class InformationItemNameEditPart extends PapyrusCompartmentEditPart impl
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class InformationItemNameEditPart extends PapyrusCompartmentEditPart impl
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationItemNameEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationItemNameEditPartCN.java
index fb30fbfc9aa..541f2c7ccdc 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationItemNameEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InformationItemNameEditPartCN.java
@@ -114,12 +114,14 @@ public class InformationItemNameEditPartCN extends PapyrusCompartmentEditPart im
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class InformationItemNameEditPartCN extends PapyrusCompartmentEditPart im
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class InformationItemNameEditPartCN extends PapyrusCompartmentEditPart im
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class InformationItemNameEditPartCN extends PapyrusCompartmentEditPart im
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class InformationItemNameEditPartCN extends PapyrusCompartmentEditPart im
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class InformationItemNameEditPartCN extends PapyrusCompartmentEditPart im
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class InformationItemNameEditPartCN extends PapyrusCompartmentEditPart im
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class InformationItemNameEditPartCN extends PapyrusCompartmentEditPart im
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class InformationItemNameEditPartCN extends PapyrusCompartmentEditPart im
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class InformationItemNameEditPartCN extends PapyrusCompartmentEditPart im
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class InformationItemNameEditPartCN extends PapyrusCompartmentEditPart im
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class InformationItemNameEditPartCN extends PapyrusCompartmentEditPart im
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class InformationItemNameEditPartCN extends PapyrusCompartmentEditPart im
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.InformationItem_3094, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.InformationItemNameEditPartCN.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class InformationItemNameEditPartCN extends PapyrusCompartmentEditPart im
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class InformationItemNameEditPartCN extends PapyrusCompartmentEditPart im
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class InformationItemNameEditPartCN extends PapyrusCompartmentEditPart im
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class InformationItemNameEditPartCN extends PapyrusCompartmentEditPart im
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class InformationItemNameEditPartCN extends PapyrusCompartmentEditPart im
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class InformationItemNameEditPartCN extends PapyrusCompartmentEditPart im
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class InformationItemNameEditPartCN extends PapyrusCompartmentEditPart im
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class InformationItemNameEditPartCN extends PapyrusCompartmentEditPart im
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class InformationItemNameEditPartCN extends PapyrusCompartmentEditPart im
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class InformationItemNameEditPartCN extends PapyrusCompartmentEditPart im
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class InformationItemNameEditPartCN extends PapyrusCompartmentEditPart im
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class InformationItemNameEditPartCN extends PapyrusCompartmentEditPart im
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class InformationItemNameEditPartCN extends PapyrusCompartmentEditPart im
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class InformationItemNameEditPartCN extends PapyrusCompartmentEditPart im
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class InformationItemNameEditPartCN extends PapyrusCompartmentEditPart im
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class InformationItemNameEditPartCN extends PapyrusCompartmentEditPart im
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class InformationItemNameEditPartCN extends PapyrusCompartmentEditPart im
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class InformationItemNameEditPartCN extends PapyrusCompartmentEditPart im
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class InformationItemNameEditPartCN extends PapyrusCompartmentEditPart im
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class InformationItemNameEditPartCN extends PapyrusCompartmentEditPart im
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class InformationItemNameEditPartCN extends PapyrusCompartmentEditPart im
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InstanceValueEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InstanceValueEditPart.java
index b44793815dc..e249a05e4f8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InstanceValueEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InstanceValueEditPart.java
@@ -84,7 +84,9 @@ public class InstanceValueEditPart extends RoundedCompartmentEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
@@ -101,21 +103,21 @@ public class InstanceValueEditPart extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case InstanceValueFloatingLabelEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -135,8 +137,9 @@ public class InstanceValueEditPart extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -154,6 +157,7 @@ public class InstanceValueEditPart extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -165,20 +169,23 @@ public class InstanceValueEditPart extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure
+ *
* @generated
*/
public RoundedCompartmentFigure getPrimaryShape() {
- return (RoundedCompartmentFigure)primaryShape;
+ return (RoundedCompartmentFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof InstanceValueNameEditPart) {
- ((InstanceValueNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof InstanceValueNameEditPart) {
+ ((InstanceValueNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
+
+
return false;
}
@@ -186,7 +193,7 @@ public class InstanceValueEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof InstanceValueNameEditPart) {
+ if (childEditPart instanceof InstanceValueNameEditPart) {
return true;
}
return false;
@@ -196,7 +203,7 @@ public class InstanceValueEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -206,7 +213,7 @@ public class InstanceValueEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -216,7 +223,7 @@ public class InstanceValueEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -226,7 +233,7 @@ public class InstanceValueEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof InstanceValueFloatingLabelEditPart) {
+ if (borderItemEditPart instanceof InstanceValueFloatingLabelEditPart) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -249,16 +256,19 @@ public class InstanceValueEditPart extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -270,7 +280,7 @@ public class InstanceValueEditPart extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -280,7 +290,7 @@ public class InstanceValueEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -296,8 +306,8 @@ public class InstanceValueEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InstanceValueFloatingLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InstanceValueFloatingLabelEditPart.java
index 2eb6f64e024..bdff58de214 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InstanceValueFloatingLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InstanceValueFloatingLabelEditPart.java
@@ -113,15 +113,18 @@ public class InstanceValueFloatingLabelEditPart extends FloatingLabelEditPart im
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class InstanceValueFloatingLabelEditPart extends FloatingLabelEditPart im
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class InstanceValueFloatingLabelEditPart extends FloatingLabelEditPart im
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class InstanceValueFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class InstanceValueFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class InstanceValueFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class InstanceValueFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class InstanceValueFloatingLabelEditPart extends FloatingLabelEditPart im
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class InstanceValueFloatingLabelEditPart extends FloatingLabelEditPart im
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class InstanceValueFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class InstanceValueFloatingLabelEditPart extends FloatingLabelEditPart im
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class InstanceValueFloatingLabelEditPart extends FloatingLabelEditPart im
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class InstanceValueFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class InstanceValueFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.InstanceValue_2108, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.InstanceValueFloatingLabelEditPart.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class InstanceValueFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class InstanceValueFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class InstanceValueFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class InstanceValueFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class InstanceValueFloatingLabelEditPart extends FloatingLabelEditPart im
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class InstanceValueFloatingLabelEditPart extends FloatingLabelEditPart im
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class InstanceValueFloatingLabelEditPart extends FloatingLabelEditPart im
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class InstanceValueFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class InstanceValueFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class InstanceValueFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class InstanceValueFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class InstanceValueFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class InstanceValueFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class InstanceValueFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class InstanceValueFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class InstanceValueFloatingLabelEditPart extends FloatingLabelEditPart im
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class InstanceValueFloatingLabelEditPart extends FloatingLabelEditPart im
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class InstanceValueFloatingLabelEditPart extends FloatingLabelEditPart im
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InstanceValueNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InstanceValueNameEditPart.java
index e01faea4134..98fef5f3179 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InstanceValueNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InstanceValueNameEditPart.java
@@ -114,12 +114,14 @@ public class InstanceValueNameEditPart extends PapyrusCompartmentEditPart implem
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class InstanceValueNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class InstanceValueNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class InstanceValueNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class InstanceValueNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class InstanceValueNameEditPart extends PapyrusCompartmentEditPart implem
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class InstanceValueNameEditPart extends PapyrusCompartmentEditPart implem
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class InstanceValueNameEditPart extends PapyrusCompartmentEditPart implem
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class InstanceValueNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class InstanceValueNameEditPart extends PapyrusCompartmentEditPart implem
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class InstanceValueNameEditPart extends PapyrusCompartmentEditPart implem
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class InstanceValueNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class InstanceValueNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.InstanceValue_2108, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.InstanceValueNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class InstanceValueNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class InstanceValueNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class InstanceValueNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class InstanceValueNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class InstanceValueNameEditPart extends PapyrusCompartmentEditPart implem
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class InstanceValueNameEditPart extends PapyrusCompartmentEditPart implem
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class InstanceValueNameEditPart extends PapyrusCompartmentEditPart implem
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class InstanceValueNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class InstanceValueNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class InstanceValueNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class InstanceValueNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class InstanceValueNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class InstanceValueNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class InstanceValueNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class InstanceValueNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class InstanceValueNameEditPart extends PapyrusCompartmentEditPart implem
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class InstanceValueNameEditPart extends PapyrusCompartmentEditPart implem
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class InstanceValueNameEditPart extends PapyrusCompartmentEditPart implem
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class InstanceValueNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class InstanceValueNameEditPart extends PapyrusCompartmentEditPart implem
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class InstanceValueNameEditPart extends PapyrusCompartmentEditPart implem
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionCompositeCompartmentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionCompositeCompartmentEditPart.java
index 72fbf3cf08d..1b0a5e8ba9c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionCompositeCompartmentEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionCompositeCompartmentEditPart.java
@@ -81,7 +81,7 @@ public class InteractionCompositeCompartmentEditPart extends LinkLFShapeCompartm
* @generated
*/
protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
+ if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
super.setRatio(ratio);
}
}
@@ -90,6 +90,7 @@ public class InteractionCompositeCompartmentEditPart extends LinkLFShapeCompartm
* @generated
*/
public EditPart getTargetEditPart(Request request) {
+
return super.getTargetEditPart(request);
}
@@ -98,7 +99,10 @@ public class InteractionCompositeCompartmentEditPart extends LinkLFShapeCompartm
*/
protected void handleNotificationEvent(Notification notification) {
Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
+ if (NotationPackage.eINSTANCE.getSize_Width().equals(feature)
+ || NotationPackage.eINSTANCE.getSize_Height().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_X().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
refreshBounds();
}
super.handleNotificationEvent(notification);
@@ -108,13 +112,16 @@ public class InteractionCompositeCompartmentEditPart extends LinkLFShapeCompartm
* @generated
*/
protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
+ ((GraphicalEditPart) getParent()).setLayoutConstraint(
+ this,
+ getFigure(),
+ new Rectangle(loc, size));
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionCompositeCompartmentEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionCompositeCompartmentEditPartCN.java
index 86bcc76ea38..e03162f7102 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionCompositeCompartmentEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionCompositeCompartmentEditPartCN.java
@@ -81,7 +81,7 @@ public class InteractionCompositeCompartmentEditPartCN extends LinkLFShapeCompar
* @generated
*/
protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
+ if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
super.setRatio(ratio);
}
}
@@ -90,6 +90,7 @@ public class InteractionCompositeCompartmentEditPartCN extends LinkLFShapeCompar
* @generated
*/
public EditPart getTargetEditPart(Request request) {
+
return super.getTargetEditPart(request);
}
@@ -98,7 +99,10 @@ public class InteractionCompositeCompartmentEditPartCN extends LinkLFShapeCompar
*/
protected void handleNotificationEvent(Notification notification) {
Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
+ if (NotationPackage.eINSTANCE.getSize_Width().equals(feature)
+ || NotationPackage.eINSTANCE.getSize_Height().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_X().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
refreshBounds();
}
super.handleNotificationEvent(notification);
@@ -108,13 +112,16 @@ public class InteractionCompositeCompartmentEditPartCN extends LinkLFShapeCompar
* @generated
*/
protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
+ ((GraphicalEditPart) getParent()).setLayoutConstraint(
+ this,
+ getFigure(),
+ new Rectangle(loc, size));
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionCompositeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionCompositeEditPart.java
index 36407221538..1917b60cac2 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionCompositeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionCompositeEditPart.java
@@ -97,7 +97,9 @@ public class InteractionCompositeEditPart extends RoundedCompartmentEditPart {
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new DefaultCreationEditPolicy());
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
@@ -179,6 +181,7 @@ public class InteractionCompositeEditPart extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -205,24 +208,35 @@ public class InteractionCompositeEditPart extends RoundedCompartmentEditPart {
((InteractionCompositeNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
+
+
if (childEditPart instanceof InteractionCompositeCompartmentEditPart) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
pane.add(((InteractionCompositeCompartmentEditPart) childEditPart).getFigure());
return true;
}
+
+
+
// Papyrus Gencode :Affixed Port locator
if (childEditPart instanceof PortEditPart) {
IBorderItemLocator locator = new PortPositionLocator(getMainFigure(), PositionConstants.NONE);
getBorderedFigure().getBorderItemContainer().add(((PortEditPart) childEditPart).getFigure(), locator);
return true;
}
+
+
+
+
// Papyrus Gencode :Affixed Port locator
if (childEditPart instanceof ParameterEditPart) {
IBorderItemLocator locator = new PortPositionLocator(getMainFigure(), PositionConstants.NONE);
getBorderedFigure().getBorderItemContainer().add(((ParameterEditPart) childEditPart).getFigure(), locator);
return true;
}
+
+
return false;
}
@@ -309,6 +323,7 @@ public class InteractionCompositeEditPart extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionCompositeEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionCompositeEditPartCN.java
index 27976ee068c..05e124ec69c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionCompositeEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionCompositeEditPartCN.java
@@ -96,7 +96,9 @@ public class InteractionCompositeEditPartCN extends RoundedCompartmentEditPart {
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new DefaultCreationEditPolicy());
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
@@ -120,14 +122,14 @@ public class InteractionCompositeEditPartCN extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case InteractionCompositeFloatingLabelEditPartCN.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
@@ -137,7 +139,7 @@ public class InteractionCompositeEditPartCN extends RoundedCompartmentEditPart {
return new BorderItemResizableEditPolicy();
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -157,8 +159,9 @@ public class InteractionCompositeEditPartCN extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -176,6 +179,7 @@ public class InteractionCompositeEditPartCN extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -187,38 +191,50 @@ public class InteractionCompositeEditPartCN extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.composite.custom.figures.InteractionCompositeFigure
+ *
* @generated
*/
public InteractionCompositeFigure getPrimaryShape() {
- return (InteractionCompositeFigure)primaryShape;
+ return (InteractionCompositeFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof InteractionCompositeNameEditPartCN) {
- ((InteractionCompositeNameEditPartCN)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof InteractionCompositeNameEditPartCN) {
+ ((InteractionCompositeNameEditPartCN) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
- if(childEditPart instanceof InteractionCompositeCompartmentEditPartCN) {
+
+
+ if (childEditPart instanceof InteractionCompositeCompartmentEditPartCN) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((InteractionCompositeCompartmentEditPartCN)childEditPart).getFigure());
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.add(((InteractionCompositeCompartmentEditPartCN) childEditPart).getFigure());
return true;
}
- //Papyrus Gencode :Affixed Port locator
- if(childEditPart instanceof PortEditPart) {
+
+
+
+ // Papyrus Gencode :Affixed Port locator
+ if (childEditPart instanceof PortEditPart) {
IBorderItemLocator locator = new PortPositionLocator(getMainFigure(), PositionConstants.NONE);
- getBorderedFigure().getBorderItemContainer().add(((PortEditPart)childEditPart).getFigure(), locator);
+ getBorderedFigure().getBorderItemContainer().add(((PortEditPart) childEditPart).getFigure(), locator);
return true;
}
- //Papyrus Gencode :Affixed Port locator
- if(childEditPart instanceof ParameterEditPart) {
+
+
+
+
+ // Papyrus Gencode :Affixed Port locator
+ if (childEditPart instanceof ParameterEditPart) {
IBorderItemLocator locator = new PortPositionLocator(getMainFigure(), PositionConstants.NONE);
- getBorderedFigure().getBorderItemContainer().add(((ParameterEditPart)childEditPart).getFigure(), locator);
+ getBorderedFigure().getBorderItemContainer().add(((ParameterEditPart) childEditPart).getFigure(), locator);
return true;
}
+
+
return false;
}
@@ -226,20 +242,20 @@ public class InteractionCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof InteractionCompositeNameEditPartCN) {
+ if (childEditPart instanceof InteractionCompositeNameEditPartCN) {
return true;
}
- if(childEditPart instanceof InteractionCompositeCompartmentEditPartCN) {
+ if (childEditPart instanceof InteractionCompositeCompartmentEditPartCN) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- pane.remove(((InteractionCompositeCompartmentEditPartCN)childEditPart).getFigure());
+ pane.remove(((InteractionCompositeCompartmentEditPartCN) childEditPart).getFigure());
return true;
}
- if(childEditPart instanceof PortEditPart) {
- getBorderedFigure().getBorderItemContainer().remove(((PortEditPart)childEditPart).getFigure());
+ if (childEditPart instanceof PortEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((PortEditPart) childEditPart).getFigure());
return true;
}
- if(childEditPart instanceof ParameterEditPart) {
- getBorderedFigure().getBorderItemContainer().remove(((ParameterEditPart)childEditPart).getFigure());
+ if (childEditPart instanceof ParameterEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((ParameterEditPart) childEditPart).getFigure());
return true;
}
return false;
@@ -249,7 +265,7 @@ public class InteractionCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -259,7 +275,7 @@ public class InteractionCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -269,10 +285,10 @@ public class InteractionCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof InteractionCompositeCompartmentEditPartCN) {
+ if (editPart instanceof InteractionCompositeCompartmentEditPartCN) {
return getPrimaryShape().getCompositeCompartmentFigure();
}
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -282,7 +298,7 @@ public class InteractionCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof InteractionCompositeFloatingLabelEditPartCN) {
+ if (borderItemEditPart instanceof InteractionCompositeFloatingLabelEditPartCN) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -305,16 +321,19 @@ public class InteractionCompositeEditPartCN extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -326,7 +345,7 @@ public class InteractionCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -336,7 +355,7 @@ public class InteractionCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -352,8 +371,8 @@ public class InteractionCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionCompositeFloatingLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionCompositeFloatingLabelEditPart.java
index 4c2b77fb5db..63d49e86d72 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionCompositeFloatingLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionCompositeFloatingLabelEditPart.java
@@ -113,15 +113,18 @@ public class InteractionCompositeFloatingLabelEditPart extends FloatingLabelEdit
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class InteractionCompositeFloatingLabelEditPart extends FloatingLabelEdit
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class InteractionCompositeFloatingLabelEditPart extends FloatingLabelEdit
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class InteractionCompositeFloatingLabelEditPart extends FloatingLabelEdit
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class InteractionCompositeFloatingLabelEditPart extends FloatingLabelEdit
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class InteractionCompositeFloatingLabelEditPart extends FloatingLabelEdit
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class InteractionCompositeFloatingLabelEditPart extends FloatingLabelEdit
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class InteractionCompositeFloatingLabelEditPart extends FloatingLabelEdit
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class InteractionCompositeFloatingLabelEditPart extends FloatingLabelEdit
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class InteractionCompositeFloatingLabelEditPart extends FloatingLabelEdit
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class InteractionCompositeFloatingLabelEditPart extends FloatingLabelEdit
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class InteractionCompositeFloatingLabelEditPart extends FloatingLabelEdit
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class InteractionCompositeFloatingLabelEditPart extends FloatingLabelEdit
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class InteractionCompositeFloatingLabelEditPart extends FloatingLabelEdit
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Interaction_2061, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.InteractionCompositeFloatingLabelEditPart.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class InteractionCompositeFloatingLabelEditPart extends FloatingLabelEdit
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class InteractionCompositeFloatingLabelEditPart extends FloatingLabelEdit
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class InteractionCompositeFloatingLabelEditPart extends FloatingLabelEdit
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class InteractionCompositeFloatingLabelEditPart extends FloatingLabelEdit
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class InteractionCompositeFloatingLabelEditPart extends FloatingLabelEdit
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class InteractionCompositeFloatingLabelEditPart extends FloatingLabelEdit
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class InteractionCompositeFloatingLabelEditPart extends FloatingLabelEdit
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class InteractionCompositeFloatingLabelEditPart extends FloatingLabelEdit
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class InteractionCompositeFloatingLabelEditPart extends FloatingLabelEdit
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class InteractionCompositeFloatingLabelEditPart extends FloatingLabelEdit
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class InteractionCompositeFloatingLabelEditPart extends FloatingLabelEdit
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class InteractionCompositeFloatingLabelEditPart extends FloatingLabelEdit
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class InteractionCompositeFloatingLabelEditPart extends FloatingLabelEdit
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class InteractionCompositeFloatingLabelEditPart extends FloatingLabelEdit
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class InteractionCompositeFloatingLabelEditPart extends FloatingLabelEdit
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class InteractionCompositeFloatingLabelEditPart extends FloatingLabelEdit
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class InteractionCompositeFloatingLabelEditPart extends FloatingLabelEdit
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class InteractionCompositeFloatingLabelEditPart extends FloatingLabelEdit
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionCompositeFloatingLabelEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionCompositeFloatingLabelEditPartCN.java
index b9389b0bb1a..d9866bc5d8c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionCompositeFloatingLabelEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionCompositeFloatingLabelEditPartCN.java
@@ -113,15 +113,18 @@ public class InteractionCompositeFloatingLabelEditPartCN extends FloatingLabelEd
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class InteractionCompositeFloatingLabelEditPartCN extends FloatingLabelEd
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class InteractionCompositeFloatingLabelEditPartCN extends FloatingLabelEd
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class InteractionCompositeFloatingLabelEditPartCN extends FloatingLabelEd
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class InteractionCompositeFloatingLabelEditPartCN extends FloatingLabelEd
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class InteractionCompositeFloatingLabelEditPartCN extends FloatingLabelEd
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class InteractionCompositeFloatingLabelEditPartCN extends FloatingLabelEd
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class InteractionCompositeFloatingLabelEditPartCN extends FloatingLabelEd
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class InteractionCompositeFloatingLabelEditPartCN extends FloatingLabelEd
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class InteractionCompositeFloatingLabelEditPartCN extends FloatingLabelEd
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class InteractionCompositeFloatingLabelEditPartCN extends FloatingLabelEd
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class InteractionCompositeFloatingLabelEditPartCN extends FloatingLabelEd
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class InteractionCompositeFloatingLabelEditPartCN extends FloatingLabelEd
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class InteractionCompositeFloatingLabelEditPartCN extends FloatingLabelEd
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Interaction_3073, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.InteractionCompositeFloatingLabelEditPartCN.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class InteractionCompositeFloatingLabelEditPartCN extends FloatingLabelEd
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class InteractionCompositeFloatingLabelEditPartCN extends FloatingLabelEd
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class InteractionCompositeFloatingLabelEditPartCN extends FloatingLabelEd
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class InteractionCompositeFloatingLabelEditPartCN extends FloatingLabelEd
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class InteractionCompositeFloatingLabelEditPartCN extends FloatingLabelEd
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class InteractionCompositeFloatingLabelEditPartCN extends FloatingLabelEd
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class InteractionCompositeFloatingLabelEditPartCN extends FloatingLabelEd
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class InteractionCompositeFloatingLabelEditPartCN extends FloatingLabelEd
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class InteractionCompositeFloatingLabelEditPartCN extends FloatingLabelEd
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class InteractionCompositeFloatingLabelEditPartCN extends FloatingLabelEd
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class InteractionCompositeFloatingLabelEditPartCN extends FloatingLabelEd
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class InteractionCompositeFloatingLabelEditPartCN extends FloatingLabelEd
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class InteractionCompositeFloatingLabelEditPartCN extends FloatingLabelEd
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class InteractionCompositeFloatingLabelEditPartCN extends FloatingLabelEd
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class InteractionCompositeFloatingLabelEditPartCN extends FloatingLabelEd
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class InteractionCompositeFloatingLabelEditPartCN extends FloatingLabelEd
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class InteractionCompositeFloatingLabelEditPartCN extends FloatingLabelEd
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class InteractionCompositeFloatingLabelEditPartCN extends FloatingLabelEd
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionCompositeNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionCompositeNameEditPart.java
index 9eba8bb923e..516e55deaf0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionCompositeNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionCompositeNameEditPart.java
@@ -114,12 +114,14 @@ public class InteractionCompositeNameEditPart extends PapyrusCompartmentEditPart
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class InteractionCompositeNameEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class InteractionCompositeNameEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class InteractionCompositeNameEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class InteractionCompositeNameEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class InteractionCompositeNameEditPart extends PapyrusCompartmentEditPart
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class InteractionCompositeNameEditPart extends PapyrusCompartmentEditPart
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class InteractionCompositeNameEditPart extends PapyrusCompartmentEditPart
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class InteractionCompositeNameEditPart extends PapyrusCompartmentEditPart
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class InteractionCompositeNameEditPart extends PapyrusCompartmentEditPart
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class InteractionCompositeNameEditPart extends PapyrusCompartmentEditPart
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class InteractionCompositeNameEditPart extends PapyrusCompartmentEditPart
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class InteractionCompositeNameEditPart extends PapyrusCompartmentEditPart
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Interaction_2061, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.InteractionCompositeNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class InteractionCompositeNameEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class InteractionCompositeNameEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class InteractionCompositeNameEditPart extends PapyrusCompartmentEditPart
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class InteractionCompositeNameEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class InteractionCompositeNameEditPart extends PapyrusCompartmentEditPart
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class InteractionCompositeNameEditPart extends PapyrusCompartmentEditPart
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class InteractionCompositeNameEditPart extends PapyrusCompartmentEditPart
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class InteractionCompositeNameEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class InteractionCompositeNameEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class InteractionCompositeNameEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class InteractionCompositeNameEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class InteractionCompositeNameEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class InteractionCompositeNameEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class InteractionCompositeNameEditPart extends PapyrusCompartmentEditPart
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class InteractionCompositeNameEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class InteractionCompositeNameEditPart extends PapyrusCompartmentEditPart
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class InteractionCompositeNameEditPart extends PapyrusCompartmentEditPart
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class InteractionCompositeNameEditPart extends PapyrusCompartmentEditPart
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class InteractionCompositeNameEditPart extends PapyrusCompartmentEditPart
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class InteractionCompositeNameEditPart extends PapyrusCompartmentEditPart
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class InteractionCompositeNameEditPart extends PapyrusCompartmentEditPart
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionCompositeNameEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionCompositeNameEditPartCN.java
index b291e0a43f5..e2fda315c49 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionCompositeNameEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionCompositeNameEditPartCN.java
@@ -114,12 +114,14 @@ public class InteractionCompositeNameEditPartCN extends PapyrusCompartmentEditPa
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class InteractionCompositeNameEditPartCN extends PapyrusCompartmentEditPa
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class InteractionCompositeNameEditPartCN extends PapyrusCompartmentEditPa
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class InteractionCompositeNameEditPartCN extends PapyrusCompartmentEditPa
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class InteractionCompositeNameEditPartCN extends PapyrusCompartmentEditPa
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class InteractionCompositeNameEditPartCN extends PapyrusCompartmentEditPa
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class InteractionCompositeNameEditPartCN extends PapyrusCompartmentEditPa
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class InteractionCompositeNameEditPartCN extends PapyrusCompartmentEditPa
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class InteractionCompositeNameEditPartCN extends PapyrusCompartmentEditPa
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class InteractionCompositeNameEditPartCN extends PapyrusCompartmentEditPa
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class InteractionCompositeNameEditPartCN extends PapyrusCompartmentEditPa
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class InteractionCompositeNameEditPartCN extends PapyrusCompartmentEditPa
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class InteractionCompositeNameEditPartCN extends PapyrusCompartmentEditPa
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Interaction_3073, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.InteractionCompositeNameEditPartCN.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class InteractionCompositeNameEditPartCN extends PapyrusCompartmentEditPa
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class InteractionCompositeNameEditPartCN extends PapyrusCompartmentEditPa
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class InteractionCompositeNameEditPartCN extends PapyrusCompartmentEditPa
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class InteractionCompositeNameEditPartCN extends PapyrusCompartmentEditPa
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class InteractionCompositeNameEditPartCN extends PapyrusCompartmentEditPa
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class InteractionCompositeNameEditPartCN extends PapyrusCompartmentEditPa
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class InteractionCompositeNameEditPartCN extends PapyrusCompartmentEditPa
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class InteractionCompositeNameEditPartCN extends PapyrusCompartmentEditPa
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class InteractionCompositeNameEditPartCN extends PapyrusCompartmentEditPa
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class InteractionCompositeNameEditPartCN extends PapyrusCompartmentEditPa
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class InteractionCompositeNameEditPartCN extends PapyrusCompartmentEditPa
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class InteractionCompositeNameEditPartCN extends PapyrusCompartmentEditPa
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class InteractionCompositeNameEditPartCN extends PapyrusCompartmentEditPa
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class InteractionCompositeNameEditPartCN extends PapyrusCompartmentEditPa
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class InteractionCompositeNameEditPartCN extends PapyrusCompartmentEditPa
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class InteractionCompositeNameEditPartCN extends PapyrusCompartmentEditPa
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class InteractionCompositeNameEditPartCN extends PapyrusCompartmentEditPa
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class InteractionCompositeNameEditPartCN extends PapyrusCompartmentEditPa
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class InteractionCompositeNameEditPartCN extends PapyrusCompartmentEditPa
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class InteractionCompositeNameEditPartCN extends PapyrusCompartmentEditPa
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class InteractionCompositeNameEditPartCN extends PapyrusCompartmentEditPa
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionConstraintEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionConstraintEditPart.java
index aee217157d1..2cec2272dc4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionConstraintEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionConstraintEditPart.java
@@ -70,7 +70,9 @@ public class InteractionConstraintEditPart extends AbstractConstraintEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
// XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
@@ -86,7 +88,7 @@ public class InteractionConstraintEditPart extends AbstractConstraintEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -106,11 +108,13 @@ public class InteractionConstraintEditPart extends AbstractConstraintEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
super.handleNotificationEvent(event);
+
}
/**
@@ -122,24 +126,27 @@ public class InteractionConstraintEditPart extends AbstractConstraintEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.ConstraintFigure
+ *
* @generated
*/
public ConstraintFigure getPrimaryShape() {
- return (ConstraintFigure)primaryShape;
+ return (ConstraintFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof InteractionConstraintNameEditPart) {
- ((InteractionConstraintNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof InteractionConstraintNameEditPart) {
+ ((InteractionConstraintNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
- if(childEditPart instanceof InteractionConstraintSpecificationEditPart) {
- ((InteractionConstraintSpecificationEditPart)childEditPart).setLabel(getPrimaryShape().getConstraintFigure());
+ if (childEditPart instanceof InteractionConstraintSpecificationEditPart) {
+ ((InteractionConstraintSpecificationEditPart) childEditPart).setLabel(getPrimaryShape().getConstraintFigure());
return true;
}
+
+
return false;
}
@@ -147,10 +154,10 @@ public class InteractionConstraintEditPart extends AbstractConstraintEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof InteractionConstraintNameEditPart) {
+ if (childEditPart instanceof InteractionConstraintNameEditPart) {
return true;
}
- if(childEditPart instanceof InteractionConstraintSpecificationEditPart) {
+ if (childEditPart instanceof InteractionConstraintSpecificationEditPart) {
return true;
}
return false;
@@ -160,7 +167,7 @@ public class InteractionConstraintEditPart extends AbstractConstraintEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -170,7 +177,7 @@ public class InteractionConstraintEditPart extends AbstractConstraintEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -198,16 +205,19 @@ public class InteractionConstraintEditPart extends AbstractConstraintEditPart {
*/
protected NodeFigure createNodeFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -219,7 +229,7 @@ public class InteractionConstraintEditPart extends AbstractConstraintEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -229,7 +239,7 @@ public class InteractionConstraintEditPart extends AbstractConstraintEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -245,8 +255,8 @@ public class InteractionConstraintEditPart extends AbstractConstraintEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionConstraintEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionConstraintEditPartCN.java
index 1e7c115b21f..b11f5c41a65 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionConstraintEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionConstraintEditPartCN.java
@@ -70,7 +70,9 @@ public class InteractionConstraintEditPartCN extends AbstractConstraintEditPart
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
// XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
@@ -86,7 +88,7 @@ public class InteractionConstraintEditPartCN extends AbstractConstraintEditPart
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -106,11 +108,13 @@ public class InteractionConstraintEditPartCN extends AbstractConstraintEditPart
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
super.handleNotificationEvent(event);
+
}
/**
@@ -122,24 +126,27 @@ public class InteractionConstraintEditPartCN extends AbstractConstraintEditPart
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.ConstraintFigure
+ *
* @generated
*/
public ConstraintFigure getPrimaryShape() {
- return (ConstraintFigure)primaryShape;
+ return (ConstraintFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof InteractionConstraintNameEditPartCN) {
- ((InteractionConstraintNameEditPartCN)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof InteractionConstraintNameEditPartCN) {
+ ((InteractionConstraintNameEditPartCN) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
- if(childEditPart instanceof InteractionConstraintSpecificationEditPartCN) {
- ((InteractionConstraintSpecificationEditPartCN)childEditPart).setLabel(getPrimaryShape().getConstraintFigure());
+ if (childEditPart instanceof InteractionConstraintSpecificationEditPartCN) {
+ ((InteractionConstraintSpecificationEditPartCN) childEditPart).setLabel(getPrimaryShape().getConstraintFigure());
return true;
}
+
+
return false;
}
@@ -147,10 +154,10 @@ public class InteractionConstraintEditPartCN extends AbstractConstraintEditPart
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof InteractionConstraintNameEditPartCN) {
+ if (childEditPart instanceof InteractionConstraintNameEditPartCN) {
return true;
}
- if(childEditPart instanceof InteractionConstraintSpecificationEditPartCN) {
+ if (childEditPart instanceof InteractionConstraintSpecificationEditPartCN) {
return true;
}
return false;
@@ -160,7 +167,7 @@ public class InteractionConstraintEditPartCN extends AbstractConstraintEditPart
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -170,7 +177,7 @@ public class InteractionConstraintEditPartCN extends AbstractConstraintEditPart
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -198,16 +205,19 @@ public class InteractionConstraintEditPartCN extends AbstractConstraintEditPart
*/
protected NodeFigure createNodeFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -219,7 +229,7 @@ public class InteractionConstraintEditPartCN extends AbstractConstraintEditPart
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -229,7 +239,7 @@ public class InteractionConstraintEditPartCN extends AbstractConstraintEditPart
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -245,8 +255,8 @@ public class InteractionConstraintEditPartCN extends AbstractConstraintEditPart
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionConstraintNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionConstraintNameEditPart.java
index b86fb8c8225..e9045b01cbf 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionConstraintNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionConstraintNameEditPart.java
@@ -114,12 +114,14 @@ public class InteractionConstraintNameEditPart extends PapyrusCompartmentEditPar
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class InteractionConstraintNameEditPart extends PapyrusCompartmentEditPar
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class InteractionConstraintNameEditPart extends PapyrusCompartmentEditPar
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class InteractionConstraintNameEditPart extends PapyrusCompartmentEditPar
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class InteractionConstraintNameEditPart extends PapyrusCompartmentEditPar
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class InteractionConstraintNameEditPart extends PapyrusCompartmentEditPar
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class InteractionConstraintNameEditPart extends PapyrusCompartmentEditPar
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class InteractionConstraintNameEditPart extends PapyrusCompartmentEditPar
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class InteractionConstraintNameEditPart extends PapyrusCompartmentEditPar
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class InteractionConstraintNameEditPart extends PapyrusCompartmentEditPar
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class InteractionConstraintNameEditPart extends PapyrusCompartmentEditPar
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class InteractionConstraintNameEditPart extends PapyrusCompartmentEditPar
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class InteractionConstraintNameEditPart extends PapyrusCompartmentEditPar
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.InteractionConstraint_2113, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.InteractionConstraintNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class InteractionConstraintNameEditPart extends PapyrusCompartmentEditPar
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class InteractionConstraintNameEditPart extends PapyrusCompartmentEditPar
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class InteractionConstraintNameEditPart extends PapyrusCompartmentEditPar
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class InteractionConstraintNameEditPart extends PapyrusCompartmentEditPar
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class InteractionConstraintNameEditPart extends PapyrusCompartmentEditPar
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class InteractionConstraintNameEditPart extends PapyrusCompartmentEditPar
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class InteractionConstraintNameEditPart extends PapyrusCompartmentEditPar
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class InteractionConstraintNameEditPart extends PapyrusCompartmentEditPar
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class InteractionConstraintNameEditPart extends PapyrusCompartmentEditPar
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class InteractionConstraintNameEditPart extends PapyrusCompartmentEditPar
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class InteractionConstraintNameEditPart extends PapyrusCompartmentEditPar
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class InteractionConstraintNameEditPart extends PapyrusCompartmentEditPar
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class InteractionConstraintNameEditPart extends PapyrusCompartmentEditPar
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class InteractionConstraintNameEditPart extends PapyrusCompartmentEditPar
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class InteractionConstraintNameEditPart extends PapyrusCompartmentEditPar
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class InteractionConstraintNameEditPart extends PapyrusCompartmentEditPar
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class InteractionConstraintNameEditPart extends PapyrusCompartmentEditPar
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class InteractionConstraintNameEditPart extends PapyrusCompartmentEditPar
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class InteractionConstraintNameEditPart extends PapyrusCompartmentEditPar
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class InteractionConstraintNameEditPart extends PapyrusCompartmentEditPar
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class InteractionConstraintNameEditPart extends PapyrusCompartmentEditPar
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionConstraintNameEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionConstraintNameEditPartCN.java
index 2a59ef25d76..fd11cba686e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionConstraintNameEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionConstraintNameEditPartCN.java
@@ -114,12 +114,14 @@ public class InteractionConstraintNameEditPartCN extends PapyrusCompartmentEditP
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class InteractionConstraintNameEditPartCN extends PapyrusCompartmentEditP
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class InteractionConstraintNameEditPartCN extends PapyrusCompartmentEditP
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class InteractionConstraintNameEditPartCN extends PapyrusCompartmentEditP
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class InteractionConstraintNameEditPartCN extends PapyrusCompartmentEditP
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class InteractionConstraintNameEditPartCN extends PapyrusCompartmentEditP
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class InteractionConstraintNameEditPartCN extends PapyrusCompartmentEditP
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class InteractionConstraintNameEditPartCN extends PapyrusCompartmentEditP
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class InteractionConstraintNameEditPartCN extends PapyrusCompartmentEditP
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class InteractionConstraintNameEditPartCN extends PapyrusCompartmentEditP
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class InteractionConstraintNameEditPartCN extends PapyrusCompartmentEditP
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class InteractionConstraintNameEditPartCN extends PapyrusCompartmentEditP
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class InteractionConstraintNameEditPartCN extends PapyrusCompartmentEditP
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.InteractionConstraint_3119, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.InteractionConstraintNameEditPartCN.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class InteractionConstraintNameEditPartCN extends PapyrusCompartmentEditP
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class InteractionConstraintNameEditPartCN extends PapyrusCompartmentEditP
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class InteractionConstraintNameEditPartCN extends PapyrusCompartmentEditP
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class InteractionConstraintNameEditPartCN extends PapyrusCompartmentEditP
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class InteractionConstraintNameEditPartCN extends PapyrusCompartmentEditP
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class InteractionConstraintNameEditPartCN extends PapyrusCompartmentEditP
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class InteractionConstraintNameEditPartCN extends PapyrusCompartmentEditP
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class InteractionConstraintNameEditPartCN extends PapyrusCompartmentEditP
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class InteractionConstraintNameEditPartCN extends PapyrusCompartmentEditP
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class InteractionConstraintNameEditPartCN extends PapyrusCompartmentEditP
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class InteractionConstraintNameEditPartCN extends PapyrusCompartmentEditP
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class InteractionConstraintNameEditPartCN extends PapyrusCompartmentEditP
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class InteractionConstraintNameEditPartCN extends PapyrusCompartmentEditP
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class InteractionConstraintNameEditPartCN extends PapyrusCompartmentEditP
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class InteractionConstraintNameEditPartCN extends PapyrusCompartmentEditP
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class InteractionConstraintNameEditPartCN extends PapyrusCompartmentEditP
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class InteractionConstraintNameEditPartCN extends PapyrusCompartmentEditP
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class InteractionConstraintNameEditPartCN extends PapyrusCompartmentEditP
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class InteractionConstraintNameEditPartCN extends PapyrusCompartmentEditP
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class InteractionConstraintNameEditPartCN extends PapyrusCompartmentEditP
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class InteractionConstraintNameEditPartCN extends PapyrusCompartmentEditP
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionConstraintSpecificationEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionConstraintSpecificationEditPart.java
index dd65b8a490b..8191a067978 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionConstraintSpecificationEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionConstraintSpecificationEditPart.java
@@ -110,12 +110,14 @@ public class InteractionConstraintSpecificationEditPart extends PapyrusCompartme
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -141,12 +143,12 @@ public class InteractionConstraintSpecificationEditPart extends PapyrusCompartme
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -154,12 +156,12 @@ public class InteractionConstraintSpecificationEditPart extends PapyrusCompartme
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -167,12 +169,12 @@ public class InteractionConstraintSpecificationEditPart extends PapyrusCompartme
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -180,12 +182,12 @@ public class InteractionConstraintSpecificationEditPart extends PapyrusCompartme
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -241,10 +243,12 @@ public class InteractionConstraintSpecificationEditPart extends PapyrusCompartme
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -256,12 +260,12 @@ public class InteractionConstraintSpecificationEditPart extends PapyrusCompartme
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -269,10 +273,12 @@ public class InteractionConstraintSpecificationEditPart extends PapyrusCompartme
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -290,15 +296,16 @@ public class InteractionConstraintSpecificationEditPart extends PapyrusCompartme
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -306,6 +313,7 @@ public class InteractionConstraintSpecificationEditPart extends PapyrusCompartme
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -316,7 +324,7 @@ public class InteractionConstraintSpecificationEditPart extends PapyrusCompartme
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -333,7 +341,7 @@ public class InteractionConstraintSpecificationEditPart extends PapyrusCompartme
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.InteractionConstraint_2113, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.InteractionConstraintSpecificationEditPart.VISUAL_ID));
}
return parser;
@@ -343,8 +351,10 @@ public class InteractionConstraintSpecificationEditPart extends PapyrusCompartme
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -373,8 +383,8 @@ public class InteractionConstraintSpecificationEditPart extends PapyrusCompartme
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -382,8 +392,8 @@ public class InteractionConstraintSpecificationEditPart extends PapyrusCompartme
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -393,46 +403,52 @@ public class InteractionConstraintSpecificationEditPart extends PapyrusCompartme
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -454,12 +470,12 @@ public class InteractionConstraintSpecificationEditPart extends PapyrusCompartme
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -489,12 +505,12 @@ public class InteractionConstraintSpecificationEditPart extends PapyrusCompartme
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -503,12 +519,12 @@ public class InteractionConstraintSpecificationEditPart extends PapyrusCompartme
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -516,15 +532,16 @@ public class InteractionConstraintSpecificationEditPart extends PapyrusCompartme
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -533,9 +550,10 @@ public class InteractionConstraintSpecificationEditPart extends PapyrusCompartme
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -543,9 +561,12 @@ public class InteractionConstraintSpecificationEditPart extends PapyrusCompartme
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -561,11 +582,11 @@ public class InteractionConstraintSpecificationEditPart extends PapyrusCompartme
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -576,8 +597,8 @@ public class InteractionConstraintSpecificationEditPart extends PapyrusCompartme
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -589,7 +610,7 @@ public class InteractionConstraintSpecificationEditPart extends PapyrusCompartme
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -615,13 +636,14 @@ public class InteractionConstraintSpecificationEditPart extends PapyrusCompartme
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -633,8 +655,8 @@ public class InteractionConstraintSpecificationEditPart extends PapyrusCompartme
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -651,35 +673,40 @@ public class InteractionConstraintSpecificationEditPart extends PapyrusCompartme
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -689,12 +716,13 @@ public class InteractionConstraintSpecificationEditPart extends PapyrusCompartme
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -729,24 +757,25 @@ public class InteractionConstraintSpecificationEditPart extends PapyrusCompartme
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -781,7 +810,8 @@ public class InteractionConstraintSpecificationEditPart extends PapyrusCompartme
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -790,6 +820,7 @@ public class InteractionConstraintSpecificationEditPart extends PapyrusCompartme
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -797,5 +828,6 @@ public class InteractionConstraintSpecificationEditPart extends PapyrusCompartme
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionConstraintSpecificationEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionConstraintSpecificationEditPartCN.java
index fcd2e4a08de..b3d572f63a0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionConstraintSpecificationEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InteractionConstraintSpecificationEditPartCN.java
@@ -110,12 +110,14 @@ public class InteractionConstraintSpecificationEditPartCN extends PapyrusCompart
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -141,12 +143,12 @@ public class InteractionConstraintSpecificationEditPartCN extends PapyrusCompart
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -154,12 +156,12 @@ public class InteractionConstraintSpecificationEditPartCN extends PapyrusCompart
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -167,12 +169,12 @@ public class InteractionConstraintSpecificationEditPartCN extends PapyrusCompart
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -180,12 +182,12 @@ public class InteractionConstraintSpecificationEditPartCN extends PapyrusCompart
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -241,10 +243,12 @@ public class InteractionConstraintSpecificationEditPartCN extends PapyrusCompart
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -256,12 +260,12 @@ public class InteractionConstraintSpecificationEditPartCN extends PapyrusCompart
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -269,10 +273,12 @@ public class InteractionConstraintSpecificationEditPartCN extends PapyrusCompart
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -290,15 +296,16 @@ public class InteractionConstraintSpecificationEditPartCN extends PapyrusCompart
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -306,6 +313,7 @@ public class InteractionConstraintSpecificationEditPartCN extends PapyrusCompart
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -316,7 +324,7 @@ public class InteractionConstraintSpecificationEditPartCN extends PapyrusCompart
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -333,7 +341,7 @@ public class InteractionConstraintSpecificationEditPartCN extends PapyrusCompart
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.InteractionConstraint_3119, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.InteractionConstraintSpecificationEditPartCN.VISUAL_ID));
}
return parser;
@@ -343,8 +351,10 @@ public class InteractionConstraintSpecificationEditPartCN extends PapyrusCompart
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -373,8 +383,8 @@ public class InteractionConstraintSpecificationEditPartCN extends PapyrusCompart
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -382,8 +392,8 @@ public class InteractionConstraintSpecificationEditPartCN extends PapyrusCompart
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -393,46 +403,52 @@ public class InteractionConstraintSpecificationEditPartCN extends PapyrusCompart
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -454,12 +470,12 @@ public class InteractionConstraintSpecificationEditPartCN extends PapyrusCompart
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -489,12 +505,12 @@ public class InteractionConstraintSpecificationEditPartCN extends PapyrusCompart
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -503,12 +519,12 @@ public class InteractionConstraintSpecificationEditPartCN extends PapyrusCompart
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -516,15 +532,16 @@ public class InteractionConstraintSpecificationEditPartCN extends PapyrusCompart
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -533,9 +550,10 @@ public class InteractionConstraintSpecificationEditPartCN extends PapyrusCompart
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -543,9 +561,12 @@ public class InteractionConstraintSpecificationEditPartCN extends PapyrusCompart
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -561,11 +582,11 @@ public class InteractionConstraintSpecificationEditPartCN extends PapyrusCompart
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -576,8 +597,8 @@ public class InteractionConstraintSpecificationEditPartCN extends PapyrusCompart
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -589,7 +610,7 @@ public class InteractionConstraintSpecificationEditPartCN extends PapyrusCompart
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -615,13 +636,14 @@ public class InteractionConstraintSpecificationEditPartCN extends PapyrusCompart
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -633,8 +655,8 @@ public class InteractionConstraintSpecificationEditPartCN extends PapyrusCompart
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -651,35 +673,40 @@ public class InteractionConstraintSpecificationEditPartCN extends PapyrusCompart
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -689,12 +716,13 @@ public class InteractionConstraintSpecificationEditPartCN extends PapyrusCompart
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -729,24 +757,25 @@ public class InteractionConstraintSpecificationEditPartCN extends PapyrusCompart
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -781,7 +810,8 @@ public class InteractionConstraintSpecificationEditPartCN extends PapyrusCompart
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -790,6 +820,7 @@ public class InteractionConstraintSpecificationEditPartCN extends PapyrusCompart
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -797,5 +828,6 @@ public class InteractionConstraintSpecificationEditPartCN extends PapyrusCompart
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceEditPart.java
index a2bbebd623c..06f10c8c54b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceEditPart.java
@@ -86,7 +86,9 @@ public class InterfaceEditPart extends RoundedCompartmentEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
@@ -105,21 +107,21 @@ public class InterfaceEditPart extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case InterfaceFloatingLabelEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -139,8 +141,9 @@ public class InterfaceEditPart extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -158,6 +161,7 @@ public class InterfaceEditPart extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -169,20 +173,23 @@ public class InterfaceEditPart extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.composite.custom.figures.InterfaceCompositeFigure
+ *
* @generated
*/
public InterfaceCompositeFigure getPrimaryShape() {
- return (InterfaceCompositeFigure)primaryShape;
+ return (InterfaceCompositeFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof InterfaceNameEditPart) {
- ((InterfaceNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof InterfaceNameEditPart) {
+ ((InterfaceNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
+
+
return false;
}
@@ -190,7 +197,7 @@ public class InterfaceEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof InterfaceNameEditPart) {
+ if (childEditPart instanceof InterfaceNameEditPart) {
return true;
}
return false;
@@ -200,7 +207,7 @@ public class InterfaceEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -210,7 +217,7 @@ public class InterfaceEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -220,7 +227,7 @@ public class InterfaceEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -230,7 +237,7 @@ public class InterfaceEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof InterfaceFloatingLabelEditPart) {
+ if (borderItemEditPart instanceof InterfaceFloatingLabelEditPart) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -253,16 +260,19 @@ public class InterfaceEditPart extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -274,7 +284,7 @@ public class InterfaceEditPart extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -284,7 +294,7 @@ public class InterfaceEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -300,8 +310,8 @@ public class InterfaceEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceEditPartCN.java
index c68f3827b8f..a6d6cda7813 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceEditPartCN.java
@@ -86,7 +86,9 @@ public class InterfaceEditPartCN extends RoundedCompartmentEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
@@ -105,21 +107,21 @@ public class InterfaceEditPartCN extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case InterfaceFloatingLabelEditPartCN.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -139,8 +141,9 @@ public class InterfaceEditPartCN extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -158,6 +161,7 @@ public class InterfaceEditPartCN extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -169,20 +173,23 @@ public class InterfaceEditPartCN extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.composite.custom.figures.InterfaceCompositeFigure
+ *
* @generated
*/
public InterfaceCompositeFigure getPrimaryShape() {
- return (InterfaceCompositeFigure)primaryShape;
+ return (InterfaceCompositeFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof InterfaceNameEditPartCN) {
- ((InterfaceNameEditPartCN)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof InterfaceNameEditPartCN) {
+ ((InterfaceNameEditPartCN) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
+
+
return false;
}
@@ -190,7 +197,7 @@ public class InterfaceEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof InterfaceNameEditPartCN) {
+ if (childEditPart instanceof InterfaceNameEditPartCN) {
return true;
}
return false;
@@ -200,7 +207,7 @@ public class InterfaceEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -210,7 +217,7 @@ public class InterfaceEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -220,7 +227,7 @@ public class InterfaceEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -230,7 +237,7 @@ public class InterfaceEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof InterfaceFloatingLabelEditPartCN) {
+ if (borderItemEditPart instanceof InterfaceFloatingLabelEditPartCN) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -253,16 +260,19 @@ public class InterfaceEditPartCN extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -274,7 +284,7 @@ public class InterfaceEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -284,7 +294,7 @@ public class InterfaceEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -300,8 +310,8 @@ public class InterfaceEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceFloatingLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceFloatingLabelEditPart.java
index 95011c8ccc8..6245f7cd8df 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceFloatingLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceFloatingLabelEditPart.java
@@ -113,15 +113,18 @@ public class InterfaceFloatingLabelEditPart extends FloatingLabelEditPart implem
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class InterfaceFloatingLabelEditPart extends FloatingLabelEditPart implem
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class InterfaceFloatingLabelEditPart extends FloatingLabelEditPart implem
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class InterfaceFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class InterfaceFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class InterfaceFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class InterfaceFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class InterfaceFloatingLabelEditPart extends FloatingLabelEditPart implem
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class InterfaceFloatingLabelEditPart extends FloatingLabelEditPart implem
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class InterfaceFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class InterfaceFloatingLabelEditPart extends FloatingLabelEditPart implem
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class InterfaceFloatingLabelEditPart extends FloatingLabelEditPart implem
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class InterfaceFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class InterfaceFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Interface_2076, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.InterfaceFloatingLabelEditPart.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class InterfaceFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class InterfaceFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class InterfaceFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class InterfaceFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class InterfaceFloatingLabelEditPart extends FloatingLabelEditPart implem
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class InterfaceFloatingLabelEditPart extends FloatingLabelEditPart implem
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class InterfaceFloatingLabelEditPart extends FloatingLabelEditPart implem
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class InterfaceFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class InterfaceFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class InterfaceFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class InterfaceFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class InterfaceFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class InterfaceFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class InterfaceFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class InterfaceFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class InterfaceFloatingLabelEditPart extends FloatingLabelEditPart implem
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class InterfaceFloatingLabelEditPart extends FloatingLabelEditPart implem
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class InterfaceFloatingLabelEditPart extends FloatingLabelEditPart implem
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceFloatingLabelEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceFloatingLabelEditPartCN.java
index 53321054ef8..107ab464bb8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceFloatingLabelEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceFloatingLabelEditPartCN.java
@@ -113,15 +113,18 @@ public class InterfaceFloatingLabelEditPartCN extends FloatingLabelEditPart impl
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class InterfaceFloatingLabelEditPartCN extends FloatingLabelEditPart impl
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class InterfaceFloatingLabelEditPartCN extends FloatingLabelEditPart impl
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class InterfaceFloatingLabelEditPartCN extends FloatingLabelEditPart impl
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class InterfaceFloatingLabelEditPartCN extends FloatingLabelEditPart impl
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class InterfaceFloatingLabelEditPartCN extends FloatingLabelEditPart impl
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class InterfaceFloatingLabelEditPartCN extends FloatingLabelEditPart impl
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class InterfaceFloatingLabelEditPartCN extends FloatingLabelEditPart impl
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class InterfaceFloatingLabelEditPartCN extends FloatingLabelEditPart impl
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class InterfaceFloatingLabelEditPartCN extends FloatingLabelEditPart impl
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class InterfaceFloatingLabelEditPartCN extends FloatingLabelEditPart impl
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class InterfaceFloatingLabelEditPartCN extends FloatingLabelEditPart impl
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class InterfaceFloatingLabelEditPartCN extends FloatingLabelEditPart impl
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class InterfaceFloatingLabelEditPartCN extends FloatingLabelEditPart impl
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Interface_3087, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.InterfaceFloatingLabelEditPartCN.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class InterfaceFloatingLabelEditPartCN extends FloatingLabelEditPart impl
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class InterfaceFloatingLabelEditPartCN extends FloatingLabelEditPart impl
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class InterfaceFloatingLabelEditPartCN extends FloatingLabelEditPart impl
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class InterfaceFloatingLabelEditPartCN extends FloatingLabelEditPart impl
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class InterfaceFloatingLabelEditPartCN extends FloatingLabelEditPart impl
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class InterfaceFloatingLabelEditPartCN extends FloatingLabelEditPart impl
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class InterfaceFloatingLabelEditPartCN extends FloatingLabelEditPart impl
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class InterfaceFloatingLabelEditPartCN extends FloatingLabelEditPart impl
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class InterfaceFloatingLabelEditPartCN extends FloatingLabelEditPart impl
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class InterfaceFloatingLabelEditPartCN extends FloatingLabelEditPart impl
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class InterfaceFloatingLabelEditPartCN extends FloatingLabelEditPart impl
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class InterfaceFloatingLabelEditPartCN extends FloatingLabelEditPart impl
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class InterfaceFloatingLabelEditPartCN extends FloatingLabelEditPart impl
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class InterfaceFloatingLabelEditPartCN extends FloatingLabelEditPart impl
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class InterfaceFloatingLabelEditPartCN extends FloatingLabelEditPart impl
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class InterfaceFloatingLabelEditPartCN extends FloatingLabelEditPart impl
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class InterfaceFloatingLabelEditPartCN extends FloatingLabelEditPart impl
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class InterfaceFloatingLabelEditPartCN extends FloatingLabelEditPart impl
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceNameEditPart.java
index 7a1bbf9d535..0beec604e44 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceNameEditPart.java
@@ -114,12 +114,14 @@ public class InterfaceNameEditPart extends PapyrusCompartmentEditPart implements
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class InterfaceNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class InterfaceNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class InterfaceNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class InterfaceNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class InterfaceNameEditPart extends PapyrusCompartmentEditPart implements
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class InterfaceNameEditPart extends PapyrusCompartmentEditPart implements
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class InterfaceNameEditPart extends PapyrusCompartmentEditPart implements
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class InterfaceNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class InterfaceNameEditPart extends PapyrusCompartmentEditPart implements
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class InterfaceNameEditPart extends PapyrusCompartmentEditPart implements
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class InterfaceNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class InterfaceNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Interface_2076, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.InterfaceNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class InterfaceNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class InterfaceNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class InterfaceNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class InterfaceNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class InterfaceNameEditPart extends PapyrusCompartmentEditPart implements
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class InterfaceNameEditPart extends PapyrusCompartmentEditPart implements
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class InterfaceNameEditPart extends PapyrusCompartmentEditPart implements
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class InterfaceNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class InterfaceNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class InterfaceNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class InterfaceNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class InterfaceNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class InterfaceNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class InterfaceNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class InterfaceNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class InterfaceNameEditPart extends PapyrusCompartmentEditPart implements
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class InterfaceNameEditPart extends PapyrusCompartmentEditPart implements
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class InterfaceNameEditPart extends PapyrusCompartmentEditPart implements
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class InterfaceNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class InterfaceNameEditPart extends PapyrusCompartmentEditPart implements
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class InterfaceNameEditPart extends PapyrusCompartmentEditPart implements
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceNameEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceNameEditPartCN.java
index 0c82419ae0a..e8afbd0a095 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceNameEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceNameEditPartCN.java
@@ -114,12 +114,14 @@ public class InterfaceNameEditPartCN extends PapyrusCompartmentEditPart implemen
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class InterfaceNameEditPartCN extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class InterfaceNameEditPartCN extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class InterfaceNameEditPartCN extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class InterfaceNameEditPartCN extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class InterfaceNameEditPartCN extends PapyrusCompartmentEditPart implemen
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class InterfaceNameEditPartCN extends PapyrusCompartmentEditPart implemen
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class InterfaceNameEditPartCN extends PapyrusCompartmentEditPart implemen
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class InterfaceNameEditPartCN extends PapyrusCompartmentEditPart implemen
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class InterfaceNameEditPartCN extends PapyrusCompartmentEditPart implemen
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class InterfaceNameEditPartCN extends PapyrusCompartmentEditPart implemen
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class InterfaceNameEditPartCN extends PapyrusCompartmentEditPart implemen
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class InterfaceNameEditPartCN extends PapyrusCompartmentEditPart implemen
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Interface_3087, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.InterfaceNameEditPartCN.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class InterfaceNameEditPartCN extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class InterfaceNameEditPartCN extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class InterfaceNameEditPartCN extends PapyrusCompartmentEditPart implemen
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class InterfaceNameEditPartCN extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class InterfaceNameEditPartCN extends PapyrusCompartmentEditPart implemen
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class InterfaceNameEditPartCN extends PapyrusCompartmentEditPart implemen
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class InterfaceNameEditPartCN extends PapyrusCompartmentEditPart implemen
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class InterfaceNameEditPartCN extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class InterfaceNameEditPartCN extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class InterfaceNameEditPartCN extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class InterfaceNameEditPartCN extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class InterfaceNameEditPartCN extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class InterfaceNameEditPartCN extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class InterfaceNameEditPartCN extends PapyrusCompartmentEditPart implemen
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class InterfaceNameEditPartCN extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class InterfaceNameEditPartCN extends PapyrusCompartmentEditPart implemen
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class InterfaceNameEditPartCN extends PapyrusCompartmentEditPart implemen
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class InterfaceNameEditPartCN extends PapyrusCompartmentEditPart implemen
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class InterfaceNameEditPartCN extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class InterfaceNameEditPartCN extends PapyrusCompartmentEditPart implemen
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class InterfaceNameEditPartCN extends PapyrusCompartmentEditPart implemen
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceRealizationAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceRealizationAppliedStereotypeEditPart.java
index 72af7fbf703..c76a3687e7d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceRealizationAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceRealizationAppliedStereotypeEditPart.java
@@ -123,6 +123,7 @@ public class InterfaceRealizationAppliedStereotypeEditPart extends PapyrusLabelE
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -211,8 +212,7 @@ public class InterfaceRealizationAppliedStereotypeEditPart extends PapyrusLabelE
/**
* @generated
*/
- public void setLabel(IFigure
- figure) {
+ public void setLabel(IFigure figure) {
unregisterVisuals();
setFigure(figure);
defaultText = getLabelTextHelper(figure);
@@ -324,15 +324,14 @@ public class InterfaceRealizationAppliedStereotypeEditPart extends PapyrusLabelE
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid =
- (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
@@ -461,8 +460,7 @@ public class InterfaceRealizationAppliedStereotypeEditPart extends PapyrusLabelE
IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- }
- else if (configuration instanceof IAdvancedEditorConfiguration) {
+ } 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);
@@ -507,8 +505,7 @@ public class InterfaceRealizationAppliedStereotypeEditPart extends PapyrusLabelE
RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- }
- else {
+ } else {
performDirectEdit();
}
}
@@ -558,17 +555,15 @@ public class InterfaceRealizationAppliedStereotypeEditPart extends PapyrusLabelE
* @generated
*/
protected void refreshUnderline() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
if (resolveSemanticElement() instanceof Feature) {
if (((Feature) resolveSemanticElement()).isStatic()) {
((WrappingLabel) getFigure()).setTextUnderline(true);
- }
- else {
+ } else {
((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
@@ -578,9 +573,8 @@ public class InterfaceRealizationAppliedStereotypeEditPart extends PapyrusLabelE
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
@@ -591,14 +585,12 @@ public class InterfaceRealizationAppliedStereotypeEditPart extends PapyrusLabelE
*/
@Override
protected void refreshFont() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ 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));
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -684,7 +676,7 @@ public class InterfaceRealizationAppliedStereotypeEditPart extends PapyrusLabelE
*/
protected boolean checkExtendedEditor() {
if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -708,9 +700,9 @@ public class InterfaceRealizationAppliedStereotypeEditPart extends PapyrusLabelE
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());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
@@ -724,8 +716,7 @@ public class InterfaceRealizationAppliedStereotypeEditPart extends PapyrusLabelE
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement()
- .eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
@@ -777,18 +768,15 @@ public class InterfaceRealizationAppliedStereotypeEditPart extends PapyrusLabelE
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)) {
+ } 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();
+ ISemanticParser modelParser = (ISemanticParser) getParser();
if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
if (resolveSemanticElement() != null) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceRealizationEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceRealizationEditPart.java
index fbea73149c6..2b8f2023ade 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceRealizationEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceRealizationEditPart.java
@@ -51,11 +51,13 @@ public class InterfaceRealizationEditPart extends UMLConnectionNodeEditPart impl
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof InterfaceRealizationNameEditPart) {
- ((InterfaceRealizationNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof InterfaceRealizationNameEditPart) {
+ ((InterfaceRealizationNameEditPart) childEditPart).setLabel(
+ getPrimaryShape().getNameLabel());
}
- if(childEditPart instanceof InterfaceRealizationAppliedStereotypeEditPart) {
- ((InterfaceRealizationAppliedStereotypeEditPart)childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
+ if (childEditPart instanceof InterfaceRealizationAppliedStereotypeEditPart) {
+ ((InterfaceRealizationAppliedStereotypeEditPart) childEditPart).setLabel(
+ getPrimaryShape().getAppliedStereotypeLabel());
}
return false;
}
@@ -64,7 +66,7 @@ public class InterfaceRealizationEditPart extends UMLConnectionNodeEditPart impl
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -74,10 +76,10 @@ public class InterfaceRealizationEditPart extends UMLConnectionNodeEditPart impl
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof InterfaceRealizationNameEditPart) {
+ if (childEditPart instanceof InterfaceRealizationNameEditPart) {
return true;
}
- if(childEditPart instanceof InterfaceRealizationAppliedStereotypeEditPart) {
+ if (childEditPart instanceof InterfaceRealizationAppliedStereotypeEditPart) {
return true;
}
return false;
@@ -87,7 +89,7 @@ public class InterfaceRealizationEditPart extends UMLConnectionNodeEditPart impl
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -109,6 +111,6 @@ public class InterfaceRealizationEditPart extends UMLConnectionNodeEditPart impl
* @generated
*/
public InterfaceRealizationFigure getPrimaryShape() {
- return (InterfaceRealizationFigure)getFigure();
+ return (InterfaceRealizationFigure) getFigure();
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceRealizationNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceRealizationNameEditPart.java
index 5c63c9c6a40..8797cc6698f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceRealizationNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/InterfaceRealizationNameEditPart.java
@@ -123,6 +123,7 @@ public class InterfaceRealizationNameEditPart extends PapyrusLabelEditPart imple
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -211,8 +212,7 @@ public class InterfaceRealizationNameEditPart extends PapyrusLabelEditPart imple
/**
* @generated
*/
- public void setLabel(IFigure
- figure) {
+ public void setLabel(IFigure figure) {
unregisterVisuals();
setFigure(figure);
defaultText = getLabelTextHelper(figure);
@@ -324,15 +324,14 @@ public class InterfaceRealizationNameEditPart extends PapyrusLabelEditPart imple
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid =
- (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
@@ -461,8 +460,7 @@ public class InterfaceRealizationNameEditPart extends PapyrusLabelEditPart imple
IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- }
- else if (configuration instanceof IAdvancedEditorConfiguration) {
+ } 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);
@@ -507,8 +505,7 @@ public class InterfaceRealizationNameEditPart extends PapyrusLabelEditPart imple
RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- }
- else {
+ } else {
performDirectEdit();
}
}
@@ -558,17 +555,15 @@ public class InterfaceRealizationNameEditPart extends PapyrusLabelEditPart imple
* @generated
*/
protected void refreshUnderline() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
if (resolveSemanticElement() instanceof Feature) {
if (((Feature) resolveSemanticElement()).isStatic()) {
((WrappingLabel) getFigure()).setTextUnderline(true);
- }
- else {
+ } else {
((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
@@ -578,9 +573,8 @@ public class InterfaceRealizationNameEditPart extends PapyrusLabelEditPart imple
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
@@ -591,14 +585,12 @@ public class InterfaceRealizationNameEditPart extends PapyrusLabelEditPart imple
*/
@Override
protected void refreshFont() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ 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));
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -692,7 +684,7 @@ public class InterfaceRealizationNameEditPart extends PapyrusLabelEditPart imple
*/
protected boolean checkExtendedEditor() {
if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -716,9 +708,9 @@ public class InterfaceRealizationNameEditPart extends PapyrusLabelEditPart imple
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());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
@@ -732,8 +724,7 @@ public class InterfaceRealizationNameEditPart extends PapyrusLabelEditPart imple
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement()
- .eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
@@ -785,18 +776,15 @@ public class InterfaceRealizationNameEditPart extends PapyrusLabelEditPart imple
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)) {
+ } 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();
+ ISemanticParser modelParser = (ISemanticParser) getParser();
if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
if (resolveSemanticElement() != null) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalConstraintEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalConstraintEditPart.java
index ad8972d909d..2c057796aa6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalConstraintEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalConstraintEditPart.java
@@ -70,7 +70,9 @@ public class IntervalConstraintEditPart extends AbstractConstraintEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
// XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
@@ -86,7 +88,7 @@ public class IntervalConstraintEditPart extends AbstractConstraintEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -106,11 +108,13 @@ public class IntervalConstraintEditPart extends AbstractConstraintEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
super.handleNotificationEvent(event);
+
}
/**
@@ -122,24 +126,27 @@ public class IntervalConstraintEditPart extends AbstractConstraintEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.ConstraintFigure
+ *
* @generated
*/
public ConstraintFigure getPrimaryShape() {
- return (ConstraintFigure)primaryShape;
+ return (ConstraintFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof IntervalConstraintNameEditPart) {
- ((IntervalConstraintNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof IntervalConstraintNameEditPart) {
+ ((IntervalConstraintNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
- if(childEditPart instanceof IntervalConstraintSpecificationEditPart) {
- ((IntervalConstraintSpecificationEditPart)childEditPart).setLabel(getPrimaryShape().getConstraintFigure());
+ if (childEditPart instanceof IntervalConstraintSpecificationEditPart) {
+ ((IntervalConstraintSpecificationEditPart) childEditPart).setLabel(getPrimaryShape().getConstraintFigure());
return true;
}
+
+
return false;
}
@@ -147,10 +154,10 @@ public class IntervalConstraintEditPart extends AbstractConstraintEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof IntervalConstraintNameEditPart) {
+ if (childEditPart instanceof IntervalConstraintNameEditPart) {
return true;
}
- if(childEditPart instanceof IntervalConstraintSpecificationEditPart) {
+ if (childEditPart instanceof IntervalConstraintSpecificationEditPart) {
return true;
}
return false;
@@ -160,7 +167,7 @@ public class IntervalConstraintEditPart extends AbstractConstraintEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -170,7 +177,7 @@ public class IntervalConstraintEditPart extends AbstractConstraintEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -198,16 +205,19 @@ public class IntervalConstraintEditPart extends AbstractConstraintEditPart {
*/
protected NodeFigure createNodeFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -219,7 +229,7 @@ public class IntervalConstraintEditPart extends AbstractConstraintEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -229,7 +239,7 @@ public class IntervalConstraintEditPart extends AbstractConstraintEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -245,8 +255,8 @@ public class IntervalConstraintEditPart extends AbstractConstraintEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalConstraintEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalConstraintEditPartCN.java
index 1c53aba4464..13d236ce64e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalConstraintEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalConstraintEditPartCN.java
@@ -70,7 +70,9 @@ public class IntervalConstraintEditPartCN extends AbstractConstraintEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
// XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
@@ -86,7 +88,7 @@ public class IntervalConstraintEditPartCN extends AbstractConstraintEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -106,11 +108,13 @@ public class IntervalConstraintEditPartCN extends AbstractConstraintEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
super.handleNotificationEvent(event);
+
}
/**
@@ -122,24 +126,27 @@ public class IntervalConstraintEditPartCN extends AbstractConstraintEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.ConstraintFigure
+ *
* @generated
*/
public ConstraintFigure getPrimaryShape() {
- return (ConstraintFigure)primaryShape;
+ return (ConstraintFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof IntervalConstraintNameEditPartCN) {
- ((IntervalConstraintNameEditPartCN)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof IntervalConstraintNameEditPartCN) {
+ ((IntervalConstraintNameEditPartCN) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
- if(childEditPart instanceof IntervalConstraintSpecificationEditPartCN) {
- ((IntervalConstraintSpecificationEditPartCN)childEditPart).setLabel(getPrimaryShape().getConstraintFigure());
+ if (childEditPart instanceof IntervalConstraintSpecificationEditPartCN) {
+ ((IntervalConstraintSpecificationEditPartCN) childEditPart).setLabel(getPrimaryShape().getConstraintFigure());
return true;
}
+
+
return false;
}
@@ -147,10 +154,10 @@ public class IntervalConstraintEditPartCN extends AbstractConstraintEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof IntervalConstraintNameEditPartCN) {
+ if (childEditPart instanceof IntervalConstraintNameEditPartCN) {
return true;
}
- if(childEditPart instanceof IntervalConstraintSpecificationEditPartCN) {
+ if (childEditPart instanceof IntervalConstraintSpecificationEditPartCN) {
return true;
}
return false;
@@ -160,7 +167,7 @@ public class IntervalConstraintEditPartCN extends AbstractConstraintEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -170,7 +177,7 @@ public class IntervalConstraintEditPartCN extends AbstractConstraintEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -198,16 +205,19 @@ public class IntervalConstraintEditPartCN extends AbstractConstraintEditPart {
*/
protected NodeFigure createNodeFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -219,7 +229,7 @@ public class IntervalConstraintEditPartCN extends AbstractConstraintEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -229,7 +239,7 @@ public class IntervalConstraintEditPartCN extends AbstractConstraintEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -245,8 +255,8 @@ public class IntervalConstraintEditPartCN extends AbstractConstraintEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalConstraintNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalConstraintNameEditPart.java
index 66220976e8c..902beca27db 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalConstraintNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalConstraintNameEditPart.java
@@ -114,12 +114,14 @@ public class IntervalConstraintNameEditPart extends PapyrusCompartmentEditPart i
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class IntervalConstraintNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class IntervalConstraintNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class IntervalConstraintNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class IntervalConstraintNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class IntervalConstraintNameEditPart extends PapyrusCompartmentEditPart i
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class IntervalConstraintNameEditPart extends PapyrusCompartmentEditPart i
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class IntervalConstraintNameEditPart extends PapyrusCompartmentEditPart i
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class IntervalConstraintNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class IntervalConstraintNameEditPart extends PapyrusCompartmentEditPart i
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class IntervalConstraintNameEditPart extends PapyrusCompartmentEditPart i
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class IntervalConstraintNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class IntervalConstraintNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.IntervalConstraint_2112, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.IntervalConstraintNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class IntervalConstraintNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class IntervalConstraintNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class IntervalConstraintNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class IntervalConstraintNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class IntervalConstraintNameEditPart extends PapyrusCompartmentEditPart i
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class IntervalConstraintNameEditPart extends PapyrusCompartmentEditPart i
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class IntervalConstraintNameEditPart extends PapyrusCompartmentEditPart i
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class IntervalConstraintNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class IntervalConstraintNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class IntervalConstraintNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class IntervalConstraintNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class IntervalConstraintNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class IntervalConstraintNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class IntervalConstraintNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class IntervalConstraintNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class IntervalConstraintNameEditPart extends PapyrusCompartmentEditPart i
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class IntervalConstraintNameEditPart extends PapyrusCompartmentEditPart i
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class IntervalConstraintNameEditPart extends PapyrusCompartmentEditPart i
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class IntervalConstraintNameEditPart extends PapyrusCompartmentEditPart i
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class IntervalConstraintNameEditPart extends PapyrusCompartmentEditPart i
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class IntervalConstraintNameEditPart extends PapyrusCompartmentEditPart i
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalConstraintNameEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalConstraintNameEditPartCN.java
index bcf69b2eb10..7ceed9a0a50 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalConstraintNameEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalConstraintNameEditPartCN.java
@@ -114,12 +114,14 @@ public class IntervalConstraintNameEditPartCN extends PapyrusCompartmentEditPart
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class IntervalConstraintNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class IntervalConstraintNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class IntervalConstraintNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class IntervalConstraintNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class IntervalConstraintNameEditPartCN extends PapyrusCompartmentEditPart
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class IntervalConstraintNameEditPartCN extends PapyrusCompartmentEditPart
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class IntervalConstraintNameEditPartCN extends PapyrusCompartmentEditPart
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class IntervalConstraintNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class IntervalConstraintNameEditPartCN extends PapyrusCompartmentEditPart
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class IntervalConstraintNameEditPartCN extends PapyrusCompartmentEditPart
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class IntervalConstraintNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class IntervalConstraintNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.IntervalConstraint_3118, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.IntervalConstraintNameEditPartCN.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class IntervalConstraintNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class IntervalConstraintNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class IntervalConstraintNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class IntervalConstraintNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class IntervalConstraintNameEditPartCN extends PapyrusCompartmentEditPart
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class IntervalConstraintNameEditPartCN extends PapyrusCompartmentEditPart
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class IntervalConstraintNameEditPartCN extends PapyrusCompartmentEditPart
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class IntervalConstraintNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class IntervalConstraintNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class IntervalConstraintNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class IntervalConstraintNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class IntervalConstraintNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class IntervalConstraintNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class IntervalConstraintNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class IntervalConstraintNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class IntervalConstraintNameEditPartCN extends PapyrusCompartmentEditPart
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class IntervalConstraintNameEditPartCN extends PapyrusCompartmentEditPart
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class IntervalConstraintNameEditPartCN extends PapyrusCompartmentEditPart
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class IntervalConstraintNameEditPartCN extends PapyrusCompartmentEditPart
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class IntervalConstraintNameEditPartCN extends PapyrusCompartmentEditPart
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class IntervalConstraintNameEditPartCN extends PapyrusCompartmentEditPart
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalConstraintSpecificationEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalConstraintSpecificationEditPart.java
index df4fc713d8b..fdce204bcbe 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalConstraintSpecificationEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalConstraintSpecificationEditPart.java
@@ -110,12 +110,14 @@ public class IntervalConstraintSpecificationEditPart extends PapyrusCompartmentE
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -141,12 +143,12 @@ public class IntervalConstraintSpecificationEditPart extends PapyrusCompartmentE
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -154,12 +156,12 @@ public class IntervalConstraintSpecificationEditPart extends PapyrusCompartmentE
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -167,12 +169,12 @@ public class IntervalConstraintSpecificationEditPart extends PapyrusCompartmentE
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -180,12 +182,12 @@ public class IntervalConstraintSpecificationEditPart extends PapyrusCompartmentE
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -241,10 +243,12 @@ public class IntervalConstraintSpecificationEditPart extends PapyrusCompartmentE
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -256,12 +260,12 @@ public class IntervalConstraintSpecificationEditPart extends PapyrusCompartmentE
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -269,10 +273,12 @@ public class IntervalConstraintSpecificationEditPart extends PapyrusCompartmentE
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -290,15 +296,16 @@ public class IntervalConstraintSpecificationEditPart extends PapyrusCompartmentE
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -306,6 +313,7 @@ public class IntervalConstraintSpecificationEditPart extends PapyrusCompartmentE
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -316,7 +324,7 @@ public class IntervalConstraintSpecificationEditPart extends PapyrusCompartmentE
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -333,7 +341,7 @@ public class IntervalConstraintSpecificationEditPart extends PapyrusCompartmentE
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.IntervalConstraint_2112, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.IntervalConstraintSpecificationEditPart.VISUAL_ID));
}
return parser;
@@ -343,8 +351,10 @@ public class IntervalConstraintSpecificationEditPart extends PapyrusCompartmentE
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -373,8 +383,8 @@ public class IntervalConstraintSpecificationEditPart extends PapyrusCompartmentE
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -382,8 +392,8 @@ public class IntervalConstraintSpecificationEditPart extends PapyrusCompartmentE
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -393,46 +403,52 @@ public class IntervalConstraintSpecificationEditPart extends PapyrusCompartmentE
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -454,12 +470,12 @@ public class IntervalConstraintSpecificationEditPart extends PapyrusCompartmentE
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -489,12 +505,12 @@ public class IntervalConstraintSpecificationEditPart extends PapyrusCompartmentE
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -503,12 +519,12 @@ public class IntervalConstraintSpecificationEditPart extends PapyrusCompartmentE
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -516,15 +532,16 @@ public class IntervalConstraintSpecificationEditPart extends PapyrusCompartmentE
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -533,9 +550,10 @@ public class IntervalConstraintSpecificationEditPart extends PapyrusCompartmentE
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -543,9 +561,12 @@ public class IntervalConstraintSpecificationEditPart extends PapyrusCompartmentE
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -561,11 +582,11 @@ public class IntervalConstraintSpecificationEditPart extends PapyrusCompartmentE
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -576,8 +597,8 @@ public class IntervalConstraintSpecificationEditPart extends PapyrusCompartmentE
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -589,7 +610,7 @@ public class IntervalConstraintSpecificationEditPart extends PapyrusCompartmentE
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -615,13 +636,14 @@ public class IntervalConstraintSpecificationEditPart extends PapyrusCompartmentE
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -633,8 +655,8 @@ public class IntervalConstraintSpecificationEditPart extends PapyrusCompartmentE
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -651,35 +673,40 @@ public class IntervalConstraintSpecificationEditPart extends PapyrusCompartmentE
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -689,12 +716,13 @@ public class IntervalConstraintSpecificationEditPart extends PapyrusCompartmentE
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -729,24 +757,25 @@ public class IntervalConstraintSpecificationEditPart extends PapyrusCompartmentE
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -781,7 +810,8 @@ public class IntervalConstraintSpecificationEditPart extends PapyrusCompartmentE
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -790,6 +820,7 @@ public class IntervalConstraintSpecificationEditPart extends PapyrusCompartmentE
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -797,5 +828,6 @@ public class IntervalConstraintSpecificationEditPart extends PapyrusCompartmentE
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalConstraintSpecificationEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalConstraintSpecificationEditPartCN.java
index 821db1170e9..b2bd51c31f7 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalConstraintSpecificationEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalConstraintSpecificationEditPartCN.java
@@ -110,12 +110,14 @@ public class IntervalConstraintSpecificationEditPartCN extends PapyrusCompartmen
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -141,12 +143,12 @@ public class IntervalConstraintSpecificationEditPartCN extends PapyrusCompartmen
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -154,12 +156,12 @@ public class IntervalConstraintSpecificationEditPartCN extends PapyrusCompartmen
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -167,12 +169,12 @@ public class IntervalConstraintSpecificationEditPartCN extends PapyrusCompartmen
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -180,12 +182,12 @@ public class IntervalConstraintSpecificationEditPartCN extends PapyrusCompartmen
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -241,10 +243,12 @@ public class IntervalConstraintSpecificationEditPartCN extends PapyrusCompartmen
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -256,12 +260,12 @@ public class IntervalConstraintSpecificationEditPartCN extends PapyrusCompartmen
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -269,10 +273,12 @@ public class IntervalConstraintSpecificationEditPartCN extends PapyrusCompartmen
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -290,15 +296,16 @@ public class IntervalConstraintSpecificationEditPartCN extends PapyrusCompartmen
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -306,6 +313,7 @@ public class IntervalConstraintSpecificationEditPartCN extends PapyrusCompartmen
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -316,7 +324,7 @@ public class IntervalConstraintSpecificationEditPartCN extends PapyrusCompartmen
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -333,7 +341,7 @@ public class IntervalConstraintSpecificationEditPartCN extends PapyrusCompartmen
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.IntervalConstraint_3118, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.IntervalConstraintSpecificationEditPartCN.VISUAL_ID));
}
return parser;
@@ -343,8 +351,10 @@ public class IntervalConstraintSpecificationEditPartCN extends PapyrusCompartmen
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -373,8 +383,8 @@ public class IntervalConstraintSpecificationEditPartCN extends PapyrusCompartmen
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -382,8 +392,8 @@ public class IntervalConstraintSpecificationEditPartCN extends PapyrusCompartmen
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -393,46 +403,52 @@ public class IntervalConstraintSpecificationEditPartCN extends PapyrusCompartmen
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -454,12 +470,12 @@ public class IntervalConstraintSpecificationEditPartCN extends PapyrusCompartmen
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -489,12 +505,12 @@ public class IntervalConstraintSpecificationEditPartCN extends PapyrusCompartmen
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -503,12 +519,12 @@ public class IntervalConstraintSpecificationEditPartCN extends PapyrusCompartmen
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -516,15 +532,16 @@ public class IntervalConstraintSpecificationEditPartCN extends PapyrusCompartmen
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -533,9 +550,10 @@ public class IntervalConstraintSpecificationEditPartCN extends PapyrusCompartmen
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -543,9 +561,12 @@ public class IntervalConstraintSpecificationEditPartCN extends PapyrusCompartmen
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -561,11 +582,11 @@ public class IntervalConstraintSpecificationEditPartCN extends PapyrusCompartmen
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -576,8 +597,8 @@ public class IntervalConstraintSpecificationEditPartCN extends PapyrusCompartmen
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -589,7 +610,7 @@ public class IntervalConstraintSpecificationEditPartCN extends PapyrusCompartmen
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -615,13 +636,14 @@ public class IntervalConstraintSpecificationEditPartCN extends PapyrusCompartmen
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -633,8 +655,8 @@ public class IntervalConstraintSpecificationEditPartCN extends PapyrusCompartmen
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -651,35 +673,40 @@ public class IntervalConstraintSpecificationEditPartCN extends PapyrusCompartmen
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -689,12 +716,13 @@ public class IntervalConstraintSpecificationEditPartCN extends PapyrusCompartmen
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -729,24 +757,25 @@ public class IntervalConstraintSpecificationEditPartCN extends PapyrusCompartmen
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -781,7 +810,8 @@ public class IntervalConstraintSpecificationEditPartCN extends PapyrusCompartmen
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -790,6 +820,7 @@ public class IntervalConstraintSpecificationEditPartCN extends PapyrusCompartmen
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -797,5 +828,6 @@ public class IntervalConstraintSpecificationEditPartCN extends PapyrusCompartmen
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalEditPart.java
index d28ff0c7c0b..9fe48b4788c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalEditPart.java
@@ -84,7 +84,9 @@ public class IntervalEditPart extends RoundedCompartmentEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
@@ -101,21 +103,21 @@ public class IntervalEditPart extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case IntervalFloatingLabelEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -135,8 +137,9 @@ public class IntervalEditPart extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -154,6 +157,7 @@ public class IntervalEditPart extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -165,20 +169,23 @@ public class IntervalEditPart extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure
+ *
* @generated
*/
public RoundedCompartmentFigure getPrimaryShape() {
- return (RoundedCompartmentFigure)primaryShape;
+ return (RoundedCompartmentFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof IntervalNameEditPart) {
- ((IntervalNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof IntervalNameEditPart) {
+ ((IntervalNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
+
+
return false;
}
@@ -186,7 +193,7 @@ public class IntervalEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof IntervalNameEditPart) {
+ if (childEditPart instanceof IntervalNameEditPart) {
return true;
}
return false;
@@ -196,7 +203,7 @@ public class IntervalEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -206,7 +213,7 @@ public class IntervalEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -216,7 +223,7 @@ public class IntervalEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -226,7 +233,7 @@ public class IntervalEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof IntervalFloatingLabelEditPart) {
+ if (borderItemEditPart instanceof IntervalFloatingLabelEditPart) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -249,16 +256,19 @@ public class IntervalEditPart extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -270,7 +280,7 @@ public class IntervalEditPart extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -280,7 +290,7 @@ public class IntervalEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -296,8 +306,8 @@ public class IntervalEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalFloatingLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalFloatingLabelEditPart.java
index f870d40d8a6..b5845a5ea7a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalFloatingLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalFloatingLabelEditPart.java
@@ -113,15 +113,18 @@ public class IntervalFloatingLabelEditPart extends FloatingLabelEditPart impleme
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class IntervalFloatingLabelEditPart extends FloatingLabelEditPart impleme
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class IntervalFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class IntervalFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class IntervalFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class IntervalFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class IntervalFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class IntervalFloatingLabelEditPart extends FloatingLabelEditPart impleme
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class IntervalFloatingLabelEditPart extends FloatingLabelEditPart impleme
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class IntervalFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class IntervalFloatingLabelEditPart extends FloatingLabelEditPart impleme
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class IntervalFloatingLabelEditPart extends FloatingLabelEditPart impleme
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class IntervalFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class IntervalFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Interval_2107, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.IntervalFloatingLabelEditPart.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class IntervalFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class IntervalFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class IntervalFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class IntervalFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class IntervalFloatingLabelEditPart extends FloatingLabelEditPart impleme
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class IntervalFloatingLabelEditPart extends FloatingLabelEditPart impleme
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class IntervalFloatingLabelEditPart extends FloatingLabelEditPart impleme
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class IntervalFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class IntervalFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class IntervalFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class IntervalFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class IntervalFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class IntervalFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class IntervalFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class IntervalFloatingLabelEditPart extends FloatingLabelEditPart impleme
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class IntervalFloatingLabelEditPart extends FloatingLabelEditPart impleme
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class IntervalFloatingLabelEditPart extends FloatingLabelEditPart impleme
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class IntervalFloatingLabelEditPart extends FloatingLabelEditPart impleme
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalNameEditPart.java
index 93873dc6303..15e43c9efcc 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/IntervalNameEditPart.java
@@ -114,12 +114,14 @@ public class IntervalNameEditPart extends PapyrusCompartmentEditPart implements
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class IntervalNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class IntervalNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class IntervalNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class IntervalNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class IntervalNameEditPart extends PapyrusCompartmentEditPart implements
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class IntervalNameEditPart extends PapyrusCompartmentEditPart implements
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class IntervalNameEditPart extends PapyrusCompartmentEditPart implements
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class IntervalNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class IntervalNameEditPart extends PapyrusCompartmentEditPart implements
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class IntervalNameEditPart extends PapyrusCompartmentEditPart implements
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class IntervalNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class IntervalNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Interval_2107, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.IntervalNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class IntervalNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class IntervalNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class IntervalNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class IntervalNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class IntervalNameEditPart extends PapyrusCompartmentEditPart implements
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class IntervalNameEditPart extends PapyrusCompartmentEditPart implements
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class IntervalNameEditPart extends PapyrusCompartmentEditPart implements
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class IntervalNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class IntervalNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class IntervalNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class IntervalNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class IntervalNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class IntervalNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class IntervalNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class IntervalNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class IntervalNameEditPart extends PapyrusCompartmentEditPart implements
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class IntervalNameEditPart extends PapyrusCompartmentEditPart implements
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class IntervalNameEditPart extends PapyrusCompartmentEditPart implements
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class IntervalNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class IntervalNameEditPart extends PapyrusCompartmentEditPart implements
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class IntervalNameEditPart extends PapyrusCompartmentEditPart implements
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LinkDescriptorEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LinkDescriptorEditPart.java
index efe52a9b810..a95b70559aa 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LinkDescriptorEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LinkDescriptorEditPart.java
@@ -62,6 +62,6 @@ public class LinkDescriptorEditPart extends ConnectionEditPart implements ITreeB
* @generated
*/
public SimpleDashedEdgeFigure getPrimaryShape() {
- return (SimpleDashedEdgeFigure)getFigure();
+ return (SimpleDashedEdgeFigure) getFigure();
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralBooleanEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralBooleanEditPart.java
index fc19ec3e648..9af29cf988f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralBooleanEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralBooleanEditPart.java
@@ -84,7 +84,9 @@ public class LiteralBooleanEditPart extends RoundedCompartmentEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
@@ -101,21 +103,21 @@ public class LiteralBooleanEditPart extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case LiteralBooleanFloatingLabelEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -135,8 +137,9 @@ public class LiteralBooleanEditPart extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -154,6 +157,7 @@ public class LiteralBooleanEditPart extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -165,20 +169,23 @@ public class LiteralBooleanEditPart extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure
+ *
* @generated
*/
public RoundedCompartmentFigure getPrimaryShape() {
- return (RoundedCompartmentFigure)primaryShape;
+ return (RoundedCompartmentFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof LiteralBooleanNameEditPart) {
- ((LiteralBooleanNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof LiteralBooleanNameEditPart) {
+ ((LiteralBooleanNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
+
+
return false;
}
@@ -186,7 +193,7 @@ public class LiteralBooleanEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof LiteralBooleanNameEditPart) {
+ if (childEditPart instanceof LiteralBooleanNameEditPart) {
return true;
}
return false;
@@ -196,7 +203,7 @@ public class LiteralBooleanEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -206,7 +213,7 @@ public class LiteralBooleanEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -216,7 +223,7 @@ public class LiteralBooleanEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -226,7 +233,7 @@ public class LiteralBooleanEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof LiteralBooleanFloatingLabelEditPart) {
+ if (borderItemEditPart instanceof LiteralBooleanFloatingLabelEditPart) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -249,16 +256,19 @@ public class LiteralBooleanEditPart extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -270,7 +280,7 @@ public class LiteralBooleanEditPart extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -280,7 +290,7 @@ public class LiteralBooleanEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -296,8 +306,8 @@ public class LiteralBooleanEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralBooleanFloatingLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralBooleanFloatingLabelEditPart.java
index 9bdb2f51ab4..bb9c6c29f17 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralBooleanFloatingLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralBooleanFloatingLabelEditPart.java
@@ -113,15 +113,18 @@ public class LiteralBooleanFloatingLabelEditPart extends FloatingLabelEditPart i
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class LiteralBooleanFloatingLabelEditPart extends FloatingLabelEditPart i
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class LiteralBooleanFloatingLabelEditPart extends FloatingLabelEditPart i
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class LiteralBooleanFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class LiteralBooleanFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class LiteralBooleanFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class LiteralBooleanFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class LiteralBooleanFloatingLabelEditPart extends FloatingLabelEditPart i
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class LiteralBooleanFloatingLabelEditPart extends FloatingLabelEditPart i
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class LiteralBooleanFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class LiteralBooleanFloatingLabelEditPart extends FloatingLabelEditPart i
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class LiteralBooleanFloatingLabelEditPart extends FloatingLabelEditPart i
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class LiteralBooleanFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class LiteralBooleanFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.LiteralBoolean_2095, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.LiteralBooleanFloatingLabelEditPart.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class LiteralBooleanFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class LiteralBooleanFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class LiteralBooleanFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class LiteralBooleanFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class LiteralBooleanFloatingLabelEditPart extends FloatingLabelEditPart i
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class LiteralBooleanFloatingLabelEditPart extends FloatingLabelEditPart i
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class LiteralBooleanFloatingLabelEditPart extends FloatingLabelEditPart i
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class LiteralBooleanFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class LiteralBooleanFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class LiteralBooleanFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class LiteralBooleanFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class LiteralBooleanFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class LiteralBooleanFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class LiteralBooleanFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class LiteralBooleanFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class LiteralBooleanFloatingLabelEditPart extends FloatingLabelEditPart i
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class LiteralBooleanFloatingLabelEditPart extends FloatingLabelEditPart i
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class LiteralBooleanFloatingLabelEditPart extends FloatingLabelEditPart i
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralBooleanNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralBooleanNameEditPart.java
index 613ee23fadd..183ecb9da6a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralBooleanNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralBooleanNameEditPart.java
@@ -114,12 +114,14 @@ public class LiteralBooleanNameEditPart extends PapyrusCompartmentEditPart imple
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class LiteralBooleanNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class LiteralBooleanNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class LiteralBooleanNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class LiteralBooleanNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class LiteralBooleanNameEditPart extends PapyrusCompartmentEditPart imple
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class LiteralBooleanNameEditPart extends PapyrusCompartmentEditPart imple
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class LiteralBooleanNameEditPart extends PapyrusCompartmentEditPart imple
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class LiteralBooleanNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class LiteralBooleanNameEditPart extends PapyrusCompartmentEditPart imple
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class LiteralBooleanNameEditPart extends PapyrusCompartmentEditPart imple
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class LiteralBooleanNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class LiteralBooleanNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.LiteralBoolean_2095, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.LiteralBooleanNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class LiteralBooleanNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class LiteralBooleanNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class LiteralBooleanNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class LiteralBooleanNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class LiteralBooleanNameEditPart extends PapyrusCompartmentEditPart imple
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class LiteralBooleanNameEditPart extends PapyrusCompartmentEditPart imple
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class LiteralBooleanNameEditPart extends PapyrusCompartmentEditPart imple
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class LiteralBooleanNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class LiteralBooleanNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class LiteralBooleanNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class LiteralBooleanNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class LiteralBooleanNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class LiteralBooleanNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class LiteralBooleanNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class LiteralBooleanNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class LiteralBooleanNameEditPart extends PapyrusCompartmentEditPart imple
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class LiteralBooleanNameEditPart extends PapyrusCompartmentEditPart imple
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class LiteralBooleanNameEditPart extends PapyrusCompartmentEditPart imple
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class LiteralBooleanNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class LiteralBooleanNameEditPart extends PapyrusCompartmentEditPart imple
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class LiteralBooleanNameEditPart extends PapyrusCompartmentEditPart imple
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralIntegerEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralIntegerEditPart.java
index 27f499e044b..4adba3250a5 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralIntegerEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralIntegerEditPart.java
@@ -84,7 +84,9 @@ public class LiteralIntegerEditPart extends RoundedCompartmentEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
@@ -101,21 +103,21 @@ public class LiteralIntegerEditPart extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case LiteralIntegerFloatingLabelEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -135,8 +137,9 @@ public class LiteralIntegerEditPart extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -154,6 +157,7 @@ public class LiteralIntegerEditPart extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -165,20 +169,23 @@ public class LiteralIntegerEditPart extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure
+ *
* @generated
*/
public RoundedCompartmentFigure getPrimaryShape() {
- return (RoundedCompartmentFigure)primaryShape;
+ return (RoundedCompartmentFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof LiteralIntegerNameEditPart) {
- ((LiteralIntegerNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof LiteralIntegerNameEditPart) {
+ ((LiteralIntegerNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
+
+
return false;
}
@@ -186,7 +193,7 @@ public class LiteralIntegerEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof LiteralIntegerNameEditPart) {
+ if (childEditPart instanceof LiteralIntegerNameEditPart) {
return true;
}
return false;
@@ -196,7 +203,7 @@ public class LiteralIntegerEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -206,7 +213,7 @@ public class LiteralIntegerEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -216,7 +223,7 @@ public class LiteralIntegerEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -226,7 +233,7 @@ public class LiteralIntegerEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof LiteralIntegerFloatingLabelEditPart) {
+ if (borderItemEditPart instanceof LiteralIntegerFloatingLabelEditPart) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -249,16 +256,19 @@ public class LiteralIntegerEditPart extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -270,7 +280,7 @@ public class LiteralIntegerEditPart extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -280,7 +290,7 @@ public class LiteralIntegerEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -296,8 +306,8 @@ public class LiteralIntegerEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralIntegerFloatingLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralIntegerFloatingLabelEditPart.java
index 2a0530ffeaa..82b63d94658 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralIntegerFloatingLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralIntegerFloatingLabelEditPart.java
@@ -113,15 +113,18 @@ public class LiteralIntegerFloatingLabelEditPart extends FloatingLabelEditPart i
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class LiteralIntegerFloatingLabelEditPart extends FloatingLabelEditPart i
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class LiteralIntegerFloatingLabelEditPart extends FloatingLabelEditPart i
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class LiteralIntegerFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class LiteralIntegerFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class LiteralIntegerFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class LiteralIntegerFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class LiteralIntegerFloatingLabelEditPart extends FloatingLabelEditPart i
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class LiteralIntegerFloatingLabelEditPart extends FloatingLabelEditPart i
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class LiteralIntegerFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class LiteralIntegerFloatingLabelEditPart extends FloatingLabelEditPart i
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class LiteralIntegerFloatingLabelEditPart extends FloatingLabelEditPart i
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class LiteralIntegerFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class LiteralIntegerFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.LiteralInteger_2096, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.LiteralIntegerFloatingLabelEditPart.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class LiteralIntegerFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class LiteralIntegerFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class LiteralIntegerFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class LiteralIntegerFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class LiteralIntegerFloatingLabelEditPart extends FloatingLabelEditPart i
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class LiteralIntegerFloatingLabelEditPart extends FloatingLabelEditPart i
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class LiteralIntegerFloatingLabelEditPart extends FloatingLabelEditPart i
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class LiteralIntegerFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class LiteralIntegerFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class LiteralIntegerFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class LiteralIntegerFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class LiteralIntegerFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class LiteralIntegerFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class LiteralIntegerFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class LiteralIntegerFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class LiteralIntegerFloatingLabelEditPart extends FloatingLabelEditPart i
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class LiteralIntegerFloatingLabelEditPart extends FloatingLabelEditPart i
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class LiteralIntegerFloatingLabelEditPart extends FloatingLabelEditPart i
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralIntegerNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralIntegerNameEditPart.java
index 09c63415420..57740320880 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralIntegerNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralIntegerNameEditPart.java
@@ -114,12 +114,14 @@ public class LiteralIntegerNameEditPart extends PapyrusCompartmentEditPart imple
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class LiteralIntegerNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class LiteralIntegerNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class LiteralIntegerNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class LiteralIntegerNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class LiteralIntegerNameEditPart extends PapyrusCompartmentEditPart imple
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class LiteralIntegerNameEditPart extends PapyrusCompartmentEditPart imple
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class LiteralIntegerNameEditPart extends PapyrusCompartmentEditPart imple
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class LiteralIntegerNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class LiteralIntegerNameEditPart extends PapyrusCompartmentEditPart imple
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class LiteralIntegerNameEditPart extends PapyrusCompartmentEditPart imple
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class LiteralIntegerNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class LiteralIntegerNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.LiteralInteger_2096, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.LiteralIntegerNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class LiteralIntegerNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class LiteralIntegerNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class LiteralIntegerNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class LiteralIntegerNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class LiteralIntegerNameEditPart extends PapyrusCompartmentEditPart imple
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class LiteralIntegerNameEditPart extends PapyrusCompartmentEditPart imple
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class LiteralIntegerNameEditPart extends PapyrusCompartmentEditPart imple
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class LiteralIntegerNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class LiteralIntegerNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class LiteralIntegerNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class LiteralIntegerNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class LiteralIntegerNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class LiteralIntegerNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class LiteralIntegerNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class LiteralIntegerNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class LiteralIntegerNameEditPart extends PapyrusCompartmentEditPart imple
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class LiteralIntegerNameEditPart extends PapyrusCompartmentEditPart imple
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class LiteralIntegerNameEditPart extends PapyrusCompartmentEditPart imple
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class LiteralIntegerNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class LiteralIntegerNameEditPart extends PapyrusCompartmentEditPart imple
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class LiteralIntegerNameEditPart extends PapyrusCompartmentEditPart imple
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralNullEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralNullEditPart.java
index e3454f4b523..66ec485f448 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralNullEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralNullEditPart.java
@@ -84,7 +84,9 @@ public class LiteralNullEditPart extends RoundedCompartmentEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
@@ -101,21 +103,21 @@ public class LiteralNullEditPart extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case LiteralNullFloatingLabelEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -135,8 +137,9 @@ public class LiteralNullEditPart extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -154,6 +157,7 @@ public class LiteralNullEditPart extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -165,20 +169,23 @@ public class LiteralNullEditPart extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure
+ *
* @generated
*/
public RoundedCompartmentFigure getPrimaryShape() {
- return (RoundedCompartmentFigure)primaryShape;
+ return (RoundedCompartmentFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof LiteralNullNameEditPart) {
- ((LiteralNullNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof LiteralNullNameEditPart) {
+ ((LiteralNullNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
+
+
return false;
}
@@ -186,7 +193,7 @@ public class LiteralNullEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof LiteralNullNameEditPart) {
+ if (childEditPart instanceof LiteralNullNameEditPart) {
return true;
}
return false;
@@ -196,7 +203,7 @@ public class LiteralNullEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -206,7 +213,7 @@ public class LiteralNullEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -216,7 +223,7 @@ public class LiteralNullEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -226,7 +233,7 @@ public class LiteralNullEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof LiteralNullFloatingLabelEditPart) {
+ if (borderItemEditPart instanceof LiteralNullFloatingLabelEditPart) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -249,16 +256,19 @@ public class LiteralNullEditPart extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -270,7 +280,7 @@ public class LiteralNullEditPart extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -280,7 +290,7 @@ public class LiteralNullEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -296,8 +306,8 @@ public class LiteralNullEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralNullFloatingLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralNullFloatingLabelEditPart.java
index 615b81ebe33..5625159d720 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralNullFloatingLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralNullFloatingLabelEditPart.java
@@ -113,15 +113,18 @@ public class LiteralNullFloatingLabelEditPart extends FloatingLabelEditPart impl
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class LiteralNullFloatingLabelEditPart extends FloatingLabelEditPart impl
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class LiteralNullFloatingLabelEditPart extends FloatingLabelEditPart impl
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class LiteralNullFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class LiteralNullFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class LiteralNullFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class LiteralNullFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class LiteralNullFloatingLabelEditPart extends FloatingLabelEditPart impl
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class LiteralNullFloatingLabelEditPart extends FloatingLabelEditPart impl
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class LiteralNullFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class LiteralNullFloatingLabelEditPart extends FloatingLabelEditPart impl
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class LiteralNullFloatingLabelEditPart extends FloatingLabelEditPart impl
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class LiteralNullFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class LiteralNullFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.LiteralNull_2097, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.LiteralNullFloatingLabelEditPart.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class LiteralNullFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class LiteralNullFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class LiteralNullFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class LiteralNullFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class LiteralNullFloatingLabelEditPart extends FloatingLabelEditPart impl
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class LiteralNullFloatingLabelEditPart extends FloatingLabelEditPart impl
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class LiteralNullFloatingLabelEditPart extends FloatingLabelEditPart impl
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class LiteralNullFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class LiteralNullFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class LiteralNullFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class LiteralNullFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class LiteralNullFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class LiteralNullFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class LiteralNullFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class LiteralNullFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class LiteralNullFloatingLabelEditPart extends FloatingLabelEditPart impl
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class LiteralNullFloatingLabelEditPart extends FloatingLabelEditPart impl
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class LiteralNullFloatingLabelEditPart extends FloatingLabelEditPart impl
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralNullNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralNullNameEditPart.java
index 52e9174196d..bb5dd1e02a7 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralNullNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralNullNameEditPart.java
@@ -114,12 +114,14 @@ public class LiteralNullNameEditPart extends PapyrusCompartmentEditPart implemen
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class LiteralNullNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class LiteralNullNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class LiteralNullNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class LiteralNullNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class LiteralNullNameEditPart extends PapyrusCompartmentEditPart implemen
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class LiteralNullNameEditPart extends PapyrusCompartmentEditPart implemen
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class LiteralNullNameEditPart extends PapyrusCompartmentEditPart implemen
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class LiteralNullNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class LiteralNullNameEditPart extends PapyrusCompartmentEditPart implemen
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class LiteralNullNameEditPart extends PapyrusCompartmentEditPart implemen
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class LiteralNullNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class LiteralNullNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.LiteralNull_2097, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.LiteralNullNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class LiteralNullNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class LiteralNullNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class LiteralNullNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class LiteralNullNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class LiteralNullNameEditPart extends PapyrusCompartmentEditPart implemen
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class LiteralNullNameEditPart extends PapyrusCompartmentEditPart implemen
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class LiteralNullNameEditPart extends PapyrusCompartmentEditPart implemen
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class LiteralNullNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class LiteralNullNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class LiteralNullNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class LiteralNullNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class LiteralNullNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class LiteralNullNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class LiteralNullNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class LiteralNullNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class LiteralNullNameEditPart extends PapyrusCompartmentEditPart implemen
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class LiteralNullNameEditPart extends PapyrusCompartmentEditPart implemen
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class LiteralNullNameEditPart extends PapyrusCompartmentEditPart implemen
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class LiteralNullNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class LiteralNullNameEditPart extends PapyrusCompartmentEditPart implemen
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class LiteralNullNameEditPart extends PapyrusCompartmentEditPart implemen
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralStringEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralStringEditPart.java
index b56af8b5362..d9463b7935f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralStringEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralStringEditPart.java
@@ -84,7 +84,9 @@ public class LiteralStringEditPart extends RoundedCompartmentEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
@@ -101,21 +103,21 @@ public class LiteralStringEditPart extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case LiteralStringFloatingLabelEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -135,8 +137,9 @@ public class LiteralStringEditPart extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -154,6 +157,7 @@ public class LiteralStringEditPart extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -165,20 +169,23 @@ public class LiteralStringEditPart extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure
+ *
* @generated
*/
public RoundedCompartmentFigure getPrimaryShape() {
- return (RoundedCompartmentFigure)primaryShape;
+ return (RoundedCompartmentFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof LiteralStringNameEditPart) {
- ((LiteralStringNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof LiteralStringNameEditPart) {
+ ((LiteralStringNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
+
+
return false;
}
@@ -186,7 +193,7 @@ public class LiteralStringEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof LiteralStringNameEditPart) {
+ if (childEditPart instanceof LiteralStringNameEditPart) {
return true;
}
return false;
@@ -196,7 +203,7 @@ public class LiteralStringEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -206,7 +213,7 @@ public class LiteralStringEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -216,7 +223,7 @@ public class LiteralStringEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -226,7 +233,7 @@ public class LiteralStringEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof LiteralStringFloatingLabelEditPart) {
+ if (borderItemEditPart instanceof LiteralStringFloatingLabelEditPart) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -249,16 +256,19 @@ public class LiteralStringEditPart extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -270,7 +280,7 @@ public class LiteralStringEditPart extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -280,7 +290,7 @@ public class LiteralStringEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -296,8 +306,8 @@ public class LiteralStringEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralStringFloatingLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralStringFloatingLabelEditPart.java
index 1f99c4c8f29..7d6bef35f1b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralStringFloatingLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralStringFloatingLabelEditPart.java
@@ -113,15 +113,18 @@ public class LiteralStringFloatingLabelEditPart extends FloatingLabelEditPart im
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class LiteralStringFloatingLabelEditPart extends FloatingLabelEditPart im
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class LiteralStringFloatingLabelEditPart extends FloatingLabelEditPart im
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class LiteralStringFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class LiteralStringFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class LiteralStringFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class LiteralStringFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class LiteralStringFloatingLabelEditPart extends FloatingLabelEditPart im
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class LiteralStringFloatingLabelEditPart extends FloatingLabelEditPart im
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class LiteralStringFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class LiteralStringFloatingLabelEditPart extends FloatingLabelEditPart im
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class LiteralStringFloatingLabelEditPart extends FloatingLabelEditPart im
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class LiteralStringFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class LiteralStringFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.LiteralString_2098, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.LiteralStringFloatingLabelEditPart.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class LiteralStringFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class LiteralStringFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class LiteralStringFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class LiteralStringFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class LiteralStringFloatingLabelEditPart extends FloatingLabelEditPart im
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class LiteralStringFloatingLabelEditPart extends FloatingLabelEditPart im
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class LiteralStringFloatingLabelEditPart extends FloatingLabelEditPart im
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class LiteralStringFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class LiteralStringFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class LiteralStringFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class LiteralStringFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class LiteralStringFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class LiteralStringFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class LiteralStringFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class LiteralStringFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class LiteralStringFloatingLabelEditPart extends FloatingLabelEditPart im
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class LiteralStringFloatingLabelEditPart extends FloatingLabelEditPart im
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class LiteralStringFloatingLabelEditPart extends FloatingLabelEditPart im
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralStringNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralStringNameEditPart.java
index bc62dfd7176..b31a2ab3c18 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralStringNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralStringNameEditPart.java
@@ -114,12 +114,14 @@ public class LiteralStringNameEditPart extends PapyrusCompartmentEditPart implem
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class LiteralStringNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class LiteralStringNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class LiteralStringNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class LiteralStringNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class LiteralStringNameEditPart extends PapyrusCompartmentEditPart implem
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class LiteralStringNameEditPart extends PapyrusCompartmentEditPart implem
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class LiteralStringNameEditPart extends PapyrusCompartmentEditPart implem
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class LiteralStringNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class LiteralStringNameEditPart extends PapyrusCompartmentEditPart implem
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class LiteralStringNameEditPart extends PapyrusCompartmentEditPart implem
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class LiteralStringNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class LiteralStringNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.LiteralString_2098, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.LiteralStringNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class LiteralStringNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class LiteralStringNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class LiteralStringNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class LiteralStringNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class LiteralStringNameEditPart extends PapyrusCompartmentEditPart implem
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class LiteralStringNameEditPart extends PapyrusCompartmentEditPart implem
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class LiteralStringNameEditPart extends PapyrusCompartmentEditPart implem
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class LiteralStringNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class LiteralStringNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class LiteralStringNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class LiteralStringNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class LiteralStringNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class LiteralStringNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class LiteralStringNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class LiteralStringNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class LiteralStringNameEditPart extends PapyrusCompartmentEditPart implem
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class LiteralStringNameEditPart extends PapyrusCompartmentEditPart implem
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class LiteralStringNameEditPart extends PapyrusCompartmentEditPart implem
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class LiteralStringNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class LiteralStringNameEditPart extends PapyrusCompartmentEditPart implem
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class LiteralStringNameEditPart extends PapyrusCompartmentEditPart implem
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralUnlimitedNaturalEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralUnlimitedNaturalEditPart.java
index 0f980bd7731..2d7f601e568 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralUnlimitedNaturalEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralUnlimitedNaturalEditPart.java
@@ -84,7 +84,9 @@ public class LiteralUnlimitedNaturalEditPart extends RoundedCompartmentEditPart
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
@@ -101,21 +103,21 @@ public class LiteralUnlimitedNaturalEditPart extends RoundedCompartmentEditPart
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case LiteralUnlimitedNaturalFloatingLabelEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -135,8 +137,9 @@ public class LiteralUnlimitedNaturalEditPart extends RoundedCompartmentEditPart
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -154,6 +157,7 @@ public class LiteralUnlimitedNaturalEditPart extends RoundedCompartmentEditPart
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -165,20 +169,23 @@ public class LiteralUnlimitedNaturalEditPart extends RoundedCompartmentEditPart
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure
+ *
* @generated
*/
public RoundedCompartmentFigure getPrimaryShape() {
- return (RoundedCompartmentFigure)primaryShape;
+ return (RoundedCompartmentFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof LiteralUnlimitedNaturalNameEditPart) {
- ((LiteralUnlimitedNaturalNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof LiteralUnlimitedNaturalNameEditPart) {
+ ((LiteralUnlimitedNaturalNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
+
+
return false;
}
@@ -186,7 +193,7 @@ public class LiteralUnlimitedNaturalEditPart extends RoundedCompartmentEditPart
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof LiteralUnlimitedNaturalNameEditPart) {
+ if (childEditPart instanceof LiteralUnlimitedNaturalNameEditPart) {
return true;
}
return false;
@@ -196,7 +203,7 @@ public class LiteralUnlimitedNaturalEditPart extends RoundedCompartmentEditPart
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -206,7 +213,7 @@ public class LiteralUnlimitedNaturalEditPart extends RoundedCompartmentEditPart
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -216,7 +223,7 @@ public class LiteralUnlimitedNaturalEditPart extends RoundedCompartmentEditPart
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -226,7 +233,7 @@ public class LiteralUnlimitedNaturalEditPart extends RoundedCompartmentEditPart
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof LiteralUnlimitedNaturalFloatingLabelEditPart) {
+ if (borderItemEditPart instanceof LiteralUnlimitedNaturalFloatingLabelEditPart) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -249,16 +256,19 @@ public class LiteralUnlimitedNaturalEditPart extends RoundedCompartmentEditPart
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -270,7 +280,7 @@ public class LiteralUnlimitedNaturalEditPart extends RoundedCompartmentEditPart
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -280,7 +290,7 @@ public class LiteralUnlimitedNaturalEditPart extends RoundedCompartmentEditPart
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -296,8 +306,8 @@ public class LiteralUnlimitedNaturalEditPart extends RoundedCompartmentEditPart
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralUnlimitedNaturalFloatingLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralUnlimitedNaturalFloatingLabelEditPart.java
index c1e8dc728f5..f22c8aa498a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralUnlimitedNaturalFloatingLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralUnlimitedNaturalFloatingLabelEditPart.java
@@ -113,15 +113,18 @@ public class LiteralUnlimitedNaturalFloatingLabelEditPart extends FloatingLabelE
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class LiteralUnlimitedNaturalFloatingLabelEditPart extends FloatingLabelE
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class LiteralUnlimitedNaturalFloatingLabelEditPart extends FloatingLabelE
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class LiteralUnlimitedNaturalFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class LiteralUnlimitedNaturalFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class LiteralUnlimitedNaturalFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class LiteralUnlimitedNaturalFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class LiteralUnlimitedNaturalFloatingLabelEditPart extends FloatingLabelE
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class LiteralUnlimitedNaturalFloatingLabelEditPart extends FloatingLabelE
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class LiteralUnlimitedNaturalFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class LiteralUnlimitedNaturalFloatingLabelEditPart extends FloatingLabelE
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class LiteralUnlimitedNaturalFloatingLabelEditPart extends FloatingLabelE
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class LiteralUnlimitedNaturalFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class LiteralUnlimitedNaturalFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.LiteralUnlimitedNatural_2099, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.LiteralUnlimitedNaturalFloatingLabelEditPart.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class LiteralUnlimitedNaturalFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class LiteralUnlimitedNaturalFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class LiteralUnlimitedNaturalFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class LiteralUnlimitedNaturalFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class LiteralUnlimitedNaturalFloatingLabelEditPart extends FloatingLabelE
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class LiteralUnlimitedNaturalFloatingLabelEditPart extends FloatingLabelE
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class LiteralUnlimitedNaturalFloatingLabelEditPart extends FloatingLabelE
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class LiteralUnlimitedNaturalFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class LiteralUnlimitedNaturalFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class LiteralUnlimitedNaturalFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class LiteralUnlimitedNaturalFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class LiteralUnlimitedNaturalFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class LiteralUnlimitedNaturalFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class LiteralUnlimitedNaturalFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class LiteralUnlimitedNaturalFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class LiteralUnlimitedNaturalFloatingLabelEditPart extends FloatingLabelE
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class LiteralUnlimitedNaturalFloatingLabelEditPart extends FloatingLabelE
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class LiteralUnlimitedNaturalFloatingLabelEditPart extends FloatingLabelE
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralUnlimitedNaturalNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralUnlimitedNaturalNameEditPart.java
index 448dd7fd6d8..159c3ebf4c5 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralUnlimitedNaturalNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/LiteralUnlimitedNaturalNameEditPart.java
@@ -114,12 +114,14 @@ public class LiteralUnlimitedNaturalNameEditPart extends PapyrusCompartmentEditP
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class LiteralUnlimitedNaturalNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class LiteralUnlimitedNaturalNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class LiteralUnlimitedNaturalNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class LiteralUnlimitedNaturalNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class LiteralUnlimitedNaturalNameEditPart extends PapyrusCompartmentEditP
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class LiteralUnlimitedNaturalNameEditPart extends PapyrusCompartmentEditP
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class LiteralUnlimitedNaturalNameEditPart extends PapyrusCompartmentEditP
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class LiteralUnlimitedNaturalNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class LiteralUnlimitedNaturalNameEditPart extends PapyrusCompartmentEditP
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class LiteralUnlimitedNaturalNameEditPart extends PapyrusCompartmentEditP
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class LiteralUnlimitedNaturalNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class LiteralUnlimitedNaturalNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.LiteralUnlimitedNatural_2099, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.LiteralUnlimitedNaturalNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class LiteralUnlimitedNaturalNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class LiteralUnlimitedNaturalNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class LiteralUnlimitedNaturalNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class LiteralUnlimitedNaturalNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class LiteralUnlimitedNaturalNameEditPart extends PapyrusCompartmentEditP
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class LiteralUnlimitedNaturalNameEditPart extends PapyrusCompartmentEditP
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class LiteralUnlimitedNaturalNameEditPart extends PapyrusCompartmentEditP
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class LiteralUnlimitedNaturalNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class LiteralUnlimitedNaturalNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class LiteralUnlimitedNaturalNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class LiteralUnlimitedNaturalNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class LiteralUnlimitedNaturalNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class LiteralUnlimitedNaturalNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class LiteralUnlimitedNaturalNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class LiteralUnlimitedNaturalNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class LiteralUnlimitedNaturalNameEditPart extends PapyrusCompartmentEditP
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class LiteralUnlimitedNaturalNameEditPart extends PapyrusCompartmentEditP
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class LiteralUnlimitedNaturalNameEditPart extends PapyrusCompartmentEditP
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class LiteralUnlimitedNaturalNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class LiteralUnlimitedNaturalNameEditPart extends PapyrusCompartmentEditP
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class LiteralUnlimitedNaturalNameEditPart extends PapyrusCompartmentEditP
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ManifestationAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ManifestationAppliedStereotypeEditPart.java
index 41da999169f..6f6001a0944 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ManifestationAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ManifestationAppliedStereotypeEditPart.java
@@ -123,6 +123,7 @@ public class ManifestationAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -211,8 +212,7 @@ public class ManifestationAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
- public void setLabel(IFigure
- figure) {
+ public void setLabel(IFigure figure) {
unregisterVisuals();
setFigure(figure);
defaultText = getLabelTextHelper(figure);
@@ -324,15 +324,14 @@ public class ManifestationAppliedStereotypeEditPart extends PapyrusLabelEditPart
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid =
- (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
@@ -461,8 +460,7 @@ public class ManifestationAppliedStereotypeEditPart extends PapyrusLabelEditPart
IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- }
- else if (configuration instanceof IAdvancedEditorConfiguration) {
+ } 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);
@@ -507,8 +505,7 @@ public class ManifestationAppliedStereotypeEditPart extends PapyrusLabelEditPart
RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- }
- else {
+ } else {
performDirectEdit();
}
}
@@ -558,17 +555,15 @@ public class ManifestationAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected void refreshUnderline() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
if (resolveSemanticElement() instanceof Feature) {
if (((Feature) resolveSemanticElement()).isStatic()) {
((WrappingLabel) getFigure()).setTextUnderline(true);
- }
- else {
+ } else {
((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
@@ -578,9 +573,8 @@ public class ManifestationAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
@@ -591,14 +585,12 @@ public class ManifestationAppliedStereotypeEditPart extends PapyrusLabelEditPart
*/
@Override
protected void refreshFont() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ 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));
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -684,7 +676,7 @@ public class ManifestationAppliedStereotypeEditPart extends PapyrusLabelEditPart
*/
protected boolean checkExtendedEditor() {
if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -708,9 +700,9 @@ public class ManifestationAppliedStereotypeEditPart extends PapyrusLabelEditPart
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());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
@@ -724,8 +716,7 @@ public class ManifestationAppliedStereotypeEditPart extends PapyrusLabelEditPart
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement()
- .eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
@@ -777,18 +768,15 @@ public class ManifestationAppliedStereotypeEditPart extends PapyrusLabelEditPart
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)) {
+ } 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();
+ ISemanticParser modelParser = (ISemanticParser) getParser();
if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
if (resolveSemanticElement() != null) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ManifestationEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ManifestationEditPart.java
index 7f8c57d4368..c31c66cdb3b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ManifestationEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ManifestationEditPart.java
@@ -52,10 +52,12 @@ public class ManifestationEditPart extends UMLConnectionNodeEditPart implements
*/
protected boolean addFixedChild(EditPart childEditPart) {
if (childEditPart instanceof ManifestationNameEditPart) {
- ((ManifestationNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ ((ManifestationNameEditPart) childEditPart).setLabel(
+ getPrimaryShape().getNameLabel());
}
if (childEditPart instanceof ManifestationAppliedStereotypeEditPart) {
- ((ManifestationAppliedStereotypeEditPart) childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
+ ((ManifestationAppliedStereotypeEditPart) childEditPart).setLabel(
+ getPrimaryShape().getAppliedStereotypeLabel());
}
return false;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ManifestationNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ManifestationNameEditPart.java
index 2690a97fea6..8a9cc4a85ce 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ManifestationNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ManifestationNameEditPart.java
@@ -123,6 +123,7 @@ public class ManifestationNameEditPart extends PapyrusLabelEditPart implements I
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -211,8 +212,7 @@ public class ManifestationNameEditPart extends PapyrusLabelEditPart implements I
/**
* @generated
*/
- public void setLabel(IFigure
- figure) {
+ public void setLabel(IFigure figure) {
unregisterVisuals();
setFigure(figure);
defaultText = getLabelTextHelper(figure);
@@ -324,15 +324,14 @@ public class ManifestationNameEditPart extends PapyrusLabelEditPart implements I
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid =
- (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
@@ -461,8 +460,7 @@ public class ManifestationNameEditPart extends PapyrusLabelEditPart implements I
IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- }
- else if (configuration instanceof IAdvancedEditorConfiguration) {
+ } 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);
@@ -507,8 +505,7 @@ public class ManifestationNameEditPart extends PapyrusLabelEditPart implements I
RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- }
- else {
+ } else {
performDirectEdit();
}
}
@@ -558,17 +555,15 @@ public class ManifestationNameEditPart extends PapyrusLabelEditPart implements I
* @generated
*/
protected void refreshUnderline() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
if (resolveSemanticElement() instanceof Feature) {
if (((Feature) resolveSemanticElement()).isStatic()) {
((WrappingLabel) getFigure()).setTextUnderline(true);
- }
- else {
+ } else {
((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
@@ -578,9 +573,8 @@ public class ManifestationNameEditPart extends PapyrusLabelEditPart implements I
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
@@ -591,14 +585,12 @@ public class ManifestationNameEditPart extends PapyrusLabelEditPart implements I
*/
@Override
protected void refreshFont() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ 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));
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -692,7 +684,7 @@ public class ManifestationNameEditPart extends PapyrusLabelEditPart implements I
*/
protected boolean checkExtendedEditor() {
if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -716,9 +708,9 @@ public class ManifestationNameEditPart extends PapyrusLabelEditPart implements I
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());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
@@ -732,8 +724,7 @@ public class ManifestationNameEditPart extends PapyrusLabelEditPart implements I
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement()
- .eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
@@ -785,18 +776,15 @@ public class ManifestationNameEditPart extends PapyrusLabelEditPart implements I
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)) {
+ } 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();
+ ISemanticParser modelParser = (ISemanticParser) getParser();
if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
if (resolveSemanticElement() != null) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/NodeCompositeCompartmentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/NodeCompositeCompartmentEditPart.java
index 20349a589de..879c2a8980f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/NodeCompositeCompartmentEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/NodeCompositeCompartmentEditPart.java
@@ -81,7 +81,7 @@ public class NodeCompositeCompartmentEditPart extends LinkLFShapeCompartmentEdit
* @generated
*/
protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
+ if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
super.setRatio(ratio);
}
}
@@ -90,6 +90,7 @@ public class NodeCompositeCompartmentEditPart extends LinkLFShapeCompartmentEdit
* @generated
*/
public EditPart getTargetEditPart(Request request) {
+
return super.getTargetEditPart(request);
}
@@ -98,7 +99,10 @@ public class NodeCompositeCompartmentEditPart extends LinkLFShapeCompartmentEdit
*/
protected void handleNotificationEvent(Notification notification) {
Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
+ if (NotationPackage.eINSTANCE.getSize_Width().equals(feature)
+ || NotationPackage.eINSTANCE.getSize_Height().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_X().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
refreshBounds();
}
super.handleNotificationEvent(notification);
@@ -108,13 +112,16 @@ public class NodeCompositeCompartmentEditPart extends LinkLFShapeCompartmentEdit
* @generated
*/
protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
+ ((GraphicalEditPart) getParent()).setLayoutConstraint(
+ this,
+ getFigure(),
+ new Rectangle(loc, size));
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/NodeCompositeCompartmentEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/NodeCompositeCompartmentEditPartCN.java
index 914bf884d5c..2de8f55def6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/NodeCompositeCompartmentEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/NodeCompositeCompartmentEditPartCN.java
@@ -81,7 +81,7 @@ public class NodeCompositeCompartmentEditPartCN extends LinkLFShapeCompartmentEd
* @generated
*/
protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
+ if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
super.setRatio(ratio);
}
}
@@ -90,6 +90,7 @@ public class NodeCompositeCompartmentEditPartCN extends LinkLFShapeCompartmentEd
* @generated
*/
public EditPart getTargetEditPart(Request request) {
+
return super.getTargetEditPart(request);
}
@@ -98,7 +99,10 @@ public class NodeCompositeCompartmentEditPartCN extends LinkLFShapeCompartmentEd
*/
protected void handleNotificationEvent(Notification notification) {
Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
+ if (NotationPackage.eINSTANCE.getSize_Width().equals(feature)
+ || NotationPackage.eINSTANCE.getSize_Height().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_X().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
refreshBounds();
}
super.handleNotificationEvent(notification);
@@ -108,13 +112,16 @@ public class NodeCompositeCompartmentEditPartCN extends LinkLFShapeCompartmentEd
* @generated
*/
protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
+ ((GraphicalEditPart) getParent()).setLayoutConstraint(
+ this,
+ getFigure(),
+ new Rectangle(loc, size));
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/NodeCompositeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/NodeCompositeEditPart.java
index 3b361b121d2..1c3fe362191 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/NodeCompositeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/NodeCompositeEditPart.java
@@ -96,7 +96,9 @@ public class NodeCompositeEditPart extends RoundedCompartmentEditPart {
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new DefaultCreationEditPolicy());
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
@@ -120,14 +122,14 @@ public class NodeCompositeEditPart extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case NodeCompositeFloatingLabelEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
@@ -136,7 +138,7 @@ public class NodeCompositeEditPart extends RoundedCompartmentEditPart {
return new BorderItemResizableEditPolicy();
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -156,8 +158,9 @@ public class NodeCompositeEditPart extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -175,6 +178,7 @@ public class NodeCompositeEditPart extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -186,32 +190,40 @@ public class NodeCompositeEditPart extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.composite.custom.figures.NodeCompositeFigure
+ *
* @generated
*/
public NodeCompositeFigure getPrimaryShape() {
- return (NodeCompositeFigure)primaryShape;
+ return (NodeCompositeFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof NodeCompositeNameEditPart) {
- ((NodeCompositeNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof NodeCompositeNameEditPart) {
+ ((NodeCompositeNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
- if(childEditPart instanceof NodeCompositeCompartmentEditPart) {
+
+
+ if (childEditPart instanceof NodeCompositeCompartmentEditPart) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((NodeCompositeCompartmentEditPart)childEditPart).getFigure());
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.add(((NodeCompositeCompartmentEditPart) childEditPart).getFigure());
return true;
}
- //Papyrus Gencode :Affixed Port locator
- if(childEditPart instanceof PortEditPart) {
+
+
+
+ // Papyrus Gencode :Affixed Port locator
+ if (childEditPart instanceof PortEditPart) {
IBorderItemLocator locator = new PortPositionLocator(getMainFigure(), PositionConstants.NONE);
- getBorderedFigure().getBorderItemContainer().add(((PortEditPart)childEditPart).getFigure(), locator);
+ getBorderedFigure().getBorderItemContainer().add(((PortEditPart) childEditPart).getFigure(), locator);
return true;
}
+
+
return false;
}
@@ -219,16 +231,16 @@ public class NodeCompositeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof NodeCompositeNameEditPart) {
+ if (childEditPart instanceof NodeCompositeNameEditPart) {
return true;
}
- if(childEditPart instanceof NodeCompositeCompartmentEditPart) {
+ if (childEditPart instanceof NodeCompositeCompartmentEditPart) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- pane.remove(((NodeCompositeCompartmentEditPart)childEditPart).getFigure());
+ pane.remove(((NodeCompositeCompartmentEditPart) childEditPart).getFigure());
return true;
}
- if(childEditPart instanceof PortEditPart) {
- getBorderedFigure().getBorderItemContainer().remove(((PortEditPart)childEditPart).getFigure());
+ if (childEditPart instanceof PortEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((PortEditPart) childEditPart).getFigure());
return true;
}
return false;
@@ -238,7 +250,7 @@ public class NodeCompositeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -248,7 +260,7 @@ public class NodeCompositeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -258,10 +270,10 @@ public class NodeCompositeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof NodeCompositeCompartmentEditPart) {
+ if (editPart instanceof NodeCompositeCompartmentEditPart) {
return getPrimaryShape().getCompositeCompartmentFigure();
}
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -271,7 +283,7 @@ public class NodeCompositeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof NodeCompositeFloatingLabelEditPart) {
+ if (borderItemEditPart instanceof NodeCompositeFloatingLabelEditPart) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -294,16 +306,19 @@ public class NodeCompositeEditPart extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -315,7 +330,7 @@ public class NodeCompositeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -325,7 +340,7 @@ public class NodeCompositeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -341,8 +356,8 @@ public class NodeCompositeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/NodeCompositeEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/NodeCompositeEditPartCN.java
index 0155f2de242..420210d5504 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/NodeCompositeEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/NodeCompositeEditPartCN.java
@@ -96,7 +96,9 @@ public class NodeCompositeEditPartCN extends RoundedCompartmentEditPart {
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new DefaultCreationEditPolicy());
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
@@ -120,14 +122,14 @@ public class NodeCompositeEditPartCN extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case NodeCompositeFloatingLabelEditPartCN.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
@@ -136,7 +138,7 @@ public class NodeCompositeEditPartCN extends RoundedCompartmentEditPart {
return new BorderItemResizableEditPolicy();
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -156,8 +158,9 @@ public class NodeCompositeEditPartCN extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -175,6 +178,7 @@ public class NodeCompositeEditPartCN extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -186,32 +190,40 @@ public class NodeCompositeEditPartCN extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.composite.custom.figures.NodeCompositeFigure
+ *
* @generated
*/
public NodeCompositeFigure getPrimaryShape() {
- return (NodeCompositeFigure)primaryShape;
+ return (NodeCompositeFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof NodeCompositeNameEditPartCN) {
- ((NodeCompositeNameEditPartCN)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof NodeCompositeNameEditPartCN) {
+ ((NodeCompositeNameEditPartCN) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
- if(childEditPart instanceof NodeCompositeCompartmentEditPartCN) {
+
+
+ if (childEditPart instanceof NodeCompositeCompartmentEditPartCN) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((NodeCompositeCompartmentEditPartCN)childEditPart).getFigure());
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.add(((NodeCompositeCompartmentEditPartCN) childEditPart).getFigure());
return true;
}
- //Papyrus Gencode :Affixed Port locator
- if(childEditPart instanceof PortEditPart) {
+
+
+
+ // Papyrus Gencode :Affixed Port locator
+ if (childEditPart instanceof PortEditPart) {
IBorderItemLocator locator = new PortPositionLocator(getMainFigure(), PositionConstants.NONE);
- getBorderedFigure().getBorderItemContainer().add(((PortEditPart)childEditPart).getFigure(), locator);
+ getBorderedFigure().getBorderItemContainer().add(((PortEditPart) childEditPart).getFigure(), locator);
return true;
}
+
+
return false;
}
@@ -219,16 +231,16 @@ public class NodeCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof NodeCompositeNameEditPartCN) {
+ if (childEditPart instanceof NodeCompositeNameEditPartCN) {
return true;
}
- if(childEditPart instanceof NodeCompositeCompartmentEditPartCN) {
+ if (childEditPart instanceof NodeCompositeCompartmentEditPartCN) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- pane.remove(((NodeCompositeCompartmentEditPartCN)childEditPart).getFigure());
+ pane.remove(((NodeCompositeCompartmentEditPartCN) childEditPart).getFigure());
return true;
}
- if(childEditPart instanceof PortEditPart) {
- getBorderedFigure().getBorderItemContainer().remove(((PortEditPart)childEditPart).getFigure());
+ if (childEditPart instanceof PortEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((PortEditPart) childEditPart).getFigure());
return true;
}
return false;
@@ -238,7 +250,7 @@ public class NodeCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -248,7 +260,7 @@ public class NodeCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -258,10 +270,10 @@ public class NodeCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof NodeCompositeCompartmentEditPartCN) {
+ if (editPart instanceof NodeCompositeCompartmentEditPartCN) {
return getPrimaryShape().getCompositeCompartmentFigure();
}
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -271,7 +283,7 @@ public class NodeCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof NodeCompositeFloatingLabelEditPartCN) {
+ if (borderItemEditPart instanceof NodeCompositeFloatingLabelEditPartCN) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -294,16 +306,19 @@ public class NodeCompositeEditPartCN extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -315,7 +330,7 @@ public class NodeCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -325,7 +340,7 @@ public class NodeCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -341,8 +356,8 @@ public class NodeCompositeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/NodeCompositeFloatingLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/NodeCompositeFloatingLabelEditPart.java
index 80e73aa4fe1..5b386f09bef 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/NodeCompositeFloatingLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/NodeCompositeFloatingLabelEditPart.java
@@ -113,15 +113,18 @@ public class NodeCompositeFloatingLabelEditPart extends FloatingLabelEditPart im
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class NodeCompositeFloatingLabelEditPart extends FloatingLabelEditPart im
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class NodeCompositeFloatingLabelEditPart extends FloatingLabelEditPart im
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class NodeCompositeFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class NodeCompositeFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class NodeCompositeFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class NodeCompositeFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class NodeCompositeFloatingLabelEditPart extends FloatingLabelEditPart im
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class NodeCompositeFloatingLabelEditPart extends FloatingLabelEditPart im
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class NodeCompositeFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class NodeCompositeFloatingLabelEditPart extends FloatingLabelEditPart im
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class NodeCompositeFloatingLabelEditPart extends FloatingLabelEditPart im
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class NodeCompositeFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class NodeCompositeFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Node_2072, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.NodeCompositeFloatingLabelEditPart.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class NodeCompositeFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class NodeCompositeFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class NodeCompositeFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class NodeCompositeFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class NodeCompositeFloatingLabelEditPart extends FloatingLabelEditPart im
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class NodeCompositeFloatingLabelEditPart extends FloatingLabelEditPart im
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class NodeCompositeFloatingLabelEditPart extends FloatingLabelEditPart im
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class NodeCompositeFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class NodeCompositeFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class NodeCompositeFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class NodeCompositeFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class NodeCompositeFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class NodeCompositeFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class NodeCompositeFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class NodeCompositeFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class NodeCompositeFloatingLabelEditPart extends FloatingLabelEditPart im
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class NodeCompositeFloatingLabelEditPart extends FloatingLabelEditPart im
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class NodeCompositeFloatingLabelEditPart extends FloatingLabelEditPart im
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/NodeCompositeFloatingLabelEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/NodeCompositeFloatingLabelEditPartCN.java
index 4cf0f2e2f5c..91f9fa67112 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/NodeCompositeFloatingLabelEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/NodeCompositeFloatingLabelEditPartCN.java
@@ -113,15 +113,18 @@ public class NodeCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class NodeCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class NodeCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class NodeCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class NodeCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class NodeCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class NodeCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class NodeCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class NodeCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class NodeCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class NodeCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class NodeCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class NodeCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class NodeCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Node_3084, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.NodeCompositeFloatingLabelEditPartCN.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class NodeCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class NodeCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class NodeCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class NodeCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class NodeCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class NodeCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class NodeCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class NodeCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class NodeCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class NodeCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class NodeCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class NodeCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class NodeCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class NodeCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class NodeCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class NodeCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class NodeCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class NodeCompositeFloatingLabelEditPartCN extends FloatingLabelEditPart
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/NodeCompositeNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/NodeCompositeNameEditPart.java
index bb8154abfd7..62a8714e371 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/NodeCompositeNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/NodeCompositeNameEditPart.java
@@ -114,12 +114,14 @@ public class NodeCompositeNameEditPart extends PapyrusCompartmentEditPart implem
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class NodeCompositeNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class NodeCompositeNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class NodeCompositeNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class NodeCompositeNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class NodeCompositeNameEditPart extends PapyrusCompartmentEditPart implem
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class NodeCompositeNameEditPart extends PapyrusCompartmentEditPart implem
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class NodeCompositeNameEditPart extends PapyrusCompartmentEditPart implem
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class NodeCompositeNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class NodeCompositeNameEditPart extends PapyrusCompartmentEditPart implem
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class NodeCompositeNameEditPart extends PapyrusCompartmentEditPart implem
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class NodeCompositeNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class NodeCompositeNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Node_2072, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.NodeCompositeNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class NodeCompositeNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class NodeCompositeNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class NodeCompositeNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class NodeCompositeNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class NodeCompositeNameEditPart extends PapyrusCompartmentEditPart implem
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class NodeCompositeNameEditPart extends PapyrusCompartmentEditPart implem
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class NodeCompositeNameEditPart extends PapyrusCompartmentEditPart implem
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class NodeCompositeNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class NodeCompositeNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class NodeCompositeNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class NodeCompositeNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class NodeCompositeNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class NodeCompositeNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class NodeCompositeNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class NodeCompositeNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class NodeCompositeNameEditPart extends PapyrusCompartmentEditPart implem
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class NodeCompositeNameEditPart extends PapyrusCompartmentEditPart implem
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class NodeCompositeNameEditPart extends PapyrusCompartmentEditPart implem
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class NodeCompositeNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class NodeCompositeNameEditPart extends PapyrusCompartmentEditPart implem
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class NodeCompositeNameEditPart extends PapyrusCompartmentEditPart implem
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/NodeCompositeNameEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/NodeCompositeNameEditPartCN.java
index 55963748586..a9f7324150d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/NodeCompositeNameEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/NodeCompositeNameEditPartCN.java
@@ -114,12 +114,14 @@ public class NodeCompositeNameEditPartCN extends PapyrusCompartmentEditPart impl
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class NodeCompositeNameEditPartCN extends PapyrusCompartmentEditPart impl
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class NodeCompositeNameEditPartCN extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class NodeCompositeNameEditPartCN extends PapyrusCompartmentEditPart impl
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class NodeCompositeNameEditPartCN extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class NodeCompositeNameEditPartCN extends PapyrusCompartmentEditPart impl
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class NodeCompositeNameEditPartCN extends PapyrusCompartmentEditPart impl
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class NodeCompositeNameEditPartCN extends PapyrusCompartmentEditPart impl
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class NodeCompositeNameEditPartCN extends PapyrusCompartmentEditPart impl
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class NodeCompositeNameEditPartCN extends PapyrusCompartmentEditPart impl
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class NodeCompositeNameEditPartCN extends PapyrusCompartmentEditPart impl
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class NodeCompositeNameEditPartCN extends PapyrusCompartmentEditPart impl
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class NodeCompositeNameEditPartCN extends PapyrusCompartmentEditPart impl
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Node_3084, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.NodeCompositeNameEditPartCN.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class NodeCompositeNameEditPartCN extends PapyrusCompartmentEditPart impl
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class NodeCompositeNameEditPartCN extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class NodeCompositeNameEditPartCN extends PapyrusCompartmentEditPart impl
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class NodeCompositeNameEditPartCN extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class NodeCompositeNameEditPartCN extends PapyrusCompartmentEditPart impl
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class NodeCompositeNameEditPartCN extends PapyrusCompartmentEditPart impl
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class NodeCompositeNameEditPartCN extends PapyrusCompartmentEditPart impl
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class NodeCompositeNameEditPartCN extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class NodeCompositeNameEditPartCN extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class NodeCompositeNameEditPartCN extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class NodeCompositeNameEditPartCN extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class NodeCompositeNameEditPartCN extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class NodeCompositeNameEditPartCN extends PapyrusCompartmentEditPart impl
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class NodeCompositeNameEditPartCN extends PapyrusCompartmentEditPart impl
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class NodeCompositeNameEditPartCN extends PapyrusCompartmentEditPart impl
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class NodeCompositeNameEditPartCN extends PapyrusCompartmentEditPart impl
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class NodeCompositeNameEditPartCN extends PapyrusCompartmentEditPart impl
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class NodeCompositeNameEditPartCN extends PapyrusCompartmentEditPart impl
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class NodeCompositeNameEditPartCN extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class NodeCompositeNameEditPartCN extends PapyrusCompartmentEditPart impl
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class NodeCompositeNameEditPartCN extends PapyrusCompartmentEditPart impl
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueBehaviorCompositeCompartmentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueBehaviorCompositeCompartmentEditPart.java
index a5279be97f0..3c205275708 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueBehaviorCompositeCompartmentEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueBehaviorCompositeCompartmentEditPart.java
@@ -81,7 +81,7 @@ public class OpaqueBehaviorCompositeCompartmentEditPart extends LinkLFShapeCompa
* @generated
*/
protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
+ if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
super.setRatio(ratio);
}
}
@@ -90,6 +90,7 @@ public class OpaqueBehaviorCompositeCompartmentEditPart extends LinkLFShapeCompa
* @generated
*/
public EditPart getTargetEditPart(Request request) {
+
return super.getTargetEditPart(request);
}
@@ -98,7 +99,10 @@ public class OpaqueBehaviorCompositeCompartmentEditPart extends LinkLFShapeCompa
*/
protected void handleNotificationEvent(Notification notification) {
Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
+ if (NotationPackage.eINSTANCE.getSize_Width().equals(feature)
+ || NotationPackage.eINSTANCE.getSize_Height().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_X().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
refreshBounds();
}
super.handleNotificationEvent(notification);
@@ -108,13 +112,16 @@ public class OpaqueBehaviorCompositeCompartmentEditPart extends LinkLFShapeCompa
* @generated
*/
protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
+ ((GraphicalEditPart) getParent()).setLayoutConstraint(
+ this,
+ getFigure(),
+ new Rectangle(loc, size));
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueBehaviorCompositeCompartmentEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueBehaviorCompositeCompartmentEditPartCN.java
index bcf350da7f1..bbb522b277e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueBehaviorCompositeCompartmentEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueBehaviorCompositeCompartmentEditPartCN.java
@@ -81,7 +81,7 @@ public class OpaqueBehaviorCompositeCompartmentEditPartCN extends LinkLFShapeCom
* @generated
*/
protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
+ if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
super.setRatio(ratio);
}
}
@@ -90,6 +90,7 @@ public class OpaqueBehaviorCompositeCompartmentEditPartCN extends LinkLFShapeCom
* @generated
*/
public EditPart getTargetEditPart(Request request) {
+
return super.getTargetEditPart(request);
}
@@ -98,7 +99,10 @@ public class OpaqueBehaviorCompositeCompartmentEditPartCN extends LinkLFShapeCom
*/
protected void handleNotificationEvent(Notification notification) {
Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
+ if (NotationPackage.eINSTANCE.getSize_Width().equals(feature)
+ || NotationPackage.eINSTANCE.getSize_Height().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_X().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
refreshBounds();
}
super.handleNotificationEvent(notification);
@@ -108,13 +112,16 @@ public class OpaqueBehaviorCompositeCompartmentEditPartCN extends LinkLFShapeCom
* @generated
*/
protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
+ ((GraphicalEditPart) getParent()).setLayoutConstraint(
+ this,
+ getFigure(),
+ new Rectangle(loc, size));
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueBehaviorCompositeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueBehaviorCompositeEditPart.java
index 63b8461782d..93cd3421ee8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueBehaviorCompositeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueBehaviorCompositeEditPart.java
@@ -96,7 +96,9 @@ public class OpaqueBehaviorCompositeEditPart extends RoundedCompartmentEditPart
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new DefaultCreationEditPolicy());
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
@@ -120,14 +122,14 @@ public class OpaqueBehaviorCompositeEditPart extends RoundedCompartmentEditPart
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case OpaqueBehaviorCompositeFloatingLabelEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
@@ -137,7 +139,7 @@ public class OpaqueBehaviorCompositeEditPart extends RoundedCompartmentEditPart
return new BorderItemResizableEditPolicy();
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -157,8 +159,9 @@ public class OpaqueBehaviorCompositeEditPart extends RoundedCompartmentEditPart
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -176,6 +179,7 @@ public class OpaqueBehaviorCompositeEditPart extends RoundedCompartmentEditPart
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -187,38 +191,50 @@ public class OpaqueBehaviorCompositeEditPart extends RoundedCompartmentEditPart
/**
* org.eclipse.papyrus.uml.diagram.composite.custom.figures.OpaqueBehaviorCompositeFigure
+ *
* @generated
*/
public OpaqueBehaviorCompositeFigure getPrimaryShape() {
- return (OpaqueBehaviorCompositeFigure)primaryShape;
+ return (OpaqueBehaviorCompositeFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof OpaqueBehaviorCompositeNameEditPart) {
- ((OpaqueBehaviorCompositeNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof OpaqueBehaviorCompositeNameEditPart) {
+ ((OpaqueBehaviorCompositeNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
- if(childEditPart instanceof OpaqueBehaviorCompositeCompartmentEditPart) {
+
+
+ if (childEditPart instanceof OpaqueBehaviorCompositeCompartmentEditPart) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((OpaqueBehaviorCompositeCompartmentEditPart)childEditPart).getFigure());
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.add(((OpaqueBehaviorCompositeCompartmentEditPart) childEditPart).getFigure());
return true;
}
- //Papyrus Gencode :Affixed Port locator
- if(childEditPart instanceof PortEditPart) {
+
+
+
+ // Papyrus Gencode :Affixed Port locator
+ if (childEditPart instanceof PortEditPart) {
IBorderItemLocator locator = new PortPositionLocator(getMainFigure(), PositionConstants.NONE);
- getBorderedFigure().getBorderItemContainer().add(((PortEditPart)childEditPart).getFigure(), locator);
+ getBorderedFigure().getBorderItemContainer().add(((PortEditPart) childEditPart).getFigure(), locator);
return true;
}
- //Papyrus Gencode :Affixed Port locator
- if(childEditPart instanceof ParameterEditPart) {
+
+
+
+
+ // Papyrus Gencode :Affixed Port locator
+ if (childEditPart instanceof ParameterEditPart) {
IBorderItemLocator locator = new PortPositionLocator(getMainFigure(), PositionConstants.NONE);
- getBorderedFigure().getBorderItemContainer().add(((ParameterEditPart)childEditPart).getFigure(), locator);
+ getBorderedFigure().getBorderItemContainer().add(((ParameterEditPart) childEditPart).getFigure(), locator);
return true;
}
+
+
return false;
}
@@ -226,20 +242,20 @@ public class OpaqueBehaviorCompositeEditPart extends RoundedCompartmentEditPart
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof OpaqueBehaviorCompositeNameEditPart) {
+ if (childEditPart instanceof OpaqueBehaviorCompositeNameEditPart) {
return true;
}
- if(childEditPart instanceof OpaqueBehaviorCompositeCompartmentEditPart) {
+ if (childEditPart instanceof OpaqueBehaviorCompositeCompartmentEditPart) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- pane.remove(((OpaqueBehaviorCompositeCompartmentEditPart)childEditPart).getFigure());
+ pane.remove(((OpaqueBehaviorCompositeCompartmentEditPart) childEditPart).getFigure());
return true;
}
- if(childEditPart instanceof PortEditPart) {
- getBorderedFigure().getBorderItemContainer().remove(((PortEditPart)childEditPart).getFigure());
+ if (childEditPart instanceof PortEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((PortEditPart) childEditPart).getFigure());
return true;
}
- if(childEditPart instanceof ParameterEditPart) {
- getBorderedFigure().getBorderItemContainer().remove(((ParameterEditPart)childEditPart).getFigure());
+ if (childEditPart instanceof ParameterEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((ParameterEditPart) childEditPart).getFigure());
return true;
}
return false;
@@ -249,7 +265,7 @@ public class OpaqueBehaviorCompositeEditPart extends RoundedCompartmentEditPart
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -259,7 +275,7 @@ public class OpaqueBehaviorCompositeEditPart extends RoundedCompartmentEditPart
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -269,10 +285,10 @@ public class OpaqueBehaviorCompositeEditPart extends RoundedCompartmentEditPart
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof OpaqueBehaviorCompositeCompartmentEditPart) {
+ if (editPart instanceof OpaqueBehaviorCompositeCompartmentEditPart) {
return getPrimaryShape().getCompositeCompartmentFigure();
}
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -282,7 +298,7 @@ public class OpaqueBehaviorCompositeEditPart extends RoundedCompartmentEditPart
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof OpaqueBehaviorCompositeFloatingLabelEditPart) {
+ if (borderItemEditPart instanceof OpaqueBehaviorCompositeFloatingLabelEditPart) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -305,16 +321,19 @@ public class OpaqueBehaviorCompositeEditPart extends RoundedCompartmentEditPart
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -326,7 +345,7 @@ public class OpaqueBehaviorCompositeEditPart extends RoundedCompartmentEditPart
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -336,7 +355,7 @@ public class OpaqueBehaviorCompositeEditPart extends RoundedCompartmentEditPart
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -352,8 +371,8 @@ public class OpaqueBehaviorCompositeEditPart extends RoundedCompartmentEditPart
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueBehaviorCompositeEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueBehaviorCompositeEditPartCN.java
index 62280b5d4a0..976e6c11d77 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueBehaviorCompositeEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueBehaviorCompositeEditPartCN.java
@@ -96,7 +96,9 @@ public class OpaqueBehaviorCompositeEditPartCN extends RoundedCompartmentEditPar
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new DefaultCreationEditPolicy());
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
@@ -120,14 +122,14 @@ public class OpaqueBehaviorCompositeEditPartCN extends RoundedCompartmentEditPar
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case OpaqueBehaviorCompositeFloatingLabelEditPartCN.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
@@ -137,7 +139,7 @@ public class OpaqueBehaviorCompositeEditPartCN extends RoundedCompartmentEditPar
return new BorderItemResizableEditPolicy();
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -157,8 +159,9 @@ public class OpaqueBehaviorCompositeEditPartCN extends RoundedCompartmentEditPar
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -176,6 +179,7 @@ public class OpaqueBehaviorCompositeEditPartCN extends RoundedCompartmentEditPar
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -187,38 +191,50 @@ public class OpaqueBehaviorCompositeEditPartCN extends RoundedCompartmentEditPar
/**
* org.eclipse.papyrus.uml.diagram.composite.custom.figures.OpaqueBehaviorCompositeFigure
+ *
* @generated
*/
public OpaqueBehaviorCompositeFigure getPrimaryShape() {
- return (OpaqueBehaviorCompositeFigure)primaryShape;
+ return (OpaqueBehaviorCompositeFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof OpaqueBehaviorCompositeNameEditPartCN) {
- ((OpaqueBehaviorCompositeNameEditPartCN)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof OpaqueBehaviorCompositeNameEditPartCN) {
+ ((OpaqueBehaviorCompositeNameEditPartCN) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
- if(childEditPart instanceof OpaqueBehaviorCompositeCompartmentEditPartCN) {
+
+
+ if (childEditPart instanceof OpaqueBehaviorCompositeCompartmentEditPartCN) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((OpaqueBehaviorCompositeCompartmentEditPartCN)childEditPart).getFigure());
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.add(((OpaqueBehaviorCompositeCompartmentEditPartCN) childEditPart).getFigure());
return true;
}
- //Papyrus Gencode :Affixed Port locator
- if(childEditPart instanceof PortEditPart) {
+
+
+
+ // Papyrus Gencode :Affixed Port locator
+ if (childEditPart instanceof PortEditPart) {
IBorderItemLocator locator = new PortPositionLocator(getMainFigure(), PositionConstants.NONE);
- getBorderedFigure().getBorderItemContainer().add(((PortEditPart)childEditPart).getFigure(), locator);
+ getBorderedFigure().getBorderItemContainer().add(((PortEditPart) childEditPart).getFigure(), locator);
return true;
}
- //Papyrus Gencode :Affixed Port locator
- if(childEditPart instanceof ParameterEditPart) {
+
+
+
+
+ // Papyrus Gencode :Affixed Port locator
+ if (childEditPart instanceof ParameterEditPart) {
IBorderItemLocator locator = new PortPositionLocator(getMainFigure(), PositionConstants.NONE);
- getBorderedFigure().getBorderItemContainer().add(((ParameterEditPart)childEditPart).getFigure(), locator);
+ getBorderedFigure().getBorderItemContainer().add(((ParameterEditPart) childEditPart).getFigure(), locator);
return true;
}
+
+
return false;
}
@@ -226,20 +242,20 @@ public class OpaqueBehaviorCompositeEditPartCN extends RoundedCompartmentEditPar
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof OpaqueBehaviorCompositeNameEditPartCN) {
+ if (childEditPart instanceof OpaqueBehaviorCompositeNameEditPartCN) {
return true;
}
- if(childEditPart instanceof OpaqueBehaviorCompositeCompartmentEditPartCN) {
+ if (childEditPart instanceof OpaqueBehaviorCompositeCompartmentEditPartCN) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- pane.remove(((OpaqueBehaviorCompositeCompartmentEditPartCN)childEditPart).getFigure());
+ pane.remove(((OpaqueBehaviorCompositeCompartmentEditPartCN) childEditPart).getFigure());
return true;
}
- if(childEditPart instanceof PortEditPart) {
- getBorderedFigure().getBorderItemContainer().remove(((PortEditPart)childEditPart).getFigure());
+ if (childEditPart instanceof PortEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((PortEditPart) childEditPart).getFigure());
return true;
}
- if(childEditPart instanceof ParameterEditPart) {
- getBorderedFigure().getBorderItemContainer().remove(((ParameterEditPart)childEditPart).getFigure());
+ if (childEditPart instanceof ParameterEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((ParameterEditPart) childEditPart).getFigure());
return true;
}
return false;
@@ -249,7 +265,7 @@ public class OpaqueBehaviorCompositeEditPartCN extends RoundedCompartmentEditPar
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -259,7 +275,7 @@ public class OpaqueBehaviorCompositeEditPartCN extends RoundedCompartmentEditPar
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -269,10 +285,10 @@ public class OpaqueBehaviorCompositeEditPartCN extends RoundedCompartmentEditPar
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof OpaqueBehaviorCompositeCompartmentEditPartCN) {
+ if (editPart instanceof OpaqueBehaviorCompositeCompartmentEditPartCN) {
return getPrimaryShape().getCompositeCompartmentFigure();
}
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -282,7 +298,7 @@ public class OpaqueBehaviorCompositeEditPartCN extends RoundedCompartmentEditPar
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof OpaqueBehaviorCompositeFloatingLabelEditPartCN) {
+ if (borderItemEditPart instanceof OpaqueBehaviorCompositeFloatingLabelEditPartCN) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -305,16 +321,19 @@ public class OpaqueBehaviorCompositeEditPartCN extends RoundedCompartmentEditPar
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -326,7 +345,7 @@ public class OpaqueBehaviorCompositeEditPartCN extends RoundedCompartmentEditPar
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -336,7 +355,7 @@ public class OpaqueBehaviorCompositeEditPartCN extends RoundedCompartmentEditPar
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -352,8 +371,8 @@ public class OpaqueBehaviorCompositeEditPartCN extends RoundedCompartmentEditPar
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueBehaviorCompositeFloatingLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueBehaviorCompositeFloatingLabelEditPart.java
index dfcecd22ccf..114e2c72a28 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueBehaviorCompositeFloatingLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueBehaviorCompositeFloatingLabelEditPart.java
@@ -113,15 +113,18 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPart extends FloatingLabelE
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPart extends FloatingLabelE
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPart extends FloatingLabelE
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPart extends FloatingLabelE
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPart extends FloatingLabelE
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPart extends FloatingLabelE
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPart extends FloatingLabelE
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.OpaqueBehavior_2065, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.OpaqueBehaviorCompositeFloatingLabelEditPart.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPart extends FloatingLabelE
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPart extends FloatingLabelE
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPart extends FloatingLabelE
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPart extends FloatingLabelE
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPart extends FloatingLabelE
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPart extends FloatingLabelE
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPart extends FloatingLabelE
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueBehaviorCompositeFloatingLabelEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueBehaviorCompositeFloatingLabelEditPartCN.java
index 3936999ad37..60f1db7b378 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueBehaviorCompositeFloatingLabelEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueBehaviorCompositeFloatingLabelEditPartCN.java
@@ -113,15 +113,18 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPartCN extends FloatingLabe
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPartCN extends FloatingLabe
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPartCN extends FloatingLabe
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPartCN extends FloatingLabe
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPartCN extends FloatingLabe
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPartCN extends FloatingLabe
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPartCN extends FloatingLabe
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPartCN extends FloatingLabe
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPartCN extends FloatingLabe
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPartCN extends FloatingLabe
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPartCN extends FloatingLabe
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPartCN extends FloatingLabe
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPartCN extends FloatingLabe
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPartCN extends FloatingLabe
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.OpaqueBehavior_3077, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.OpaqueBehaviorCompositeFloatingLabelEditPartCN.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPartCN extends FloatingLabe
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPartCN extends FloatingLabe
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPartCN extends FloatingLabe
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPartCN extends FloatingLabe
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPartCN extends FloatingLabe
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPartCN extends FloatingLabe
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPartCN extends FloatingLabe
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPartCN extends FloatingLabe
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPartCN extends FloatingLabe
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPartCN extends FloatingLabe
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPartCN extends FloatingLabe
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPartCN extends FloatingLabe
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPartCN extends FloatingLabe
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPartCN extends FloatingLabe
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPartCN extends FloatingLabe
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPartCN extends FloatingLabe
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPartCN extends FloatingLabe
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class OpaqueBehaviorCompositeFloatingLabelEditPartCN extends FloatingLabe
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueBehaviorCompositeNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueBehaviorCompositeNameEditPart.java
index 7a56e51fc38..bbfe0398c2c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueBehaviorCompositeNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueBehaviorCompositeNameEditPart.java
@@ -114,12 +114,14 @@ public class OpaqueBehaviorCompositeNameEditPart extends PapyrusCompartmentEditP
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class OpaqueBehaviorCompositeNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class OpaqueBehaviorCompositeNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class OpaqueBehaviorCompositeNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class OpaqueBehaviorCompositeNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class OpaqueBehaviorCompositeNameEditPart extends PapyrusCompartmentEditP
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class OpaqueBehaviorCompositeNameEditPart extends PapyrusCompartmentEditP
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class OpaqueBehaviorCompositeNameEditPart extends PapyrusCompartmentEditP
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class OpaqueBehaviorCompositeNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class OpaqueBehaviorCompositeNameEditPart extends PapyrusCompartmentEditP
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class OpaqueBehaviorCompositeNameEditPart extends PapyrusCompartmentEditP
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class OpaqueBehaviorCompositeNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class OpaqueBehaviorCompositeNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.OpaqueBehavior_2065, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.OpaqueBehaviorCompositeNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class OpaqueBehaviorCompositeNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class OpaqueBehaviorCompositeNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class OpaqueBehaviorCompositeNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class OpaqueBehaviorCompositeNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class OpaqueBehaviorCompositeNameEditPart extends PapyrusCompartmentEditP
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class OpaqueBehaviorCompositeNameEditPart extends PapyrusCompartmentEditP
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class OpaqueBehaviorCompositeNameEditPart extends PapyrusCompartmentEditP
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class OpaqueBehaviorCompositeNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class OpaqueBehaviorCompositeNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class OpaqueBehaviorCompositeNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class OpaqueBehaviorCompositeNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class OpaqueBehaviorCompositeNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class OpaqueBehaviorCompositeNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class OpaqueBehaviorCompositeNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class OpaqueBehaviorCompositeNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class OpaqueBehaviorCompositeNameEditPart extends PapyrusCompartmentEditP
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class OpaqueBehaviorCompositeNameEditPart extends PapyrusCompartmentEditP
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class OpaqueBehaviorCompositeNameEditPart extends PapyrusCompartmentEditP
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class OpaqueBehaviorCompositeNameEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class OpaqueBehaviorCompositeNameEditPart extends PapyrusCompartmentEditP
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class OpaqueBehaviorCompositeNameEditPart extends PapyrusCompartmentEditP
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueBehaviorCompositeNameEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueBehaviorCompositeNameEditPartCN.java
index 4cce76ac3ef..1582445de7b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueBehaviorCompositeNameEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueBehaviorCompositeNameEditPartCN.java
@@ -114,12 +114,14 @@ public class OpaqueBehaviorCompositeNameEditPartCN extends PapyrusCompartmentEdi
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class OpaqueBehaviorCompositeNameEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class OpaqueBehaviorCompositeNameEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class OpaqueBehaviorCompositeNameEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class OpaqueBehaviorCompositeNameEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class OpaqueBehaviorCompositeNameEditPartCN extends PapyrusCompartmentEdi
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class OpaqueBehaviorCompositeNameEditPartCN extends PapyrusCompartmentEdi
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class OpaqueBehaviorCompositeNameEditPartCN extends PapyrusCompartmentEdi
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class OpaqueBehaviorCompositeNameEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class OpaqueBehaviorCompositeNameEditPartCN extends PapyrusCompartmentEdi
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class OpaqueBehaviorCompositeNameEditPartCN extends PapyrusCompartmentEdi
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class OpaqueBehaviorCompositeNameEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class OpaqueBehaviorCompositeNameEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.OpaqueBehavior_3077, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.OpaqueBehaviorCompositeNameEditPartCN.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class OpaqueBehaviorCompositeNameEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class OpaqueBehaviorCompositeNameEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class OpaqueBehaviorCompositeNameEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class OpaqueBehaviorCompositeNameEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class OpaqueBehaviorCompositeNameEditPartCN extends PapyrusCompartmentEdi
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class OpaqueBehaviorCompositeNameEditPartCN extends PapyrusCompartmentEdi
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class OpaqueBehaviorCompositeNameEditPartCN extends PapyrusCompartmentEdi
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class OpaqueBehaviorCompositeNameEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class OpaqueBehaviorCompositeNameEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class OpaqueBehaviorCompositeNameEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class OpaqueBehaviorCompositeNameEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class OpaqueBehaviorCompositeNameEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class OpaqueBehaviorCompositeNameEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class OpaqueBehaviorCompositeNameEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class OpaqueBehaviorCompositeNameEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class OpaqueBehaviorCompositeNameEditPartCN extends PapyrusCompartmentEdi
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class OpaqueBehaviorCompositeNameEditPartCN extends PapyrusCompartmentEdi
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class OpaqueBehaviorCompositeNameEditPartCN extends PapyrusCompartmentEdi
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class OpaqueBehaviorCompositeNameEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class OpaqueBehaviorCompositeNameEditPartCN extends PapyrusCompartmentEdi
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class OpaqueBehaviorCompositeNameEditPartCN extends PapyrusCompartmentEdi
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueExpressionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueExpressionEditPart.java
index 63e8b3265ee..88ea9bb7438 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueExpressionEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueExpressionEditPart.java
@@ -84,7 +84,9 @@ public class OpaqueExpressionEditPart extends RoundedCompartmentEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
@@ -101,21 +103,21 @@ public class OpaqueExpressionEditPart extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case OpaqueExpressionFloatingLabelEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -135,8 +137,9 @@ public class OpaqueExpressionEditPart extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -154,6 +157,7 @@ public class OpaqueExpressionEditPart extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -165,20 +169,23 @@ public class OpaqueExpressionEditPart extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure
+ *
* @generated
*/
public RoundedCompartmentFigure getPrimaryShape() {
- return (RoundedCompartmentFigure)primaryShape;
+ return (RoundedCompartmentFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof OpaqueExpressionNameEditPart) {
- ((OpaqueExpressionNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof OpaqueExpressionNameEditPart) {
+ ((OpaqueExpressionNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
+
+
return false;
}
@@ -186,7 +193,7 @@ public class OpaqueExpressionEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof OpaqueExpressionNameEditPart) {
+ if (childEditPart instanceof OpaqueExpressionNameEditPart) {
return true;
}
return false;
@@ -196,7 +203,7 @@ public class OpaqueExpressionEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -206,7 +213,7 @@ public class OpaqueExpressionEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -216,7 +223,7 @@ public class OpaqueExpressionEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -226,7 +233,7 @@ public class OpaqueExpressionEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof OpaqueExpressionFloatingLabelEditPart) {
+ if (borderItemEditPart instanceof OpaqueExpressionFloatingLabelEditPart) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -249,16 +256,19 @@ public class OpaqueExpressionEditPart extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -270,7 +280,7 @@ public class OpaqueExpressionEditPart extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -280,7 +290,7 @@ public class OpaqueExpressionEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -296,8 +306,8 @@ public class OpaqueExpressionEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueExpressionFloatingLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueExpressionFloatingLabelEditPart.java
index a262ccf271f..7b87fea5c72 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueExpressionFloatingLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueExpressionFloatingLabelEditPart.java
@@ -113,15 +113,18 @@ public class OpaqueExpressionFloatingLabelEditPart extends FloatingLabelEditPart
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class OpaqueExpressionFloatingLabelEditPart extends FloatingLabelEditPart
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class OpaqueExpressionFloatingLabelEditPart extends FloatingLabelEditPart
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class OpaqueExpressionFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class OpaqueExpressionFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class OpaqueExpressionFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class OpaqueExpressionFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class OpaqueExpressionFloatingLabelEditPart extends FloatingLabelEditPart
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class OpaqueExpressionFloatingLabelEditPart extends FloatingLabelEditPart
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class OpaqueExpressionFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class OpaqueExpressionFloatingLabelEditPart extends FloatingLabelEditPart
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class OpaqueExpressionFloatingLabelEditPart extends FloatingLabelEditPart
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class OpaqueExpressionFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class OpaqueExpressionFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.OpaqueExpression_2101, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.OpaqueExpressionFloatingLabelEditPart.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class OpaqueExpressionFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class OpaqueExpressionFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class OpaqueExpressionFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class OpaqueExpressionFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class OpaqueExpressionFloatingLabelEditPart extends FloatingLabelEditPart
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class OpaqueExpressionFloatingLabelEditPart extends FloatingLabelEditPart
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class OpaqueExpressionFloatingLabelEditPart extends FloatingLabelEditPart
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class OpaqueExpressionFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class OpaqueExpressionFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class OpaqueExpressionFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class OpaqueExpressionFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class OpaqueExpressionFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class OpaqueExpressionFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class OpaqueExpressionFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class OpaqueExpressionFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class OpaqueExpressionFloatingLabelEditPart extends FloatingLabelEditPart
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class OpaqueExpressionFloatingLabelEditPart extends FloatingLabelEditPart
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class OpaqueExpressionFloatingLabelEditPart extends FloatingLabelEditPart
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueExpressionNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueExpressionNameEditPart.java
index 27ebba2c963..9987c55fe77 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueExpressionNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OpaqueExpressionNameEditPart.java
@@ -114,12 +114,14 @@ public class OpaqueExpressionNameEditPart extends PapyrusCompartmentEditPart imp
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class OpaqueExpressionNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class OpaqueExpressionNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class OpaqueExpressionNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class OpaqueExpressionNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class OpaqueExpressionNameEditPart extends PapyrusCompartmentEditPart imp
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class OpaqueExpressionNameEditPart extends PapyrusCompartmentEditPart imp
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class OpaqueExpressionNameEditPart extends PapyrusCompartmentEditPart imp
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class OpaqueExpressionNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class OpaqueExpressionNameEditPart extends PapyrusCompartmentEditPart imp
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class OpaqueExpressionNameEditPart extends PapyrusCompartmentEditPart imp
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class OpaqueExpressionNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class OpaqueExpressionNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.OpaqueExpression_2101, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.OpaqueExpressionNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class OpaqueExpressionNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class OpaqueExpressionNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class OpaqueExpressionNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class OpaqueExpressionNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class OpaqueExpressionNameEditPart extends PapyrusCompartmentEditPart imp
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class OpaqueExpressionNameEditPart extends PapyrusCompartmentEditPart imp
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class OpaqueExpressionNameEditPart extends PapyrusCompartmentEditPart imp
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class OpaqueExpressionNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class OpaqueExpressionNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class OpaqueExpressionNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class OpaqueExpressionNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class OpaqueExpressionNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class OpaqueExpressionNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class OpaqueExpressionNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class OpaqueExpressionNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class OpaqueExpressionNameEditPart extends PapyrusCompartmentEditPart imp
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class OpaqueExpressionNameEditPart extends PapyrusCompartmentEditPart imp
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class OpaqueExpressionNameEditPart extends PapyrusCompartmentEditPart imp
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class OpaqueExpressionNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class OpaqueExpressionNameEditPart extends PapyrusCompartmentEditPart imp
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class OpaqueExpressionNameEditPart extends PapyrusCompartmentEditPart imp
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OperationEditPartCLN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OperationEditPartCLN.java
index c24328c01c8..78f84c8583e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OperationEditPartCLN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/OperationEditPartCLN.java
@@ -122,12 +122,14 @@ public class OperationEditPartCLN extends CompartmentEditPart implements ITextAw
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -143,7 +145,7 @@ public class OperationEditPartCLN extends CompartmentEditPart implements ITextAw
* @generated
*/
public DragTracker getDragTracker(Request request) {
- if(request instanceof SelectionRequest && ((SelectionRequest)request).getLastButtonPressed() == 3) {
+ if (request instanceof SelectionRequest && ((SelectionRequest) request).getLastButtonPressed() == 3) {
return null;
}
return new DragEditPartsTrackerEx(this);
@@ -164,12 +166,12 @@ public class OperationEditPartCLN extends CompartmentEditPart implements ITextAw
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -177,12 +179,12 @@ public class OperationEditPartCLN extends CompartmentEditPart implements ITextAw
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -190,12 +192,12 @@ public class OperationEditPartCLN extends CompartmentEditPart implements ITextAw
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -203,12 +205,12 @@ public class OperationEditPartCLN extends CompartmentEditPart implements ITextAw
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -256,12 +258,12 @@ public class OperationEditPartCLN extends CompartmentEditPart implements ITextAw
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -274,10 +276,12 @@ public class OperationEditPartCLN extends CompartmentEditPart implements ITextAw
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -289,12 +293,12 @@ public class OperationEditPartCLN extends CompartmentEditPart implements ITextAw
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -302,10 +306,12 @@ public class OperationEditPartCLN extends CompartmentEditPart implements ITextAw
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -323,15 +329,16 @@ public class OperationEditPartCLN extends CompartmentEditPart implements ITextAw
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -339,6 +346,7 @@ public class OperationEditPartCLN extends CompartmentEditPart implements ITextAw
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -349,7 +357,7 @@ public class OperationEditPartCLN extends CompartmentEditPart implements ITextAw
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -366,7 +374,7 @@ public class OperationEditPartCLN extends CompartmentEditPart implements ITextAw
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Operation_3102, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.OperationEditPartCLN.VISUAL_ID));
}
return parser;
@@ -376,8 +384,10 @@ public class OperationEditPartCLN extends CompartmentEditPart implements ITextAw
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -406,8 +416,8 @@ public class OperationEditPartCLN extends CompartmentEditPart implements ITextAw
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -415,8 +425,8 @@ public class OperationEditPartCLN extends CompartmentEditPart implements ITextAw
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -426,46 +436,52 @@ public class OperationEditPartCLN extends CompartmentEditPart implements ITextAw
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -487,12 +503,12 @@ public class OperationEditPartCLN extends CompartmentEditPart implements ITextAw
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -522,12 +538,12 @@ public class OperationEditPartCLN extends CompartmentEditPart implements ITextAw
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -536,12 +552,12 @@ public class OperationEditPartCLN extends CompartmentEditPart implements ITextAw
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -549,15 +565,16 @@ public class OperationEditPartCLN extends CompartmentEditPart implements ITextAw
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -566,9 +583,10 @@ public class OperationEditPartCLN extends CompartmentEditPart implements ITextAw
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -576,9 +594,12 @@ public class OperationEditPartCLN extends CompartmentEditPart implements ITextAw
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -594,11 +615,11 @@ public class OperationEditPartCLN extends CompartmentEditPart implements ITextAw
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -609,8 +630,8 @@ public class OperationEditPartCLN extends CompartmentEditPart implements ITextAw
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -622,7 +643,7 @@ public class OperationEditPartCLN extends CompartmentEditPart implements ITextAw
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -648,13 +669,14 @@ public class OperationEditPartCLN extends CompartmentEditPart implements ITextAw
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -666,8 +688,8 @@ public class OperationEditPartCLN extends CompartmentEditPart implements ITextAw
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -684,35 +706,40 @@ public class OperationEditPartCLN extends CompartmentEditPart implements ITextAw
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -722,12 +749,13 @@ public class OperationEditPartCLN extends CompartmentEditPart implements ITextAw
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -761,34 +789,35 @@ public class OperationEditPartCLN extends CompartmentEditPart implements ITextAw
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
- if(UMLPackage.eINSTANCE.getFeature_IsStatic().equals(feature)) {
+ if (UMLPackage.eINSTANCE.getFeature_IsStatic().equals(feature)) {
refreshUnderline();
}
super.handleNotificationEvent(event);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ParameterAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ParameterAppliedStereotypeEditPart.java
index 77b43324af9..560a3f024ed 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ParameterAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ParameterAppliedStereotypeEditPart.java
@@ -127,6 +127,7 @@ public class ParameterAppliedStereotypeEditPart extends PapyrusLabelEditPart imp
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -233,8 +234,7 @@ public class ParameterAppliedStereotypeEditPart extends PapyrusLabelEditPart imp
/**
* @generated
*/
- public void setLabel(IFigure
- figure) {
+ public void setLabel(IFigure figure) {
unregisterVisuals();
setFigure(figure);
defaultText = getLabelTextHelper(figure);
@@ -345,15 +345,14 @@ public class ParameterAppliedStereotypeEditPart extends PapyrusLabelEditPart imp
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid =
- (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
@@ -482,8 +481,7 @@ public class ParameterAppliedStereotypeEditPart extends PapyrusLabelEditPart imp
IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- }
- else if (configuration instanceof IAdvancedEditorConfiguration) {
+ } 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);
@@ -528,8 +526,7 @@ public class ParameterAppliedStereotypeEditPart extends PapyrusLabelEditPart imp
RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- }
- else {
+ } else {
performDirectEdit();
}
}
@@ -566,8 +563,7 @@ public class ParameterAppliedStereotypeEditPart extends PapyrusLabelEditPart imp
if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
- }
- else {
+ } else {
setLabelTextHelper(getFigure(), ""); //$NON-NLS-1$
setLabelIconHelper(getFigure(), null);
}
@@ -586,17 +582,15 @@ public class ParameterAppliedStereotypeEditPart extends PapyrusLabelEditPart imp
* @generated
*/
protected void refreshUnderline() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
if (resolveSemanticElement() instanceof Feature) {
if (((Feature) resolveSemanticElement()).isStatic()) {
((WrappingLabel) getFigure()).setTextUnderline(true);
- }
- else {
+ } else {
((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
@@ -606,9 +600,8 @@ public class ParameterAppliedStereotypeEditPart extends PapyrusLabelEditPart imp
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
@@ -619,14 +612,12 @@ public class ParameterAppliedStereotypeEditPart extends PapyrusLabelEditPart imp
*/
@Override
protected void refreshFont() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ 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));
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -712,7 +703,7 @@ public class ParameterAppliedStereotypeEditPart extends PapyrusLabelEditPart imp
*/
protected boolean checkExtendedEditor() {
if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -736,9 +727,9 @@ public class ParameterAppliedStereotypeEditPart extends PapyrusLabelEditPart imp
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());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
@@ -752,8 +743,7 @@ public class ParameterAppliedStereotypeEditPart extends PapyrusLabelEditPart imp
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement()
- .eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
@@ -805,18 +795,15 @@ public class ParameterAppliedStereotypeEditPart extends PapyrusLabelEditPart imp
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)) {
+ } 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();
+ ISemanticParser modelParser = (ISemanticParser) getParser();
if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
if (resolveSemanticElement() != null) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ParameterEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ParameterEditPart.java
index df2cb1aed4e..3a19e087568 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ParameterEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ParameterEditPart.java
@@ -86,7 +86,9 @@ public class ParameterEditPart extends RoundedBorderNamedElementEditPart {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, getPrimaryDragEditPolicy());
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeIconlDisplayEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, new ParameterLayoutEditPolicy());
@@ -105,22 +107,22 @@ public class ParameterEditPart extends RoundedBorderNamedElementEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case ParameterNameEditPart.VISUAL_ID:
case ParameterAppliedStereotypeEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -140,8 +142,9 @@ public class ParameterEditPart extends RoundedBorderNamedElementEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -159,6 +162,7 @@ public class ParameterEditPart extends RoundedBorderNamedElementEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -170,20 +174,22 @@ public class ParameterEditPart extends RoundedBorderNamedElementEditPart {
/**
* org.eclipse.papyrus.uml.diagram.composite.custom.figures.ParameterFigure
+ *
* @generated
*/
public ParameterFigure getPrimaryShape() {
- return (ParameterFigure)primaryShape;
+ return (ParameterFigure) primaryShape;
}
/**
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof ParameterNameEditPart) {
+ if (borderItemEditPart instanceof ParameterNameEditPart) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
- } else if(borderItemEditPart instanceof ParameterAppliedStereotypeEditPart) {
+ } else
+ if (borderItemEditPart instanceof ParameterAppliedStereotypeEditPart) {
IBorderItemLocator locator = new ExternalLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -211,12 +217,15 @@ public class ParameterEditPart extends RoundedBorderNamedElementEditPart {
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
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
@@ -227,7 +236,7 @@ public class ParameterEditPart extends RoundedBorderNamedElementEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -237,7 +246,7 @@ public class ParameterEditPart extends RoundedBorderNamedElementEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -253,8 +262,8 @@ public class ParameterEditPart extends RoundedBorderNamedElementEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ParameterNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ParameterNameEditPart.java
index bab47ad115b..49a80f32efe 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ParameterNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ParameterNameEditPart.java
@@ -68,6 +68,7 @@ import org.eclipse.papyrus.uml.diagram.common.editparts.FloatingLabelEditPart;
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.util.DiagramEditPartsUtil;
import org.eclipse.papyrus.uml.diagram.composite.custom.edit.policies.ParameterLabelEditPolicy;
import org.eclipse.papyrus.uml.diagram.composite.edit.policies.UMLTextSelectionEditPolicy;
import org.eclipse.papyrus.uml.diagram.composite.part.UMLVisualIDRegistry;
@@ -126,6 +127,7 @@ public class ParameterNameEditPart extends FloatingLabelEditPart implements ITex
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -232,8 +234,7 @@ public class ParameterNameEditPart extends FloatingLabelEditPart implements ITex
/**
* @generated
*/
- public void setLabel(IFigure
- figure) {
+ public void setLabel(IFigure figure) {
unregisterVisuals();
setFigure(figure);
defaultText = getLabelTextHelper(figure);
@@ -279,7 +280,7 @@ public class ParameterNameEditPart extends FloatingLabelEditPart implements ITex
if (parserElement == null) {
return null;
}
- List<View> views = org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramEditPartsUtil.findViews(parserElement, getViewer());
+ List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
for (View view : views) {
if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
@@ -354,15 +355,14 @@ public class ParameterNameEditPart extends FloatingLabelEditPart implements ITex
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid =
- (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
@@ -491,8 +491,7 @@ public class ParameterNameEditPart extends FloatingLabelEditPart implements ITex
IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- }
- else if (configuration instanceof IAdvancedEditorConfiguration) {
+ } 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);
@@ -537,8 +536,7 @@ public class ParameterNameEditPart extends FloatingLabelEditPart implements ITex
RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- }
- else {
+ } else {
performDirectEdit();
}
}
@@ -575,8 +573,7 @@ public class ParameterNameEditPart extends FloatingLabelEditPart implements ITex
if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
- }
- else {
+ } else {
setLabelTextHelper(getFigure(), ""); //$NON-NLS-1$
setLabelIconHelper(getFigure(), null);
}
@@ -595,17 +592,15 @@ public class ParameterNameEditPart extends FloatingLabelEditPart implements ITex
* @generated
*/
protected void refreshUnderline() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
if (resolveSemanticElement() instanceof Feature) {
if (((Feature) resolveSemanticElement()).isStatic()) {
((WrappingLabel) getFigure()).setTextUnderline(true);
- }
- else {
+ } else {
((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
@@ -615,9 +610,8 @@ public class ParameterNameEditPart extends FloatingLabelEditPart implements ITex
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
@@ -628,14 +622,12 @@ public class ParameterNameEditPart extends FloatingLabelEditPart implements ITex
*/
@Override
protected void refreshFont() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ 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));
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -729,7 +721,7 @@ public class ParameterNameEditPart extends FloatingLabelEditPart implements ITex
*/
protected boolean checkExtendedEditor() {
if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -753,9 +745,9 @@ public class ParameterNameEditPart extends FloatingLabelEditPart implements ITex
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());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
@@ -769,8 +761,7 @@ public class ParameterNameEditPart extends FloatingLabelEditPart implements ITex
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement()
- .eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
@@ -822,18 +813,15 @@ public class ParameterNameEditPart extends FloatingLabelEditPart implements ITex
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)) {
+ } 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();
+ ISemanticParser modelParser = (ISemanticParser) getParser();
if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
if (resolveSemanticElement() != null) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PortAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PortAppliedStereotypeEditPart.java
index 176c9b4c242..10a9bd96b06 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PortAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PortAppliedStereotypeEditPart.java
@@ -127,6 +127,7 @@ public class PortAppliedStereotypeEditPart extends AbstractLabelEditPart impleme
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -233,8 +234,7 @@ public class PortAppliedStereotypeEditPart extends AbstractLabelEditPart impleme
/**
* @generated
*/
- public void setLabel(IFigure
- figure) {
+ public void setLabel(IFigure figure) {
unregisterVisuals();
setFigure(figure);
defaultText = getLabelTextHelper(figure);
@@ -345,15 +345,14 @@ public class PortAppliedStereotypeEditPart extends AbstractLabelEditPart impleme
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid =
- (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
@@ -482,8 +481,7 @@ public class PortAppliedStereotypeEditPart extends AbstractLabelEditPart impleme
IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- }
- else if (configuration instanceof IAdvancedEditorConfiguration) {
+ } 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);
@@ -528,8 +526,7 @@ public class PortAppliedStereotypeEditPart extends AbstractLabelEditPart impleme
RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- }
- else {
+ } else {
performDirectEdit();
}
}
@@ -566,8 +563,7 @@ public class PortAppliedStereotypeEditPart extends AbstractLabelEditPart impleme
if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
- }
- else {
+ } else {
setLabelTextHelper(getFigure(), ""); //$NON-NLS-1$
setLabelIconHelper(getFigure(), null);
}
@@ -586,17 +582,15 @@ public class PortAppliedStereotypeEditPart extends AbstractLabelEditPart impleme
* @generated
*/
protected void refreshUnderline() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
if (resolveSemanticElement() instanceof Feature) {
if (((Feature) resolveSemanticElement()).isStatic()) {
((WrappingLabel) getFigure()).setTextUnderline(true);
- }
- else {
+ } else {
((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
@@ -606,9 +600,8 @@ public class PortAppliedStereotypeEditPart extends AbstractLabelEditPart impleme
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
@@ -619,14 +612,12 @@ public class PortAppliedStereotypeEditPart extends AbstractLabelEditPart impleme
*/
@Override
protected void refreshFont() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ 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));
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -712,7 +703,7 @@ public class PortAppliedStereotypeEditPart extends AbstractLabelEditPart impleme
*/
protected boolean checkExtendedEditor() {
if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -736,9 +727,9 @@ public class PortAppliedStereotypeEditPart extends AbstractLabelEditPart impleme
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());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
@@ -752,8 +743,7 @@ public class PortAppliedStereotypeEditPart extends AbstractLabelEditPart impleme
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement()
- .eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
@@ -805,18 +795,15 @@ public class PortAppliedStereotypeEditPart extends AbstractLabelEditPart impleme
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)) {
+ } 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();
+ ISemanticParser modelParser = (ISemanticParser) getParser();
if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
if (resolveSemanticElement() != null) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PortEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PortEditPart.java
index 41e74f74366..ef692f3fcaf 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PortEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PortEditPart.java
@@ -89,7 +89,9 @@ public class PortEditPart extends RoundedBorderNamedElementEditPart {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, getPrimaryDragEditPolicy());
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeIconlDisplayEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, new PortLayoutEditPolicy());
@@ -110,22 +112,22 @@ public class PortEditPart extends RoundedBorderNamedElementEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case PortNameEditPart.VISUAL_ID:
case PortAppliedStereotypeEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -145,8 +147,9 @@ public class PortEditPart extends RoundedBorderNamedElementEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -164,6 +167,7 @@ public class PortEditPart extends RoundedBorderNamedElementEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -175,20 +179,22 @@ public class PortEditPart extends RoundedBorderNamedElementEditPart {
/**
* org.eclipse.papyrus.uml.diagram.composite.custom.figures.PortFigure
+ *
* @generated
*/
public PortFigure getPrimaryShape() {
- return (PortFigure)primaryShape;
+ return (PortFigure) primaryShape;
}
/**
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof PortNameEditPart) {
+ if (borderItemEditPart instanceof PortNameEditPart) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
- } else if(borderItemEditPart instanceof PortAppliedStereotypeEditPart) {
+ } else
+ if (borderItemEditPart instanceof PortAppliedStereotypeEditPart) {
IBorderItemLocator locator = new ExternalLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -216,12 +222,15 @@ public class PortEditPart extends RoundedBorderNamedElementEditPart {
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
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
@@ -232,7 +241,7 @@ public class PortEditPart extends RoundedBorderNamedElementEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -242,7 +251,7 @@ public class PortEditPart extends RoundedBorderNamedElementEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -258,8 +267,8 @@ public class PortEditPart extends RoundedBorderNamedElementEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PortNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PortNameEditPart.java
index 96bc90918f5..fe3cf499b5f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PortNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PortNameEditPart.java
@@ -71,6 +71,7 @@ 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.editpolicies.IndirectPortLabelEditPolicy;
import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
+import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil;
import org.eclipse.papyrus.uml.diagram.composite.edit.policies.UMLTextSelectionEditPolicy;
import org.eclipse.papyrus.uml.diagram.composite.part.UMLVisualIDRegistry;
import org.eclipse.papyrus.uml.diagram.composite.providers.UMLElementTypes;
@@ -128,6 +129,7 @@ public class PortNameEditPart extends FloatingLabelEditPart implements ITextAwar
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -235,8 +237,7 @@ public class PortNameEditPart extends FloatingLabelEditPart implements ITextAwar
/**
* @generated
*/
- public void setLabel(IFigure
- figure) {
+ public void setLabel(IFigure figure) {
unregisterVisuals();
setFigure(figure);
defaultText = getLabelTextHelper(figure);
@@ -282,7 +283,7 @@ public class PortNameEditPart extends FloatingLabelEditPart implements ITextAwar
if (parserElement == null) {
return null;
}
- List<View> views = org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramEditPartsUtil.findViews(parserElement, getViewer());
+ List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
for (View view : views) {
if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
@@ -357,15 +358,14 @@ public class PortNameEditPart extends FloatingLabelEditPart implements ITextAwar
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid =
- (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
@@ -494,8 +494,7 @@ public class PortNameEditPart extends FloatingLabelEditPart implements ITextAwar
IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- }
- else if (configuration instanceof IAdvancedEditorConfiguration) {
+ } 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);
@@ -540,8 +539,7 @@ public class PortNameEditPart extends FloatingLabelEditPart implements ITextAwar
RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- }
- else {
+ } else {
performDirectEdit();
}
}
@@ -578,8 +576,7 @@ public class PortNameEditPart extends FloatingLabelEditPart implements ITextAwar
if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
- }
- else {
+ } else {
setLabelTextHelper(getFigure(), ""); //$NON-NLS-1$
setLabelIconHelper(getFigure(), null);
}
@@ -598,17 +595,15 @@ public class PortNameEditPart extends FloatingLabelEditPart implements ITextAwar
* @generated
*/
protected void refreshUnderline() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
if (resolveSemanticElement() instanceof Feature) {
if (((Feature) resolveSemanticElement()).isStatic()) {
((WrappingLabel) getFigure()).setTextUnderline(true);
- }
- else {
+ } else {
((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
@@ -618,9 +613,8 @@ public class PortNameEditPart extends FloatingLabelEditPart implements ITextAwar
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
@@ -631,14 +625,12 @@ public class PortNameEditPart extends FloatingLabelEditPart implements ITextAwar
*/
@Override
protected void refreshFont() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ 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));
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -732,7 +724,7 @@ public class PortNameEditPart extends FloatingLabelEditPart implements ITextAwar
*/
protected boolean checkExtendedEditor() {
if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -756,9 +748,9 @@ public class PortNameEditPart extends FloatingLabelEditPart implements ITextAwar
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());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
@@ -772,8 +764,7 @@ public class PortNameEditPart extends FloatingLabelEditPart implements ITextAwar
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement()
- .eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
@@ -825,18 +816,15 @@ public class PortNameEditPart extends FloatingLabelEditPart implements ITextAwar
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)) {
+ } 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();
+ ISemanticParser modelParser = (ISemanticParser) getParser();
if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
if (resolveSemanticElement() != null) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PrimitiveTypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PrimitiveTypeEditPart.java
index 9b2b20a0689..bdedc30505e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PrimitiveTypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PrimitiveTypeEditPart.java
@@ -86,7 +86,9 @@ public class PrimitiveTypeEditPart extends RoundedCompartmentEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
@@ -105,21 +107,21 @@ public class PrimitiveTypeEditPart extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case PrimitiveTypeFloatingLabelEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -139,8 +141,9 @@ public class PrimitiveTypeEditPart extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -158,6 +161,7 @@ public class PrimitiveTypeEditPart extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -169,20 +173,23 @@ public class PrimitiveTypeEditPart extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.PrimitiveTypeFigure
+ *
* @generated
*/
public PrimitiveTypeFigure getPrimaryShape() {
- return (PrimitiveTypeFigure)primaryShape;
+ return (PrimitiveTypeFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof PrimitiveTypeNameEditPart) {
- ((PrimitiveTypeNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof PrimitiveTypeNameEditPart) {
+ ((PrimitiveTypeNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
+
+
return false;
}
@@ -190,7 +197,7 @@ public class PrimitiveTypeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof PrimitiveTypeNameEditPart) {
+ if (childEditPart instanceof PrimitiveTypeNameEditPart) {
return true;
}
return false;
@@ -200,7 +207,7 @@ public class PrimitiveTypeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -210,7 +217,7 @@ public class PrimitiveTypeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -220,7 +227,7 @@ public class PrimitiveTypeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -230,7 +237,7 @@ public class PrimitiveTypeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof PrimitiveTypeFloatingLabelEditPart) {
+ if (borderItemEditPart instanceof PrimitiveTypeFloatingLabelEditPart) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -253,16 +260,19 @@ public class PrimitiveTypeEditPart extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -274,7 +284,7 @@ public class PrimitiveTypeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -284,7 +294,7 @@ public class PrimitiveTypeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -300,8 +310,8 @@ public class PrimitiveTypeEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PrimitiveTypeEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PrimitiveTypeEditPartCN.java
index 3148978519e..05acedd5080 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PrimitiveTypeEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PrimitiveTypeEditPartCN.java
@@ -86,7 +86,9 @@ public class PrimitiveTypeEditPartCN extends RoundedCompartmentEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
@@ -105,21 +107,21 @@ public class PrimitiveTypeEditPartCN extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case PrimitiveTypeFloatingLabelEditPartCN.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -139,8 +141,9 @@ public class PrimitiveTypeEditPartCN extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -158,6 +161,7 @@ public class PrimitiveTypeEditPartCN extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -169,20 +173,23 @@ public class PrimitiveTypeEditPartCN extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.PrimitiveTypeFigure
+ *
* @generated
*/
public PrimitiveTypeFigure getPrimaryShape() {
- return (PrimitiveTypeFigure)primaryShape;
+ return (PrimitiveTypeFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof PrimitiveTypeNameEditPartCN) {
- ((PrimitiveTypeNameEditPartCN)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof PrimitiveTypeNameEditPartCN) {
+ ((PrimitiveTypeNameEditPartCN) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
+
+
return false;
}
@@ -190,7 +197,7 @@ public class PrimitiveTypeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof PrimitiveTypeNameEditPartCN) {
+ if (childEditPart instanceof PrimitiveTypeNameEditPartCN) {
return true;
}
return false;
@@ -200,7 +207,7 @@ public class PrimitiveTypeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -210,7 +217,7 @@ public class PrimitiveTypeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -220,7 +227,7 @@ public class PrimitiveTypeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -230,7 +237,7 @@ public class PrimitiveTypeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof PrimitiveTypeFloatingLabelEditPartCN) {
+ if (borderItemEditPart instanceof PrimitiveTypeFloatingLabelEditPartCN) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -253,16 +260,19 @@ public class PrimitiveTypeEditPartCN extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -274,7 +284,7 @@ public class PrimitiveTypeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -284,7 +294,7 @@ public class PrimitiveTypeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -300,8 +310,8 @@ public class PrimitiveTypeEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PrimitiveTypeFloatingLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PrimitiveTypeFloatingLabelEditPart.java
index 48103258b5d..e16b0a40872 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PrimitiveTypeFloatingLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PrimitiveTypeFloatingLabelEditPart.java
@@ -113,15 +113,18 @@ public class PrimitiveTypeFloatingLabelEditPart extends FloatingLabelEditPart im
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class PrimitiveTypeFloatingLabelEditPart extends FloatingLabelEditPart im
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class PrimitiveTypeFloatingLabelEditPart extends FloatingLabelEditPart im
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class PrimitiveTypeFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class PrimitiveTypeFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class PrimitiveTypeFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class PrimitiveTypeFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class PrimitiveTypeFloatingLabelEditPart extends FloatingLabelEditPart im
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class PrimitiveTypeFloatingLabelEditPart extends FloatingLabelEditPart im
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class PrimitiveTypeFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class PrimitiveTypeFloatingLabelEditPart extends FloatingLabelEditPart im
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class PrimitiveTypeFloatingLabelEditPart extends FloatingLabelEditPart im
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class PrimitiveTypeFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class PrimitiveTypeFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.PrimitiveType_2066, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.PrimitiveTypeFloatingLabelEditPart.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class PrimitiveTypeFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class PrimitiveTypeFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class PrimitiveTypeFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class PrimitiveTypeFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class PrimitiveTypeFloatingLabelEditPart extends FloatingLabelEditPart im
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class PrimitiveTypeFloatingLabelEditPart extends FloatingLabelEditPart im
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class PrimitiveTypeFloatingLabelEditPart extends FloatingLabelEditPart im
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class PrimitiveTypeFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class PrimitiveTypeFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class PrimitiveTypeFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class PrimitiveTypeFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class PrimitiveTypeFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class PrimitiveTypeFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class PrimitiveTypeFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class PrimitiveTypeFloatingLabelEditPart extends FloatingLabelEditPart im
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class PrimitiveTypeFloatingLabelEditPart extends FloatingLabelEditPart im
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class PrimitiveTypeFloatingLabelEditPart extends FloatingLabelEditPart im
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class PrimitiveTypeFloatingLabelEditPart extends FloatingLabelEditPart im
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PrimitiveTypeFloatingLabelEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PrimitiveTypeFloatingLabelEditPartCN.java
index 13bd772a68d..288ed8a2e02 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PrimitiveTypeFloatingLabelEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PrimitiveTypeFloatingLabelEditPartCN.java
@@ -113,15 +113,18 @@ public class PrimitiveTypeFloatingLabelEditPartCN extends FloatingLabelEditPart
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class PrimitiveTypeFloatingLabelEditPartCN extends FloatingLabelEditPart
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class PrimitiveTypeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class PrimitiveTypeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class PrimitiveTypeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class PrimitiveTypeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class PrimitiveTypeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class PrimitiveTypeFloatingLabelEditPartCN extends FloatingLabelEditPart
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class PrimitiveTypeFloatingLabelEditPartCN extends FloatingLabelEditPart
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class PrimitiveTypeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class PrimitiveTypeFloatingLabelEditPartCN extends FloatingLabelEditPart
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class PrimitiveTypeFloatingLabelEditPartCN extends FloatingLabelEditPart
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class PrimitiveTypeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class PrimitiveTypeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.PrimitiveType_3078, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.PrimitiveTypeFloatingLabelEditPartCN.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class PrimitiveTypeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class PrimitiveTypeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class PrimitiveTypeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class PrimitiveTypeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class PrimitiveTypeFloatingLabelEditPartCN extends FloatingLabelEditPart
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class PrimitiveTypeFloatingLabelEditPartCN extends FloatingLabelEditPart
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class PrimitiveTypeFloatingLabelEditPartCN extends FloatingLabelEditPart
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class PrimitiveTypeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class PrimitiveTypeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class PrimitiveTypeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class PrimitiveTypeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class PrimitiveTypeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class PrimitiveTypeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class PrimitiveTypeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class PrimitiveTypeFloatingLabelEditPartCN extends FloatingLabelEditPart
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class PrimitiveTypeFloatingLabelEditPartCN extends FloatingLabelEditPart
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class PrimitiveTypeFloatingLabelEditPartCN extends FloatingLabelEditPart
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class PrimitiveTypeFloatingLabelEditPartCN extends FloatingLabelEditPart
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PrimitiveTypeNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PrimitiveTypeNameEditPart.java
index 4d40bb19002..1842c02cdb9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PrimitiveTypeNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PrimitiveTypeNameEditPart.java
@@ -114,12 +114,14 @@ public class PrimitiveTypeNameEditPart extends PapyrusCompartmentEditPart implem
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class PrimitiveTypeNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class PrimitiveTypeNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class PrimitiveTypeNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class PrimitiveTypeNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class PrimitiveTypeNameEditPart extends PapyrusCompartmentEditPart implem
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class PrimitiveTypeNameEditPart extends PapyrusCompartmentEditPart implem
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class PrimitiveTypeNameEditPart extends PapyrusCompartmentEditPart implem
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class PrimitiveTypeNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class PrimitiveTypeNameEditPart extends PapyrusCompartmentEditPart implem
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class PrimitiveTypeNameEditPart extends PapyrusCompartmentEditPart implem
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class PrimitiveTypeNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class PrimitiveTypeNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.PrimitiveType_2066, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.PrimitiveTypeNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class PrimitiveTypeNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class PrimitiveTypeNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class PrimitiveTypeNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class PrimitiveTypeNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class PrimitiveTypeNameEditPart extends PapyrusCompartmentEditPart implem
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class PrimitiveTypeNameEditPart extends PapyrusCompartmentEditPart implem
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class PrimitiveTypeNameEditPart extends PapyrusCompartmentEditPart implem
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class PrimitiveTypeNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class PrimitiveTypeNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class PrimitiveTypeNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class PrimitiveTypeNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class PrimitiveTypeNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class PrimitiveTypeNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class PrimitiveTypeNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class PrimitiveTypeNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class PrimitiveTypeNameEditPart extends PapyrusCompartmentEditPart implem
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class PrimitiveTypeNameEditPart extends PapyrusCompartmentEditPart implem
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class PrimitiveTypeNameEditPart extends PapyrusCompartmentEditPart implem
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class PrimitiveTypeNameEditPart extends PapyrusCompartmentEditPart implem
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class PrimitiveTypeNameEditPart extends PapyrusCompartmentEditPart implem
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class PrimitiveTypeNameEditPart extends PapyrusCompartmentEditPart implem
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PrimitiveTypeNameEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PrimitiveTypeNameEditPartCN.java
index 77b2d7bd21d..8fd233ee96d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PrimitiveTypeNameEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PrimitiveTypeNameEditPartCN.java
@@ -114,12 +114,14 @@ public class PrimitiveTypeNameEditPartCN extends PapyrusCompartmentEditPart impl
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class PrimitiveTypeNameEditPartCN extends PapyrusCompartmentEditPart impl
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class PrimitiveTypeNameEditPartCN extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class PrimitiveTypeNameEditPartCN extends PapyrusCompartmentEditPart impl
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class PrimitiveTypeNameEditPartCN extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class PrimitiveTypeNameEditPartCN extends PapyrusCompartmentEditPart impl
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class PrimitiveTypeNameEditPartCN extends PapyrusCompartmentEditPart impl
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class PrimitiveTypeNameEditPartCN extends PapyrusCompartmentEditPart impl
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class PrimitiveTypeNameEditPartCN extends PapyrusCompartmentEditPart impl
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class PrimitiveTypeNameEditPartCN extends PapyrusCompartmentEditPart impl
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class PrimitiveTypeNameEditPartCN extends PapyrusCompartmentEditPart impl
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class PrimitiveTypeNameEditPartCN extends PapyrusCompartmentEditPart impl
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class PrimitiveTypeNameEditPartCN extends PapyrusCompartmentEditPart impl
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.PrimitiveType_3078, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.PrimitiveTypeNameEditPartCN.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class PrimitiveTypeNameEditPartCN extends PapyrusCompartmentEditPart impl
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class PrimitiveTypeNameEditPartCN extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class PrimitiveTypeNameEditPartCN extends PapyrusCompartmentEditPart impl
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class PrimitiveTypeNameEditPartCN extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class PrimitiveTypeNameEditPartCN extends PapyrusCompartmentEditPart impl
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class PrimitiveTypeNameEditPartCN extends PapyrusCompartmentEditPart impl
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class PrimitiveTypeNameEditPartCN extends PapyrusCompartmentEditPart impl
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class PrimitiveTypeNameEditPartCN extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class PrimitiveTypeNameEditPartCN extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class PrimitiveTypeNameEditPartCN extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class PrimitiveTypeNameEditPartCN extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class PrimitiveTypeNameEditPartCN extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class PrimitiveTypeNameEditPartCN extends PapyrusCompartmentEditPart impl
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class PrimitiveTypeNameEditPartCN extends PapyrusCompartmentEditPart impl
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class PrimitiveTypeNameEditPartCN extends PapyrusCompartmentEditPart impl
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class PrimitiveTypeNameEditPartCN extends PapyrusCompartmentEditPart impl
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class PrimitiveTypeNameEditPartCN extends PapyrusCompartmentEditPart impl
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class PrimitiveTypeNameEditPartCN extends PapyrusCompartmentEditPart impl
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class PrimitiveTypeNameEditPartCN extends PapyrusCompartmentEditPart impl
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class PrimitiveTypeNameEditPartCN extends PapyrusCompartmentEditPart impl
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class PrimitiveTypeNameEditPartCN extends PapyrusCompartmentEditPart impl
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PropertyEditPartCLN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PropertyEditPartCLN.java
index c37dbfdc968..1b48367001c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PropertyEditPartCLN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PropertyEditPartCLN.java
@@ -122,12 +122,14 @@ public class PropertyEditPartCLN extends CompartmentEditPart implements ITextAwa
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -143,7 +145,7 @@ public class PropertyEditPartCLN extends CompartmentEditPart implements ITextAwa
* @generated
*/
public DragTracker getDragTracker(Request request) {
- if(request instanceof SelectionRequest && ((SelectionRequest)request).getLastButtonPressed() == 3) {
+ if (request instanceof SelectionRequest && ((SelectionRequest) request).getLastButtonPressed() == 3) {
return null;
}
return new DragEditPartsTrackerEx(this);
@@ -164,12 +166,12 @@ public class PropertyEditPartCLN extends CompartmentEditPart implements ITextAwa
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -177,12 +179,12 @@ public class PropertyEditPartCLN extends CompartmentEditPart implements ITextAwa
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -190,12 +192,12 @@ public class PropertyEditPartCLN extends CompartmentEditPart implements ITextAwa
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -203,12 +205,12 @@ public class PropertyEditPartCLN extends CompartmentEditPart implements ITextAwa
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -256,12 +258,12 @@ public class PropertyEditPartCLN extends CompartmentEditPart implements ITextAwa
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -274,10 +276,12 @@ public class PropertyEditPartCLN extends CompartmentEditPart implements ITextAwa
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -289,12 +293,12 @@ public class PropertyEditPartCLN extends CompartmentEditPart implements ITextAwa
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -302,10 +306,12 @@ public class PropertyEditPartCLN extends CompartmentEditPart implements ITextAwa
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -323,15 +329,16 @@ public class PropertyEditPartCLN extends CompartmentEditPart implements ITextAwa
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -339,6 +346,7 @@ public class PropertyEditPartCLN extends CompartmentEditPart implements ITextAwa
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -349,7 +357,7 @@ public class PropertyEditPartCLN extends CompartmentEditPart implements ITextAwa
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -366,7 +374,7 @@ public class PropertyEditPartCLN extends CompartmentEditPart implements ITextAwa
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Property_3101, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.PropertyEditPartCLN.VISUAL_ID));
}
return parser;
@@ -376,8 +384,10 @@ public class PropertyEditPartCLN extends CompartmentEditPart implements ITextAwa
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -406,8 +416,8 @@ public class PropertyEditPartCLN extends CompartmentEditPart implements ITextAwa
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -415,8 +425,8 @@ public class PropertyEditPartCLN extends CompartmentEditPart implements ITextAwa
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -426,46 +436,52 @@ public class PropertyEditPartCLN extends CompartmentEditPart implements ITextAwa
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -487,12 +503,12 @@ public class PropertyEditPartCLN extends CompartmentEditPart implements ITextAwa
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -522,12 +538,12 @@ public class PropertyEditPartCLN extends CompartmentEditPart implements ITextAwa
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -536,12 +552,12 @@ public class PropertyEditPartCLN extends CompartmentEditPart implements ITextAwa
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -549,15 +565,16 @@ public class PropertyEditPartCLN extends CompartmentEditPart implements ITextAwa
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -566,9 +583,10 @@ public class PropertyEditPartCLN extends CompartmentEditPart implements ITextAwa
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -576,9 +594,12 @@ public class PropertyEditPartCLN extends CompartmentEditPart implements ITextAwa
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -594,11 +615,11 @@ public class PropertyEditPartCLN extends CompartmentEditPart implements ITextAwa
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -609,8 +630,8 @@ public class PropertyEditPartCLN extends CompartmentEditPart implements ITextAwa
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -622,7 +643,7 @@ public class PropertyEditPartCLN extends CompartmentEditPart implements ITextAwa
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -648,13 +669,14 @@ public class PropertyEditPartCLN extends CompartmentEditPart implements ITextAwa
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -666,8 +688,8 @@ public class PropertyEditPartCLN extends CompartmentEditPart implements ITextAwa
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -684,35 +706,40 @@ public class PropertyEditPartCLN extends CompartmentEditPart implements ITextAwa
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -722,12 +749,13 @@ public class PropertyEditPartCLN extends CompartmentEditPart implements ITextAwa
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -761,34 +789,35 @@ public class PropertyEditPartCLN extends CompartmentEditPart implements ITextAwa
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
- if(UMLPackage.eINSTANCE.getFeature_IsStatic().equals(feature)) {
+ if (UMLPackage.eINSTANCE.getFeature_IsStatic().equals(feature)) {
refreshUnderline();
}
super.handleNotificationEvent(event);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PropertyPartCompartmentEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PropertyPartCompartmentEditPartCN.java
index 105f346b083..1e7161a2ef8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PropertyPartCompartmentEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PropertyPartCompartmentEditPartCN.java
@@ -81,7 +81,7 @@ public class PropertyPartCompartmentEditPartCN extends LinkLFShapeCompartmentEdi
* @generated
*/
protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
+ if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
super.setRatio(ratio);
}
}
@@ -90,6 +90,7 @@ public class PropertyPartCompartmentEditPartCN extends LinkLFShapeCompartmentEdi
* @generated
*/
public EditPart getTargetEditPart(Request request) {
+
return super.getTargetEditPart(request);
}
@@ -98,7 +99,10 @@ public class PropertyPartCompartmentEditPartCN extends LinkLFShapeCompartmentEdi
*/
protected void handleNotificationEvent(Notification notification) {
Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
+ if (NotationPackage.eINSTANCE.getSize_Width().equals(feature)
+ || NotationPackage.eINSTANCE.getSize_Height().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_X().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
refreshBounds();
}
super.handleNotificationEvent(notification);
@@ -108,13 +112,16 @@ public class PropertyPartCompartmentEditPartCN extends LinkLFShapeCompartmentEdi
* @generated
*/
protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
+ ((GraphicalEditPart) getParent()).setLayoutConstraint(
+ this,
+ getFigure(),
+ new Rectangle(loc, size));
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PropertyPartEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PropertyPartEditPartCN.java
index 6e3a71bc3d6..7a32debb005 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PropertyPartEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PropertyPartEditPartCN.java
@@ -98,7 +98,9 @@ public class PropertyPartEditPartCN extends RoundedCompartmentEditPart {
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new DefaultCreationEditPolicy());
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
@@ -124,14 +126,14 @@ public class PropertyPartEditPartCN extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case PropertyPartFloatingLabelEditPartCN.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
@@ -140,7 +142,7 @@ public class PropertyPartEditPartCN extends RoundedCompartmentEditPart {
return new BorderItemResizableEditPolicy();
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -160,8 +162,9 @@ public class PropertyPartEditPartCN extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -179,6 +182,7 @@ public class PropertyPartEditPartCN extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -190,32 +194,40 @@ public class PropertyPartEditPartCN extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.composite.custom.figures.PropertyPartFigure
+ *
* @generated
*/
public PropertyPartFigure getPrimaryShape() {
- return (PropertyPartFigure)primaryShape;
+ return (PropertyPartFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof PropertyPartNameEditPartCN) {
- ((PropertyPartNameEditPartCN)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof PropertyPartNameEditPartCN) {
+ ((PropertyPartNameEditPartCN) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
- if(childEditPart instanceof PropertyPartCompartmentEditPartCN) {
+
+
+ if (childEditPart instanceof PropertyPartCompartmentEditPartCN) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((PropertyPartCompartmentEditPartCN)childEditPart).getFigure());
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.add(((PropertyPartCompartmentEditPartCN) childEditPart).getFigure());
return true;
}
- //Papyrus Gencode :Affixed Port locator
- if(childEditPart instanceof PortEditPart) {
+
+
+
+ // Papyrus Gencode :Affixed Port locator
+ if (childEditPart instanceof PortEditPart) {
IBorderItemLocator locator = new PortPositionLocator(getMainFigure(), PositionConstants.NONE);
- getBorderedFigure().getBorderItemContainer().add(((PortEditPart)childEditPart).getFigure(), locator);
+ getBorderedFigure().getBorderItemContainer().add(((PortEditPart) childEditPart).getFigure(), locator);
return true;
}
+
+
return false;
}
@@ -223,16 +235,16 @@ public class PropertyPartEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof PropertyPartNameEditPartCN) {
+ if (childEditPart instanceof PropertyPartNameEditPartCN) {
return true;
}
- if(childEditPart instanceof PropertyPartCompartmentEditPartCN) {
+ if (childEditPart instanceof PropertyPartCompartmentEditPartCN) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- pane.remove(((PropertyPartCompartmentEditPartCN)childEditPart).getFigure());
+ pane.remove(((PropertyPartCompartmentEditPartCN) childEditPart).getFigure());
return true;
}
- if(childEditPart instanceof PortEditPart) {
- getBorderedFigure().getBorderItemContainer().remove(((PortEditPart)childEditPart).getFigure());
+ if (childEditPart instanceof PortEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((PortEditPart) childEditPart).getFigure());
return true;
}
return false;
@@ -242,7 +254,7 @@ public class PropertyPartEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -252,7 +264,7 @@ public class PropertyPartEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -262,10 +274,10 @@ public class PropertyPartEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof PropertyPartCompartmentEditPartCN) {
+ if (editPart instanceof PropertyPartCompartmentEditPartCN) {
return getPrimaryShape().getCompositeCompartmentFigure();
}
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -275,7 +287,7 @@ public class PropertyPartEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof PropertyPartFloatingLabelEditPartCN) {
+ if (borderItemEditPart instanceof PropertyPartFloatingLabelEditPartCN) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -298,16 +310,19 @@ public class PropertyPartEditPartCN extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -319,7 +334,7 @@ public class PropertyPartEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -329,7 +344,7 @@ public class PropertyPartEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -345,8 +360,8 @@ public class PropertyPartEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PropertyPartFloatingLabelEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PropertyPartFloatingLabelEditPartCN.java
index 34b2a36316c..a565e341096 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PropertyPartFloatingLabelEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PropertyPartFloatingLabelEditPartCN.java
@@ -113,15 +113,18 @@ public class PropertyPartFloatingLabelEditPartCN extends FloatingLabelEditPart i
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class PropertyPartFloatingLabelEditPartCN extends FloatingLabelEditPart i
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class PropertyPartFloatingLabelEditPartCN extends FloatingLabelEditPart i
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class PropertyPartFloatingLabelEditPartCN extends FloatingLabelEditPart i
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class PropertyPartFloatingLabelEditPartCN extends FloatingLabelEditPart i
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class PropertyPartFloatingLabelEditPartCN extends FloatingLabelEditPart i
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class PropertyPartFloatingLabelEditPartCN extends FloatingLabelEditPart i
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class PropertyPartFloatingLabelEditPartCN extends FloatingLabelEditPart i
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class PropertyPartFloatingLabelEditPartCN extends FloatingLabelEditPart i
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class PropertyPartFloatingLabelEditPartCN extends FloatingLabelEditPart i
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class PropertyPartFloatingLabelEditPartCN extends FloatingLabelEditPart i
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class PropertyPartFloatingLabelEditPartCN extends FloatingLabelEditPart i
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class PropertyPartFloatingLabelEditPartCN extends FloatingLabelEditPart i
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class PropertyPartFloatingLabelEditPartCN extends FloatingLabelEditPart i
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Property_3070, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.PropertyPartFloatingLabelEditPartCN.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class PropertyPartFloatingLabelEditPartCN extends FloatingLabelEditPart i
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class PropertyPartFloatingLabelEditPartCN extends FloatingLabelEditPart i
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class PropertyPartFloatingLabelEditPartCN extends FloatingLabelEditPart i
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class PropertyPartFloatingLabelEditPartCN extends FloatingLabelEditPart i
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class PropertyPartFloatingLabelEditPartCN extends FloatingLabelEditPart i
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class PropertyPartFloatingLabelEditPartCN extends FloatingLabelEditPart i
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class PropertyPartFloatingLabelEditPartCN extends FloatingLabelEditPart i
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class PropertyPartFloatingLabelEditPartCN extends FloatingLabelEditPart i
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class PropertyPartFloatingLabelEditPartCN extends FloatingLabelEditPart i
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class PropertyPartFloatingLabelEditPartCN extends FloatingLabelEditPart i
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class PropertyPartFloatingLabelEditPartCN extends FloatingLabelEditPart i
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class PropertyPartFloatingLabelEditPartCN extends FloatingLabelEditPart i
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class PropertyPartFloatingLabelEditPartCN extends FloatingLabelEditPart i
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class PropertyPartFloatingLabelEditPartCN extends FloatingLabelEditPart i
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class PropertyPartFloatingLabelEditPartCN extends FloatingLabelEditPart i
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class PropertyPartFloatingLabelEditPartCN extends FloatingLabelEditPart i
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class PropertyPartFloatingLabelEditPartCN extends FloatingLabelEditPart i
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class PropertyPartFloatingLabelEditPartCN extends FloatingLabelEditPart i
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PropertyPartNameEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PropertyPartNameEditPartCN.java
index 5463ff4eb5f..927c9300d7d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PropertyPartNameEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PropertyPartNameEditPartCN.java
@@ -115,12 +115,14 @@ public class PropertyPartNameEditPartCN extends PapyrusCompartmentEditPart imple
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -147,12 +149,12 @@ public class PropertyPartNameEditPartCN extends PapyrusCompartmentEditPart imple
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -160,12 +162,12 @@ public class PropertyPartNameEditPartCN extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -173,12 +175,12 @@ public class PropertyPartNameEditPartCN extends PapyrusCompartmentEditPart imple
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -186,12 +188,12 @@ public class PropertyPartNameEditPartCN extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -239,12 +241,12 @@ public class PropertyPartNameEditPartCN extends PapyrusCompartmentEditPart imple
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -257,10 +259,12 @@ public class PropertyPartNameEditPartCN extends PapyrusCompartmentEditPart imple
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -272,12 +276,12 @@ public class PropertyPartNameEditPartCN extends PapyrusCompartmentEditPart imple
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -285,10 +289,12 @@ public class PropertyPartNameEditPartCN extends PapyrusCompartmentEditPart imple
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -306,15 +312,16 @@ public class PropertyPartNameEditPartCN extends PapyrusCompartmentEditPart imple
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -322,6 +329,7 @@ public class PropertyPartNameEditPartCN extends PapyrusCompartmentEditPart imple
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -332,7 +340,7 @@ public class PropertyPartNameEditPartCN extends PapyrusCompartmentEditPart imple
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -349,7 +357,7 @@ public class PropertyPartNameEditPartCN extends PapyrusCompartmentEditPart imple
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Property_3070, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.PropertyPartNameEditPartCN.VISUAL_ID));
}
return parser;
@@ -359,8 +367,10 @@ public class PropertyPartNameEditPartCN extends PapyrusCompartmentEditPart imple
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -389,8 +399,8 @@ public class PropertyPartNameEditPartCN extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -398,8 +408,8 @@ public class PropertyPartNameEditPartCN extends PapyrusCompartmentEditPart imple
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -409,46 +419,52 @@ public class PropertyPartNameEditPartCN extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -470,12 +486,12 @@ public class PropertyPartNameEditPartCN extends PapyrusCompartmentEditPart imple
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -505,12 +521,12 @@ public class PropertyPartNameEditPartCN extends PapyrusCompartmentEditPart imple
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -519,12 +535,12 @@ public class PropertyPartNameEditPartCN extends PapyrusCompartmentEditPart imple
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -532,15 +548,16 @@ public class PropertyPartNameEditPartCN extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -549,9 +566,10 @@ public class PropertyPartNameEditPartCN extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -559,9 +577,12 @@ public class PropertyPartNameEditPartCN extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -577,11 +598,11 @@ public class PropertyPartNameEditPartCN extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -592,8 +613,8 @@ public class PropertyPartNameEditPartCN extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -605,7 +626,7 @@ public class PropertyPartNameEditPartCN extends PapyrusCompartmentEditPart imple
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -631,13 +652,14 @@ public class PropertyPartNameEditPartCN extends PapyrusCompartmentEditPart imple
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -649,8 +671,8 @@ public class PropertyPartNameEditPartCN extends PapyrusCompartmentEditPart imple
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -667,35 +689,40 @@ public class PropertyPartNameEditPartCN extends PapyrusCompartmentEditPart imple
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -705,12 +732,13 @@ public class PropertyPartNameEditPartCN extends PapyrusCompartmentEditPart imple
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -745,31 +773,32 @@ public class PropertyPartNameEditPartCN extends PapyrusCompartmentEditPart imple
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -800,7 +829,8 @@ public class PropertyPartNameEditPartCN extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -809,6 +839,7 @@ public class PropertyPartNameEditPartCN extends PapyrusCompartmentEditPart imple
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -816,5 +847,6 @@ public class PropertyPartNameEditPartCN extends PapyrusCompartmentEditPart imple
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ProtocolStateMachineCompositeCompartmentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ProtocolStateMachineCompositeCompartmentEditPart.java
index 40b7f4214f8..15df2b5e09d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ProtocolStateMachineCompositeCompartmentEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ProtocolStateMachineCompositeCompartmentEditPart.java
@@ -81,7 +81,7 @@ public class ProtocolStateMachineCompositeCompartmentEditPart extends LinkLFShap
* @generated
*/
protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
+ if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
super.setRatio(ratio);
}
}
@@ -90,6 +90,7 @@ public class ProtocolStateMachineCompositeCompartmentEditPart extends LinkLFShap
* @generated
*/
public EditPart getTargetEditPart(Request request) {
+
return super.getTargetEditPart(request);
}
@@ -98,7 +99,10 @@ public class ProtocolStateMachineCompositeCompartmentEditPart extends LinkLFShap
*/
protected void handleNotificationEvent(Notification notification) {
Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
+ if (NotationPackage.eINSTANCE.getSize_Width().equals(feature)
+ || NotationPackage.eINSTANCE.getSize_Height().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_X().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
refreshBounds();
}
super.handleNotificationEvent(notification);
@@ -108,13 +112,16 @@ public class ProtocolStateMachineCompositeCompartmentEditPart extends LinkLFShap
* @generated
*/
protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
+ ((GraphicalEditPart) getParent()).setLayoutConstraint(
+ this,
+ getFigure(),
+ new Rectangle(loc, size));
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ProtocolStateMachineCompositeCompartmentEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ProtocolStateMachineCompositeCompartmentEditPartCN.java
index ad52cb84614..b6691cc551e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ProtocolStateMachineCompositeCompartmentEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ProtocolStateMachineCompositeCompartmentEditPartCN.java
@@ -81,7 +81,7 @@ public class ProtocolStateMachineCompositeCompartmentEditPartCN extends LinkLFSh
* @generated
*/
protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
+ if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
super.setRatio(ratio);
}
}
@@ -90,6 +90,7 @@ public class ProtocolStateMachineCompositeCompartmentEditPartCN extends LinkLFSh
* @generated
*/
public EditPart getTargetEditPart(Request request) {
+
return super.getTargetEditPart(request);
}
@@ -98,7 +99,10 @@ public class ProtocolStateMachineCompositeCompartmentEditPartCN extends LinkLFSh
*/
protected void handleNotificationEvent(Notification notification) {
Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
+ if (NotationPackage.eINSTANCE.getSize_Width().equals(feature)
+ || NotationPackage.eINSTANCE.getSize_Height().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_X().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
refreshBounds();
}
super.handleNotificationEvent(notification);
@@ -108,13 +112,16 @@ public class ProtocolStateMachineCompositeCompartmentEditPartCN extends LinkLFSh
* @generated
*/
protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
+ ((GraphicalEditPart) getParent()).setLayoutConstraint(
+ this,
+ getFigure(),
+ new Rectangle(loc, size));
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ProtocolStateMachineCompositeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ProtocolStateMachineCompositeEditPart.java
index 261ee447c33..031a3656b56 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ProtocolStateMachineCompositeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ProtocolStateMachineCompositeEditPart.java
@@ -97,7 +97,9 @@ public class ProtocolStateMachineCompositeEditPart extends RoundedCompartmentEdi
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new DefaultCreationEditPolicy());
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
@@ -179,6 +181,7 @@ public class ProtocolStateMachineCompositeEditPart extends RoundedCompartmentEdi
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -205,24 +208,35 @@ public class ProtocolStateMachineCompositeEditPart extends RoundedCompartmentEdi
((ProtocolStateMachineCompositeNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
+
+
if (childEditPart instanceof ProtocolStateMachineCompositeCompartmentEditPart) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
pane.add(((ProtocolStateMachineCompositeCompartmentEditPart) childEditPart).getFigure());
return true;
}
+
+
+
// Papyrus Gencode :Affixed Port locator
if (childEditPart instanceof PortEditPart) {
IBorderItemLocator locator = new PortPositionLocator(getMainFigure(), PositionConstants.NONE);
getBorderedFigure().getBorderItemContainer().add(((PortEditPart) childEditPart).getFigure(), locator);
return true;
}
+
+
+
+
// Papyrus Gencode :Affixed Port locator
if (childEditPart instanceof ParameterEditPart) {
IBorderItemLocator locator = new PortPositionLocator(getMainFigure(), PositionConstants.NONE);
getBorderedFigure().getBorderItemContainer().add(((ParameterEditPart) childEditPart).getFigure(), locator);
return true;
}
+
+
return false;
}
@@ -309,6 +323,7 @@ public class ProtocolStateMachineCompositeEditPart extends RoundedCompartmentEdi
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ProtocolStateMachineCompositeEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ProtocolStateMachineCompositeEditPartCN.java
index 019fef7c84e..e904b5b5884 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ProtocolStateMachineCompositeEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ProtocolStateMachineCompositeEditPartCN.java
@@ -96,7 +96,9 @@ public class ProtocolStateMachineCompositeEditPartCN extends RoundedCompartmentE
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new DefaultCreationEditPolicy());
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
@@ -120,14 +122,14 @@ public class ProtocolStateMachineCompositeEditPartCN extends RoundedCompartmentE
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case ProtocolStateMachineCompositeFloatingLabelEditPartCN.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
@@ -137,7 +139,7 @@ public class ProtocolStateMachineCompositeEditPartCN extends RoundedCompartmentE
return new BorderItemResizableEditPolicy();
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -157,8 +159,9 @@ public class ProtocolStateMachineCompositeEditPartCN extends RoundedCompartmentE
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -176,6 +179,7 @@ public class ProtocolStateMachineCompositeEditPartCN extends RoundedCompartmentE
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -187,38 +191,50 @@ public class ProtocolStateMachineCompositeEditPartCN extends RoundedCompartmentE
/**
* org.eclipse.papyrus.uml.diagram.composite.custom.figures.ProtocolStateMachineCompositeFigure
+ *
* @generated
*/
public ProtocolStateMachineCompositeFigure getPrimaryShape() {
- return (ProtocolStateMachineCompositeFigure)primaryShape;
+ return (ProtocolStateMachineCompositeFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ProtocolStateMachineCompositeNameEditPartCN) {
- ((ProtocolStateMachineCompositeNameEditPartCN)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof ProtocolStateMachineCompositeNameEditPartCN) {
+ ((ProtocolStateMachineCompositeNameEditPartCN) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
- if(childEditPart instanceof ProtocolStateMachineCompositeCompartmentEditPartCN) {
+
+
+ if (childEditPart instanceof ProtocolStateMachineCompositeCompartmentEditPartCN) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((ProtocolStateMachineCompositeCompartmentEditPartCN)childEditPart).getFigure());
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.add(((ProtocolStateMachineCompositeCompartmentEditPartCN) childEditPart).getFigure());
return true;
}
- //Papyrus Gencode :Affixed Port locator
- if(childEditPart instanceof PortEditPart) {
+
+
+
+ // Papyrus Gencode :Affixed Port locator
+ if (childEditPart instanceof PortEditPart) {
IBorderItemLocator locator = new PortPositionLocator(getMainFigure(), PositionConstants.NONE);
- getBorderedFigure().getBorderItemContainer().add(((PortEditPart)childEditPart).getFigure(), locator);
+ getBorderedFigure().getBorderItemContainer().add(((PortEditPart) childEditPart).getFigure(), locator);
return true;
}
- //Papyrus Gencode :Affixed Port locator
- if(childEditPart instanceof ParameterEditPart) {
+
+
+
+
+ // Papyrus Gencode :Affixed Port locator
+ if (childEditPart instanceof ParameterEditPart) {
IBorderItemLocator locator = new PortPositionLocator(getMainFigure(), PositionConstants.NONE);
- getBorderedFigure().getBorderItemContainer().add(((ParameterEditPart)childEditPart).getFigure(), locator);
+ getBorderedFigure().getBorderItemContainer().add(((ParameterEditPart) childEditPart).getFigure(), locator);
return true;
}
+
+
return false;
}
@@ -226,20 +242,20 @@ public class ProtocolStateMachineCompositeEditPartCN extends RoundedCompartmentE
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ProtocolStateMachineCompositeNameEditPartCN) {
+ if (childEditPart instanceof ProtocolStateMachineCompositeNameEditPartCN) {
return true;
}
- if(childEditPart instanceof ProtocolStateMachineCompositeCompartmentEditPartCN) {
+ if (childEditPart instanceof ProtocolStateMachineCompositeCompartmentEditPartCN) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- pane.remove(((ProtocolStateMachineCompositeCompartmentEditPartCN)childEditPart).getFigure());
+ pane.remove(((ProtocolStateMachineCompositeCompartmentEditPartCN) childEditPart).getFigure());
return true;
}
- if(childEditPart instanceof PortEditPart) {
- getBorderedFigure().getBorderItemContainer().remove(((PortEditPart)childEditPart).getFigure());
+ if (childEditPart instanceof PortEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((PortEditPart) childEditPart).getFigure());
return true;
}
- if(childEditPart instanceof ParameterEditPart) {
- getBorderedFigure().getBorderItemContainer().remove(((ParameterEditPart)childEditPart).getFigure());
+ if (childEditPart instanceof ParameterEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((ParameterEditPart) childEditPart).getFigure());
return true;
}
return false;
@@ -249,7 +265,7 @@ public class ProtocolStateMachineCompositeEditPartCN extends RoundedCompartmentE
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -259,7 +275,7 @@ public class ProtocolStateMachineCompositeEditPartCN extends RoundedCompartmentE
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -269,10 +285,10 @@ public class ProtocolStateMachineCompositeEditPartCN extends RoundedCompartmentE
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof ProtocolStateMachineCompositeCompartmentEditPartCN) {
+ if (editPart instanceof ProtocolStateMachineCompositeCompartmentEditPartCN) {
return getPrimaryShape().getCompositeCompartmentFigure();
}
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -282,7 +298,7 @@ public class ProtocolStateMachineCompositeEditPartCN extends RoundedCompartmentE
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof ProtocolStateMachineCompositeFloatingLabelEditPartCN) {
+ if (borderItemEditPart instanceof ProtocolStateMachineCompositeFloatingLabelEditPartCN) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -305,16 +321,19 @@ public class ProtocolStateMachineCompositeEditPartCN extends RoundedCompartmentE
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -326,7 +345,7 @@ public class ProtocolStateMachineCompositeEditPartCN extends RoundedCompartmentE
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -336,7 +355,7 @@ public class ProtocolStateMachineCompositeEditPartCN extends RoundedCompartmentE
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -352,8 +371,8 @@ public class ProtocolStateMachineCompositeEditPartCN extends RoundedCompartmentE
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ProtocolStateMachineCompositeFloatingLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ProtocolStateMachineCompositeFloatingLabelEditPart.java
index 7c4f2a660db..674a1749800 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ProtocolStateMachineCompositeFloatingLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ProtocolStateMachineCompositeFloatingLabelEditPart.java
@@ -113,15 +113,18 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPart extends Floating
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPart extends Floating
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPart extends Floating
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPart extends Floating
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPart extends Floating
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPart extends Floating
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPart extends Floating
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPart extends Floating
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPart extends Floating
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPart extends Floating
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPart extends Floating
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPart extends Floating
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPart extends Floating
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPart extends Floating
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.ProtocolStateMachine_2062, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.ProtocolStateMachineCompositeFloatingLabelEditPart.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPart extends Floating
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPart extends Floating
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPart extends Floating
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPart extends Floating
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPart extends Floating
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPart extends Floating
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPart extends Floating
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPart extends Floating
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPart extends Floating
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPart extends Floating
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPart extends Floating
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPart extends Floating
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPart extends Floating
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPart extends Floating
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPart extends Floating
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPart extends Floating
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPart extends Floating
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPart extends Floating
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ProtocolStateMachineCompositeFloatingLabelEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ProtocolStateMachineCompositeFloatingLabelEditPartCN.java
index 5a37b319497..18067a731f0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ProtocolStateMachineCompositeFloatingLabelEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ProtocolStateMachineCompositeFloatingLabelEditPartCN.java
@@ -113,15 +113,18 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPartCN extends Floati
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPartCN extends Floati
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPartCN extends Floati
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPartCN extends Floati
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPartCN extends Floati
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPartCN extends Floati
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPartCN extends Floati
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPartCN extends Floati
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPartCN extends Floati
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPartCN extends Floati
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPartCN extends Floati
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPartCN extends Floati
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPartCN extends Floati
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPartCN extends Floati
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.ProtocolStateMachine_3074, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.ProtocolStateMachineCompositeFloatingLabelEditPartCN.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPartCN extends Floati
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPartCN extends Floati
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPartCN extends Floati
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPartCN extends Floati
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPartCN extends Floati
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPartCN extends Floati
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPartCN extends Floati
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPartCN extends Floati
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPartCN extends Floati
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPartCN extends Floati
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPartCN extends Floati
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPartCN extends Floati
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPartCN extends Floati
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPartCN extends Floati
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPartCN extends Floati
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPartCN extends Floati
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPartCN extends Floati
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class ProtocolStateMachineCompositeFloatingLabelEditPartCN extends Floati
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ProtocolStateMachineCompositeNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ProtocolStateMachineCompositeNameEditPart.java
index d308a227790..c1a0783d083 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ProtocolStateMachineCompositeNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ProtocolStateMachineCompositeNameEditPart.java
@@ -114,12 +114,14 @@ public class ProtocolStateMachineCompositeNameEditPart extends PapyrusCompartmen
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class ProtocolStateMachineCompositeNameEditPart extends PapyrusCompartmen
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class ProtocolStateMachineCompositeNameEditPart extends PapyrusCompartmen
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class ProtocolStateMachineCompositeNameEditPart extends PapyrusCompartmen
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class ProtocolStateMachineCompositeNameEditPart extends PapyrusCompartmen
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class ProtocolStateMachineCompositeNameEditPart extends PapyrusCompartmen
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class ProtocolStateMachineCompositeNameEditPart extends PapyrusCompartmen
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class ProtocolStateMachineCompositeNameEditPart extends PapyrusCompartmen
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class ProtocolStateMachineCompositeNameEditPart extends PapyrusCompartmen
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class ProtocolStateMachineCompositeNameEditPart extends PapyrusCompartmen
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class ProtocolStateMachineCompositeNameEditPart extends PapyrusCompartmen
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class ProtocolStateMachineCompositeNameEditPart extends PapyrusCompartmen
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class ProtocolStateMachineCompositeNameEditPart extends PapyrusCompartmen
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.ProtocolStateMachine_2062, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.ProtocolStateMachineCompositeNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class ProtocolStateMachineCompositeNameEditPart extends PapyrusCompartmen
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class ProtocolStateMachineCompositeNameEditPart extends PapyrusCompartmen
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class ProtocolStateMachineCompositeNameEditPart extends PapyrusCompartmen
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class ProtocolStateMachineCompositeNameEditPart extends PapyrusCompartmen
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class ProtocolStateMachineCompositeNameEditPart extends PapyrusCompartmen
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class ProtocolStateMachineCompositeNameEditPart extends PapyrusCompartmen
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class ProtocolStateMachineCompositeNameEditPart extends PapyrusCompartmen
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class ProtocolStateMachineCompositeNameEditPart extends PapyrusCompartmen
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class ProtocolStateMachineCompositeNameEditPart extends PapyrusCompartmen
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class ProtocolStateMachineCompositeNameEditPart extends PapyrusCompartmen
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class ProtocolStateMachineCompositeNameEditPart extends PapyrusCompartmen
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class ProtocolStateMachineCompositeNameEditPart extends PapyrusCompartmen
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class ProtocolStateMachineCompositeNameEditPart extends PapyrusCompartmen
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class ProtocolStateMachineCompositeNameEditPart extends PapyrusCompartmen
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class ProtocolStateMachineCompositeNameEditPart extends PapyrusCompartmen
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class ProtocolStateMachineCompositeNameEditPart extends PapyrusCompartmen
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class ProtocolStateMachineCompositeNameEditPart extends PapyrusCompartmen
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class ProtocolStateMachineCompositeNameEditPart extends PapyrusCompartmen
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class ProtocolStateMachineCompositeNameEditPart extends PapyrusCompartmen
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class ProtocolStateMachineCompositeNameEditPart extends PapyrusCompartmen
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class ProtocolStateMachineCompositeNameEditPart extends PapyrusCompartmen
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ProtocolStateMachineCompositeNameEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ProtocolStateMachineCompositeNameEditPartCN.java
index ba2a680a928..39b2ff1e074 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ProtocolStateMachineCompositeNameEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/ProtocolStateMachineCompositeNameEditPartCN.java
@@ -114,12 +114,14 @@ public class ProtocolStateMachineCompositeNameEditPartCN extends PapyrusCompartm
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class ProtocolStateMachineCompositeNameEditPartCN extends PapyrusCompartm
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class ProtocolStateMachineCompositeNameEditPartCN extends PapyrusCompartm
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class ProtocolStateMachineCompositeNameEditPartCN extends PapyrusCompartm
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class ProtocolStateMachineCompositeNameEditPartCN extends PapyrusCompartm
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class ProtocolStateMachineCompositeNameEditPartCN extends PapyrusCompartm
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class ProtocolStateMachineCompositeNameEditPartCN extends PapyrusCompartm
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class ProtocolStateMachineCompositeNameEditPartCN extends PapyrusCompartm
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class ProtocolStateMachineCompositeNameEditPartCN extends PapyrusCompartm
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class ProtocolStateMachineCompositeNameEditPartCN extends PapyrusCompartm
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class ProtocolStateMachineCompositeNameEditPartCN extends PapyrusCompartm
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class ProtocolStateMachineCompositeNameEditPartCN extends PapyrusCompartm
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class ProtocolStateMachineCompositeNameEditPartCN extends PapyrusCompartm
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.ProtocolStateMachine_3074, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.ProtocolStateMachineCompositeNameEditPartCN.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class ProtocolStateMachineCompositeNameEditPartCN extends PapyrusCompartm
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class ProtocolStateMachineCompositeNameEditPartCN extends PapyrusCompartm
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class ProtocolStateMachineCompositeNameEditPartCN extends PapyrusCompartm
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class ProtocolStateMachineCompositeNameEditPartCN extends PapyrusCompartm
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class ProtocolStateMachineCompositeNameEditPartCN extends PapyrusCompartm
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class ProtocolStateMachineCompositeNameEditPartCN extends PapyrusCompartm
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class ProtocolStateMachineCompositeNameEditPartCN extends PapyrusCompartm
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class ProtocolStateMachineCompositeNameEditPartCN extends PapyrusCompartm
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class ProtocolStateMachineCompositeNameEditPartCN extends PapyrusCompartm
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class ProtocolStateMachineCompositeNameEditPartCN extends PapyrusCompartm
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class ProtocolStateMachineCompositeNameEditPartCN extends PapyrusCompartm
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class ProtocolStateMachineCompositeNameEditPartCN extends PapyrusCompartm
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class ProtocolStateMachineCompositeNameEditPartCN extends PapyrusCompartm
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class ProtocolStateMachineCompositeNameEditPartCN extends PapyrusCompartm
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class ProtocolStateMachineCompositeNameEditPartCN extends PapyrusCompartm
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class ProtocolStateMachineCompositeNameEditPartCN extends PapyrusCompartm
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class ProtocolStateMachineCompositeNameEditPartCN extends PapyrusCompartm
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class ProtocolStateMachineCompositeNameEditPartCN extends PapyrusCompartm
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class ProtocolStateMachineCompositeNameEditPartCN extends PapyrusCompartm
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class ProtocolStateMachineCompositeNameEditPartCN extends PapyrusCompartm
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class ProtocolStateMachineCompositeNameEditPartCN extends PapyrusCompartm
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/RealizationAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/RealizationAppliedStereotypeEditPart.java
index 93be5b043a8..ad309c43547 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/RealizationAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/RealizationAppliedStereotypeEditPart.java
@@ -123,6 +123,7 @@ public class RealizationAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -211,8 +212,7 @@ public class RealizationAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* @generated
*/
- public void setLabel(IFigure
- figure) {
+ public void setLabel(IFigure figure) {
unregisterVisuals();
setFigure(figure);
defaultText = getLabelTextHelper(figure);
@@ -324,15 +324,14 @@ public class RealizationAppliedStereotypeEditPart extends PapyrusLabelEditPart i
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid =
- (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
@@ -461,8 +460,7 @@ public class RealizationAppliedStereotypeEditPart extends PapyrusLabelEditPart i
IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- }
- else if (configuration instanceof IAdvancedEditorConfiguration) {
+ } 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);
@@ -507,8 +505,7 @@ public class RealizationAppliedStereotypeEditPart extends PapyrusLabelEditPart i
RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- }
- else {
+ } else {
performDirectEdit();
}
}
@@ -558,17 +555,15 @@ public class RealizationAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
protected void refreshUnderline() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
if (resolveSemanticElement() instanceof Feature) {
if (((Feature) resolveSemanticElement()).isStatic()) {
((WrappingLabel) getFigure()).setTextUnderline(true);
- }
- else {
+ } else {
((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
@@ -578,9 +573,8 @@ public class RealizationAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
@@ -591,14 +585,12 @@ public class RealizationAppliedStereotypeEditPart extends PapyrusLabelEditPart i
*/
@Override
protected void refreshFont() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ 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));
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -684,7 +676,7 @@ public class RealizationAppliedStereotypeEditPart extends PapyrusLabelEditPart i
*/
protected boolean checkExtendedEditor() {
if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -708,9 +700,9 @@ public class RealizationAppliedStereotypeEditPart extends PapyrusLabelEditPart i
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());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
@@ -724,8 +716,7 @@ public class RealizationAppliedStereotypeEditPart extends PapyrusLabelEditPart i
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement()
- .eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
@@ -777,18 +768,15 @@ public class RealizationAppliedStereotypeEditPart extends PapyrusLabelEditPart i
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)) {
+ } 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();
+ ISemanticParser modelParser = (ISemanticParser) getParser();
if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
if (resolveSemanticElement() != null) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/RealizationEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/RealizationEditPart.java
index aa78cd42d51..39bee50f579 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/RealizationEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/RealizationEditPart.java
@@ -51,11 +51,13 @@ public class RealizationEditPart extends UMLConnectionNodeEditPart implements IT
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof RealizationNameEditPart) {
- ((RealizationNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof RealizationNameEditPart) {
+ ((RealizationNameEditPart) childEditPart).setLabel(
+ getPrimaryShape().getNameLabel());
}
- if(childEditPart instanceof RealizationAppliedStereotypeEditPart) {
- ((RealizationAppliedStereotypeEditPart)childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
+ if (childEditPart instanceof RealizationAppliedStereotypeEditPart) {
+ ((RealizationAppliedStereotypeEditPart) childEditPart).setLabel(
+ getPrimaryShape().getAppliedStereotypeLabel());
}
return false;
}
@@ -64,7 +66,7 @@ public class RealizationEditPart extends UMLConnectionNodeEditPart implements IT
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -74,10 +76,10 @@ public class RealizationEditPart extends UMLConnectionNodeEditPart implements IT
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof RealizationNameEditPart) {
+ if (childEditPart instanceof RealizationNameEditPart) {
return true;
}
- if(childEditPart instanceof RealizationAppliedStereotypeEditPart) {
+ if (childEditPart instanceof RealizationAppliedStereotypeEditPart) {
return true;
}
return false;
@@ -87,7 +89,7 @@ public class RealizationEditPart extends UMLConnectionNodeEditPart implements IT
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -109,6 +111,6 @@ public class RealizationEditPart extends UMLConnectionNodeEditPart implements IT
* @generated
*/
public InterfaceRealizationFigure getPrimaryShape() {
- return (InterfaceRealizationFigure)getFigure();
+ return (InterfaceRealizationFigure) getFigure();
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/RealizationNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/RealizationNameEditPart.java
index d18d79a2ad3..fa683802363 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/RealizationNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/RealizationNameEditPart.java
@@ -123,6 +123,7 @@ public class RealizationNameEditPart extends PapyrusLabelEditPart implements ITe
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -211,8 +212,7 @@ public class RealizationNameEditPart extends PapyrusLabelEditPart implements ITe
/**
* @generated
*/
- public void setLabel(IFigure
- figure) {
+ public void setLabel(IFigure figure) {
unregisterVisuals();
setFigure(figure);
defaultText = getLabelTextHelper(figure);
@@ -324,15 +324,14 @@ public class RealizationNameEditPart extends PapyrusLabelEditPart implements ITe
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid =
- (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
@@ -461,8 +460,7 @@ public class RealizationNameEditPart extends PapyrusLabelEditPart implements ITe
IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- }
- else if (configuration instanceof IAdvancedEditorConfiguration) {
+ } 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);
@@ -507,8 +505,7 @@ public class RealizationNameEditPart extends PapyrusLabelEditPart implements ITe
RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- }
- else {
+ } else {
performDirectEdit();
}
}
@@ -558,17 +555,15 @@ public class RealizationNameEditPart extends PapyrusLabelEditPart implements ITe
* @generated
*/
protected void refreshUnderline() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
if (resolveSemanticElement() instanceof Feature) {
if (((Feature) resolveSemanticElement()).isStatic()) {
((WrappingLabel) getFigure()).setTextUnderline(true);
- }
- else {
+ } else {
((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
@@ -578,9 +573,8 @@ public class RealizationNameEditPart extends PapyrusLabelEditPart implements ITe
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
@@ -591,14 +585,12 @@ public class RealizationNameEditPart extends PapyrusLabelEditPart implements ITe
*/
@Override
protected void refreshFont() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ 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));
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -692,7 +684,7 @@ public class RealizationNameEditPart extends PapyrusLabelEditPart implements ITe
*/
protected boolean checkExtendedEditor() {
if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -716,9 +708,9 @@ public class RealizationNameEditPart extends PapyrusLabelEditPart implements ITe
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());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
@@ -732,8 +724,7 @@ public class RealizationNameEditPart extends PapyrusLabelEditPart implements ITe
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement()
- .eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
@@ -785,18 +776,15 @@ public class RealizationNameEditPart extends PapyrusLabelEditPart implements ITe
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)) {
+ } 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();
+ ISemanticParser modelParser = (ISemanticParser) getParser();
if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
if (resolveSemanticElement() != null) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/RepresentationEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/RepresentationEditPart.java
index 18df6ec07e8..5d04ccb2502 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/RepresentationEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/RepresentationEditPart.java
@@ -49,8 +49,9 @@ public class RepresentationEditPart extends UMLConnectionNodeEditPart implements
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof RepresentationTagLabelEditPart) {
- ((RepresentationTagLabelEditPart)childEditPart).setLabel(getPrimaryShape().getTagLabel());
+ if (childEditPart instanceof RepresentationTagLabelEditPart) {
+ ((RepresentationTagLabelEditPart) childEditPart).setLabel(
+ getPrimaryShape().getTagLabel());
}
return false;
}
@@ -59,7 +60,7 @@ public class RepresentationEditPart extends UMLConnectionNodeEditPart implements
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -69,7 +70,7 @@ public class RepresentationEditPart extends UMLConnectionNodeEditPart implements
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof RepresentationTagLabelEditPart) {
+ if (childEditPart instanceof RepresentationTagLabelEditPart) {
return true;
}
return false;
@@ -79,7 +80,7 @@ public class RepresentationEditPart extends UMLConnectionNodeEditPart implements
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -101,6 +102,6 @@ public class RepresentationEditPart extends UMLConnectionNodeEditPart implements
* @generated
*/
public RepresentationFigure getPrimaryShape() {
- return (RepresentationFigure)getFigure();
+ return (RepresentationFigure) getFigure();
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/RepresentationTagLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/RepresentationTagLabelEditPart.java
index abea56d31b5..705b8aa3727 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/RepresentationTagLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/RepresentationTagLabelEditPart.java
@@ -123,6 +123,7 @@ public class RepresentationTagLabelEditPart extends PapyrusLabelEditPart impleme
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -211,8 +212,7 @@ public class RepresentationTagLabelEditPart extends PapyrusLabelEditPart impleme
/**
* @generated
*/
- public void setLabel(IFigure
- figure) {
+ public void setLabel(IFigure figure) {
unregisterVisuals();
setFigure(figure);
defaultText = getLabelTextHelper(figure);
@@ -325,15 +325,14 @@ public class RepresentationTagLabelEditPart extends PapyrusLabelEditPart impleme
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid =
- (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
@@ -462,8 +461,7 @@ public class RepresentationTagLabelEditPart extends PapyrusLabelEditPart impleme
IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- }
- else if (configuration instanceof IAdvancedEditorConfiguration) {
+ } 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);
@@ -508,8 +506,7 @@ public class RepresentationTagLabelEditPart extends PapyrusLabelEditPart impleme
RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- }
- else {
+ } else {
performDirectEdit();
}
}
@@ -559,17 +556,15 @@ public class RepresentationTagLabelEditPart extends PapyrusLabelEditPart impleme
* @generated
*/
protected void refreshUnderline() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
if (resolveSemanticElement() instanceof Feature) {
if (((Feature) resolveSemanticElement()).isStatic()) {
((WrappingLabel) getFigure()).setTextUnderline(true);
- }
- else {
+ } else {
((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
@@ -579,9 +574,8 @@ public class RepresentationTagLabelEditPart extends PapyrusLabelEditPart impleme
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
@@ -592,14 +586,12 @@ public class RepresentationTagLabelEditPart extends PapyrusLabelEditPart impleme
*/
@Override
protected void refreshFont() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ 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));
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -693,7 +685,7 @@ public class RepresentationTagLabelEditPart extends PapyrusLabelEditPart impleme
*/
protected boolean checkExtendedEditor() {
if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -717,9 +709,9 @@ public class RepresentationTagLabelEditPart extends PapyrusLabelEditPart impleme
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());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
@@ -733,8 +725,7 @@ public class RepresentationTagLabelEditPart extends PapyrusLabelEditPart impleme
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement()
- .eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
@@ -786,18 +777,15 @@ public class RepresentationTagLabelEditPart extends PapyrusLabelEditPart impleme
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)) {
+ } 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();
+ ISemanticParser modelParser = (ISemanticParser) getParser();
if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
if (resolveSemanticElement() != null) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/RoleBindingAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/RoleBindingAppliedStereotypeEditPart.java
index 581aba5822c..98d81c2ba3e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/RoleBindingAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/RoleBindingAppliedStereotypeEditPart.java
@@ -123,6 +123,7 @@ public class RoleBindingAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -211,8 +212,7 @@ public class RoleBindingAppliedStereotypeEditPart extends PapyrusLabelEditPart i
/**
* @generated
*/
- public void setLabel(IFigure
- figure) {
+ public void setLabel(IFigure figure) {
unregisterVisuals();
setFigure(figure);
defaultText = getLabelTextHelper(figure);
@@ -324,15 +324,14 @@ public class RoleBindingAppliedStereotypeEditPart extends PapyrusLabelEditPart i
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid =
- (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
@@ -461,8 +460,7 @@ public class RoleBindingAppliedStereotypeEditPart extends PapyrusLabelEditPart i
IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- }
- else if (configuration instanceof IAdvancedEditorConfiguration) {
+ } 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);
@@ -507,8 +505,7 @@ public class RoleBindingAppliedStereotypeEditPart extends PapyrusLabelEditPart i
RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- }
- else {
+ } else {
performDirectEdit();
}
}
@@ -558,17 +555,15 @@ public class RoleBindingAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
protected void refreshUnderline() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
if (resolveSemanticElement() instanceof Feature) {
if (((Feature) resolveSemanticElement()).isStatic()) {
((WrappingLabel) getFigure()).setTextUnderline(true);
- }
- else {
+ } else {
((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
@@ -578,9 +573,8 @@ public class RoleBindingAppliedStereotypeEditPart extends PapyrusLabelEditPart i
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
@@ -591,14 +585,12 @@ public class RoleBindingAppliedStereotypeEditPart extends PapyrusLabelEditPart i
*/
@Override
protected void refreshFont() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ 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));
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -684,7 +676,7 @@ public class RoleBindingAppliedStereotypeEditPart extends PapyrusLabelEditPart i
*/
protected boolean checkExtendedEditor() {
if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -708,9 +700,9 @@ public class RoleBindingAppliedStereotypeEditPart extends PapyrusLabelEditPart i
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());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
@@ -724,8 +716,7 @@ public class RoleBindingAppliedStereotypeEditPart extends PapyrusLabelEditPart i
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement()
- .eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
@@ -777,18 +768,15 @@ public class RoleBindingAppliedStereotypeEditPart extends PapyrusLabelEditPart i
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)) {
+ } 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();
+ ISemanticParser modelParser = (ISemanticParser) getParser();
if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
if (resolveSemanticElement() != null) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/RoleBindingEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/RoleBindingEditPart.java
index 5178360c170..8a68c21ea27 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/RoleBindingEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/RoleBindingEditPart.java
@@ -51,11 +51,13 @@ public class RoleBindingEditPart extends UMLConnectionNodeEditPart implements IT
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof RoleBindingRoleNameEditPart) {
- ((RoleBindingRoleNameEditPart)childEditPart).setLabel(getPrimaryShape().getRoleLabel());
+ if (childEditPart instanceof RoleBindingRoleNameEditPart) {
+ ((RoleBindingRoleNameEditPart) childEditPart).setLabel(
+ getPrimaryShape().getRoleLabel());
}
- if(childEditPart instanceof RoleBindingAppliedStereotypeEditPart) {
- ((RoleBindingAppliedStereotypeEditPart)childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
+ if (childEditPart instanceof RoleBindingAppliedStereotypeEditPart) {
+ ((RoleBindingAppliedStereotypeEditPart) childEditPart).setLabel(
+ getPrimaryShape().getAppliedStereotypeLabel());
}
return false;
}
@@ -64,7 +66,7 @@ public class RoleBindingEditPart extends UMLConnectionNodeEditPart implements IT
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -74,10 +76,10 @@ public class RoleBindingEditPart extends UMLConnectionNodeEditPart implements IT
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof RoleBindingRoleNameEditPart) {
+ if (childEditPart instanceof RoleBindingRoleNameEditPart) {
return true;
}
- if(childEditPart instanceof RoleBindingAppliedStereotypeEditPart) {
+ if (childEditPart instanceof RoleBindingAppliedStereotypeEditPart) {
return true;
}
return false;
@@ -87,7 +89,7 @@ public class RoleBindingEditPart extends UMLConnectionNodeEditPart implements IT
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -109,6 +111,6 @@ public class RoleBindingEditPart extends UMLConnectionNodeEditPart implements IT
* @generated
*/
public RoleBindingFigure getPrimaryShape() {
- return (RoleBindingFigure)getFigure();
+ return (RoleBindingFigure) getFigure();
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/RoleBindingRoleNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/RoleBindingRoleNameEditPart.java
index 4a18f006830..db6fadb43c2 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/RoleBindingRoleNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/RoleBindingRoleNameEditPart.java
@@ -123,6 +123,7 @@ public class RoleBindingRoleNameEditPart extends PapyrusLabelEditPart implements
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -211,8 +212,7 @@ public class RoleBindingRoleNameEditPart extends PapyrusLabelEditPart implements
/**
* @generated
*/
- public void setLabel(IFigure
- figure) {
+ public void setLabel(IFigure figure) {
unregisterVisuals();
setFigure(figure);
defaultText = getLabelTextHelper(figure);
@@ -324,15 +324,14 @@ public class RoleBindingRoleNameEditPart extends PapyrusLabelEditPart implements
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid =
- (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
@@ -461,8 +460,7 @@ public class RoleBindingRoleNameEditPart extends PapyrusLabelEditPart implements
IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- }
- else if (configuration instanceof IAdvancedEditorConfiguration) {
+ } 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);
@@ -507,8 +505,7 @@ public class RoleBindingRoleNameEditPart extends PapyrusLabelEditPart implements
RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- }
- else {
+ } else {
performDirectEdit();
}
}
@@ -558,17 +555,15 @@ public class RoleBindingRoleNameEditPart extends PapyrusLabelEditPart implements
* @generated
*/
protected void refreshUnderline() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
if (resolveSemanticElement() instanceof Feature) {
if (((Feature) resolveSemanticElement()).isStatic()) {
((WrappingLabel) getFigure()).setTextUnderline(true);
- }
- else {
+ } else {
((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
@@ -578,9 +573,8 @@ public class RoleBindingRoleNameEditPart extends PapyrusLabelEditPart implements
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
@@ -591,14 +585,12 @@ public class RoleBindingRoleNameEditPart extends PapyrusLabelEditPart implements
*/
@Override
protected void refreshFont() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ 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));
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -684,7 +676,7 @@ public class RoleBindingRoleNameEditPart extends PapyrusLabelEditPart implements
*/
protected boolean checkExtendedEditor() {
if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -708,9 +700,9 @@ public class RoleBindingRoleNameEditPart extends PapyrusLabelEditPart implements
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());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
@@ -724,8 +716,7 @@ public class RoleBindingRoleNameEditPart extends PapyrusLabelEditPart implements
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement()
- .eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
@@ -777,18 +768,15 @@ public class RoleBindingRoleNameEditPart extends PapyrusLabelEditPart implements
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)) {
+ } 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();
+ ISemanticParser modelParser = (ISemanticParser) getParser();
if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
if (resolveSemanticElement() != null) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalEditPart.java
index 8e578202325..cf7b4cae81a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalEditPart.java
@@ -84,7 +84,9 @@ public class SignalEditPart extends RoundedCompartmentEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
@@ -101,21 +103,21 @@ public class SignalEditPart extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case SignalFloatingLabelEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -135,8 +137,9 @@ public class SignalEditPart extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -154,6 +157,7 @@ public class SignalEditPart extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -165,20 +169,23 @@ public class SignalEditPart extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.SignalFigure
+ *
* @generated
*/
public SignalFigure getPrimaryShape() {
- return (SignalFigure)primaryShape;
+ return (SignalFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof SignalNameEditPart) {
- ((SignalNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof SignalNameEditPart) {
+ ((SignalNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
+
+
return false;
}
@@ -186,7 +193,7 @@ public class SignalEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof SignalNameEditPart) {
+ if (childEditPart instanceof SignalNameEditPart) {
return true;
}
return false;
@@ -196,7 +203,7 @@ public class SignalEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -206,7 +213,7 @@ public class SignalEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -216,7 +223,7 @@ public class SignalEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -226,7 +233,7 @@ public class SignalEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof SignalFloatingLabelEditPart) {
+ if (borderItemEditPart instanceof SignalFloatingLabelEditPart) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -249,16 +256,19 @@ public class SignalEditPart extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -270,7 +280,7 @@ public class SignalEditPart extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -280,7 +290,7 @@ public class SignalEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -296,8 +306,8 @@ public class SignalEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalEditPartCN.java
index bddc7df6492..aaabe7d25da 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalEditPartCN.java
@@ -84,7 +84,9 @@ public class SignalEditPartCN extends RoundedCompartmentEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
@@ -101,21 +103,21 @@ public class SignalEditPartCN extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case SignalFloatingLabelEditPartCN.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -135,8 +137,9 @@ public class SignalEditPartCN extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -154,6 +157,7 @@ public class SignalEditPartCN extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -165,20 +169,23 @@ public class SignalEditPartCN extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.SignalFigure
+ *
* @generated
*/
public SignalFigure getPrimaryShape() {
- return (SignalFigure)primaryShape;
+ return (SignalFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof SignalNameEditPartCN) {
- ((SignalNameEditPartCN)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof SignalNameEditPartCN) {
+ ((SignalNameEditPartCN) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
+
+
return false;
}
@@ -186,7 +193,7 @@ public class SignalEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof SignalNameEditPartCN) {
+ if (childEditPart instanceof SignalNameEditPartCN) {
return true;
}
return false;
@@ -196,7 +203,7 @@ public class SignalEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -206,7 +213,7 @@ public class SignalEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -216,7 +223,7 @@ public class SignalEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -226,7 +233,7 @@ public class SignalEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof SignalFloatingLabelEditPartCN) {
+ if (borderItemEditPart instanceof SignalFloatingLabelEditPartCN) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -249,16 +256,19 @@ public class SignalEditPartCN extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -270,7 +280,7 @@ public class SignalEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -280,7 +290,7 @@ public class SignalEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -296,8 +306,8 @@ public class SignalEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalEventEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalEventEditPart.java
index 572bf395eec..ad900fae57e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalEventEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalEventEditPart.java
@@ -84,7 +84,9 @@ public class SignalEventEditPart extends RoundedCompartmentEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
@@ -101,21 +103,21 @@ public class SignalEventEditPart extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case SignalEventFloatingLabelEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -135,8 +137,9 @@ public class SignalEventEditPart extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -154,6 +157,7 @@ public class SignalEventEditPart extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -165,20 +169,23 @@ public class SignalEventEditPart extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure
+ *
* @generated
*/
public RoundedCompartmentFigure getPrimaryShape() {
- return (RoundedCompartmentFigure)primaryShape;
+ return (RoundedCompartmentFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof SignalEventNameEditPart) {
- ((SignalEventNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof SignalEventNameEditPart) {
+ ((SignalEventNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
+
+
return false;
}
@@ -186,7 +193,7 @@ public class SignalEventEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof SignalEventNameEditPart) {
+ if (childEditPart instanceof SignalEventNameEditPart) {
return true;
}
return false;
@@ -196,7 +203,7 @@ public class SignalEventEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -206,7 +213,7 @@ public class SignalEventEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -216,7 +223,7 @@ public class SignalEventEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -226,7 +233,7 @@ public class SignalEventEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof SignalEventFloatingLabelEditPart) {
+ if (borderItemEditPart instanceof SignalEventFloatingLabelEditPart) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -249,16 +256,19 @@ public class SignalEventEditPart extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -270,7 +280,7 @@ public class SignalEventEditPart extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -280,7 +290,7 @@ public class SignalEventEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -296,8 +306,8 @@ public class SignalEventEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalEventFloatingLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalEventFloatingLabelEditPart.java
index b458f053f6d..4341532b7c4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalEventFloatingLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalEventFloatingLabelEditPart.java
@@ -113,15 +113,18 @@ public class SignalEventFloatingLabelEditPart extends FloatingLabelEditPart impl
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class SignalEventFloatingLabelEditPart extends FloatingLabelEditPart impl
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class SignalEventFloatingLabelEditPart extends FloatingLabelEditPart impl
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class SignalEventFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class SignalEventFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class SignalEventFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class SignalEventFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class SignalEventFloatingLabelEditPart extends FloatingLabelEditPart impl
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class SignalEventFloatingLabelEditPart extends FloatingLabelEditPart impl
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class SignalEventFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class SignalEventFloatingLabelEditPart extends FloatingLabelEditPart impl
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class SignalEventFloatingLabelEditPart extends FloatingLabelEditPart impl
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class SignalEventFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class SignalEventFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.SignalEvent_2083, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.SignalEventFloatingLabelEditPart.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class SignalEventFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class SignalEventFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class SignalEventFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class SignalEventFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class SignalEventFloatingLabelEditPart extends FloatingLabelEditPart impl
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class SignalEventFloatingLabelEditPart extends FloatingLabelEditPart impl
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class SignalEventFloatingLabelEditPart extends FloatingLabelEditPart impl
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class SignalEventFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class SignalEventFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class SignalEventFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class SignalEventFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class SignalEventFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class SignalEventFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class SignalEventFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class SignalEventFloatingLabelEditPart extends FloatingLabelEditPart impl
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class SignalEventFloatingLabelEditPart extends FloatingLabelEditPart impl
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class SignalEventFloatingLabelEditPart extends FloatingLabelEditPart impl
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class SignalEventFloatingLabelEditPart extends FloatingLabelEditPart impl
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalEventNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalEventNameEditPart.java
index 6398b440592..7b83e7a29d9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalEventNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalEventNameEditPart.java
@@ -114,12 +114,14 @@ public class SignalEventNameEditPart extends PapyrusCompartmentEditPart implemen
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class SignalEventNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class SignalEventNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class SignalEventNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class SignalEventNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class SignalEventNameEditPart extends PapyrusCompartmentEditPart implemen
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class SignalEventNameEditPart extends PapyrusCompartmentEditPart implemen
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class SignalEventNameEditPart extends PapyrusCompartmentEditPart implemen
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class SignalEventNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class SignalEventNameEditPart extends PapyrusCompartmentEditPart implemen
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class SignalEventNameEditPart extends PapyrusCompartmentEditPart implemen
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class SignalEventNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class SignalEventNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.SignalEvent_2083, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.SignalEventNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class SignalEventNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class SignalEventNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class SignalEventNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class SignalEventNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class SignalEventNameEditPart extends PapyrusCompartmentEditPart implemen
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class SignalEventNameEditPart extends PapyrusCompartmentEditPart implemen
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class SignalEventNameEditPart extends PapyrusCompartmentEditPart implemen
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class SignalEventNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class SignalEventNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class SignalEventNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class SignalEventNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class SignalEventNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class SignalEventNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class SignalEventNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class SignalEventNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class SignalEventNameEditPart extends PapyrusCompartmentEditPart implemen
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class SignalEventNameEditPart extends PapyrusCompartmentEditPart implemen
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class SignalEventNameEditPart extends PapyrusCompartmentEditPart implemen
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class SignalEventNameEditPart extends PapyrusCompartmentEditPart implemen
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class SignalEventNameEditPart extends PapyrusCompartmentEditPart implemen
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class SignalEventNameEditPart extends PapyrusCompartmentEditPart implemen
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalFloatingLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalFloatingLabelEditPart.java
index d1ab2ab679b..9a5fb17aedc 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalFloatingLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalFloatingLabelEditPart.java
@@ -113,15 +113,18 @@ public class SignalFloatingLabelEditPart extends FloatingLabelEditPart implement
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class SignalFloatingLabelEditPart extends FloatingLabelEditPart implement
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class SignalFloatingLabelEditPart extends FloatingLabelEditPart implement
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class SignalFloatingLabelEditPart extends FloatingLabelEditPart implement
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class SignalFloatingLabelEditPart extends FloatingLabelEditPart implement
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class SignalFloatingLabelEditPart extends FloatingLabelEditPart implement
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class SignalFloatingLabelEditPart extends FloatingLabelEditPart implement
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class SignalFloatingLabelEditPart extends FloatingLabelEditPart implement
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class SignalFloatingLabelEditPart extends FloatingLabelEditPart implement
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class SignalFloatingLabelEditPart extends FloatingLabelEditPart implement
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class SignalFloatingLabelEditPart extends FloatingLabelEditPart implement
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class SignalFloatingLabelEditPart extends FloatingLabelEditPart implement
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class SignalFloatingLabelEditPart extends FloatingLabelEditPart implement
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class SignalFloatingLabelEditPart extends FloatingLabelEditPart implement
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Signal_2081, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.SignalFloatingLabelEditPart.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class SignalFloatingLabelEditPart extends FloatingLabelEditPart implement
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class SignalFloatingLabelEditPart extends FloatingLabelEditPart implement
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class SignalFloatingLabelEditPart extends FloatingLabelEditPart implement
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class SignalFloatingLabelEditPart extends FloatingLabelEditPart implement
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class SignalFloatingLabelEditPart extends FloatingLabelEditPart implement
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class SignalFloatingLabelEditPart extends FloatingLabelEditPart implement
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class SignalFloatingLabelEditPart extends FloatingLabelEditPart implement
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class SignalFloatingLabelEditPart extends FloatingLabelEditPart implement
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class SignalFloatingLabelEditPart extends FloatingLabelEditPart implement
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class SignalFloatingLabelEditPart extends FloatingLabelEditPart implement
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class SignalFloatingLabelEditPart extends FloatingLabelEditPart implement
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class SignalFloatingLabelEditPart extends FloatingLabelEditPart implement
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class SignalFloatingLabelEditPart extends FloatingLabelEditPart implement
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class SignalFloatingLabelEditPart extends FloatingLabelEditPart implement
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class SignalFloatingLabelEditPart extends FloatingLabelEditPart implement
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class SignalFloatingLabelEditPart extends FloatingLabelEditPart implement
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class SignalFloatingLabelEditPart extends FloatingLabelEditPart implement
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class SignalFloatingLabelEditPart extends FloatingLabelEditPart implement
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalFloatingLabelEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalFloatingLabelEditPartCN.java
index bbc74b2afef..aa06111c379 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalFloatingLabelEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalFloatingLabelEditPartCN.java
@@ -113,15 +113,18 @@ public class SignalFloatingLabelEditPartCN extends FloatingLabelEditPart impleme
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class SignalFloatingLabelEditPartCN extends FloatingLabelEditPart impleme
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class SignalFloatingLabelEditPartCN extends FloatingLabelEditPart impleme
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class SignalFloatingLabelEditPartCN extends FloatingLabelEditPart impleme
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class SignalFloatingLabelEditPartCN extends FloatingLabelEditPart impleme
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class SignalFloatingLabelEditPartCN extends FloatingLabelEditPart impleme
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class SignalFloatingLabelEditPartCN extends FloatingLabelEditPart impleme
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class SignalFloatingLabelEditPartCN extends FloatingLabelEditPart impleme
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class SignalFloatingLabelEditPartCN extends FloatingLabelEditPart impleme
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class SignalFloatingLabelEditPartCN extends FloatingLabelEditPart impleme
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class SignalFloatingLabelEditPartCN extends FloatingLabelEditPart impleme
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class SignalFloatingLabelEditPartCN extends FloatingLabelEditPart impleme
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class SignalFloatingLabelEditPartCN extends FloatingLabelEditPart impleme
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class SignalFloatingLabelEditPartCN extends FloatingLabelEditPart impleme
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Signal_3095, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.SignalFloatingLabelEditPartCN.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class SignalFloatingLabelEditPartCN extends FloatingLabelEditPart impleme
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class SignalFloatingLabelEditPartCN extends FloatingLabelEditPart impleme
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class SignalFloatingLabelEditPartCN extends FloatingLabelEditPart impleme
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class SignalFloatingLabelEditPartCN extends FloatingLabelEditPart impleme
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class SignalFloatingLabelEditPartCN extends FloatingLabelEditPart impleme
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class SignalFloatingLabelEditPartCN extends FloatingLabelEditPart impleme
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class SignalFloatingLabelEditPartCN extends FloatingLabelEditPart impleme
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class SignalFloatingLabelEditPartCN extends FloatingLabelEditPart impleme
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class SignalFloatingLabelEditPartCN extends FloatingLabelEditPart impleme
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class SignalFloatingLabelEditPartCN extends FloatingLabelEditPart impleme
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class SignalFloatingLabelEditPartCN extends FloatingLabelEditPart impleme
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class SignalFloatingLabelEditPartCN extends FloatingLabelEditPart impleme
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class SignalFloatingLabelEditPartCN extends FloatingLabelEditPart impleme
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class SignalFloatingLabelEditPartCN extends FloatingLabelEditPart impleme
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class SignalFloatingLabelEditPartCN extends FloatingLabelEditPart impleme
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class SignalFloatingLabelEditPartCN extends FloatingLabelEditPart impleme
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class SignalFloatingLabelEditPartCN extends FloatingLabelEditPart impleme
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class SignalFloatingLabelEditPartCN extends FloatingLabelEditPart impleme
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalNameEditPart.java
index 539c2321567..ffdcd6f2b7d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalNameEditPart.java
@@ -114,12 +114,14 @@ public class SignalNameEditPart extends PapyrusCompartmentEditPart implements IT
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class SignalNameEditPart extends PapyrusCompartmentEditPart implements IT
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class SignalNameEditPart extends PapyrusCompartmentEditPart implements IT
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class SignalNameEditPart extends PapyrusCompartmentEditPart implements IT
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class SignalNameEditPart extends PapyrusCompartmentEditPart implements IT
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class SignalNameEditPart extends PapyrusCompartmentEditPart implements IT
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class SignalNameEditPart extends PapyrusCompartmentEditPart implements IT
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class SignalNameEditPart extends PapyrusCompartmentEditPart implements IT
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class SignalNameEditPart extends PapyrusCompartmentEditPart implements IT
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class SignalNameEditPart extends PapyrusCompartmentEditPart implements IT
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class SignalNameEditPart extends PapyrusCompartmentEditPart implements IT
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class SignalNameEditPart extends PapyrusCompartmentEditPart implements IT
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class SignalNameEditPart extends PapyrusCompartmentEditPart implements IT
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Signal_2081, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.SignalNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class SignalNameEditPart extends PapyrusCompartmentEditPart implements IT
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class SignalNameEditPart extends PapyrusCompartmentEditPart implements IT
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class SignalNameEditPart extends PapyrusCompartmentEditPart implements IT
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class SignalNameEditPart extends PapyrusCompartmentEditPart implements IT
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class SignalNameEditPart extends PapyrusCompartmentEditPart implements IT
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class SignalNameEditPart extends PapyrusCompartmentEditPart implements IT
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class SignalNameEditPart extends PapyrusCompartmentEditPart implements IT
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class SignalNameEditPart extends PapyrusCompartmentEditPart implements IT
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class SignalNameEditPart extends PapyrusCompartmentEditPart implements IT
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class SignalNameEditPart extends PapyrusCompartmentEditPart implements IT
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class SignalNameEditPart extends PapyrusCompartmentEditPart implements IT
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class SignalNameEditPart extends PapyrusCompartmentEditPart implements IT
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class SignalNameEditPart extends PapyrusCompartmentEditPart implements IT
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class SignalNameEditPart extends PapyrusCompartmentEditPart implements IT
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class SignalNameEditPart extends PapyrusCompartmentEditPart implements IT
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class SignalNameEditPart extends PapyrusCompartmentEditPart implements IT
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class SignalNameEditPart extends PapyrusCompartmentEditPart implements IT
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class SignalNameEditPart extends PapyrusCompartmentEditPart implements IT
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class SignalNameEditPart extends PapyrusCompartmentEditPart implements IT
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class SignalNameEditPart extends PapyrusCompartmentEditPart implements IT
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class SignalNameEditPart extends PapyrusCompartmentEditPart implements IT
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalNameEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalNameEditPartCN.java
index e802ff522a8..54c4e082471 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalNameEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SignalNameEditPartCN.java
@@ -114,12 +114,14 @@ public class SignalNameEditPartCN extends PapyrusCompartmentEditPart implements
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class SignalNameEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class SignalNameEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class SignalNameEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class SignalNameEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class SignalNameEditPartCN extends PapyrusCompartmentEditPart implements
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class SignalNameEditPartCN extends PapyrusCompartmentEditPart implements
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class SignalNameEditPartCN extends PapyrusCompartmentEditPart implements
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class SignalNameEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class SignalNameEditPartCN extends PapyrusCompartmentEditPart implements
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class SignalNameEditPartCN extends PapyrusCompartmentEditPart implements
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class SignalNameEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class SignalNameEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.Signal_3095, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.SignalNameEditPartCN.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class SignalNameEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class SignalNameEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class SignalNameEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class SignalNameEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class SignalNameEditPartCN extends PapyrusCompartmentEditPart implements
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class SignalNameEditPartCN extends PapyrusCompartmentEditPart implements
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class SignalNameEditPartCN extends PapyrusCompartmentEditPart implements
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class SignalNameEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class SignalNameEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class SignalNameEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class SignalNameEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class SignalNameEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class SignalNameEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class SignalNameEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class SignalNameEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class SignalNameEditPartCN extends PapyrusCompartmentEditPart implements
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class SignalNameEditPartCN extends PapyrusCompartmentEditPart implements
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class SignalNameEditPartCN extends PapyrusCompartmentEditPart implements
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class SignalNameEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class SignalNameEditPartCN extends PapyrusCompartmentEditPart implements
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class SignalNameEditPartCN extends PapyrusCompartmentEditPart implements
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeCompartmentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeCompartmentEditPart.java
index 285b055cc3b..eace2ad5c56 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeCompartmentEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeCompartmentEditPart.java
@@ -81,7 +81,7 @@ public class StateMachineCompositeCompartmentEditPart extends LinkLFShapeCompart
* @generated
*/
protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
+ if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
super.setRatio(ratio);
}
}
@@ -90,6 +90,7 @@ public class StateMachineCompositeCompartmentEditPart extends LinkLFShapeCompart
* @generated
*/
public EditPart getTargetEditPart(Request request) {
+
return super.getTargetEditPart(request);
}
@@ -98,7 +99,10 @@ public class StateMachineCompositeCompartmentEditPart extends LinkLFShapeCompart
*/
protected void handleNotificationEvent(Notification notification) {
Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
+ if (NotationPackage.eINSTANCE.getSize_Width().equals(feature)
+ || NotationPackage.eINSTANCE.getSize_Height().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_X().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
refreshBounds();
}
super.handleNotificationEvent(notification);
@@ -108,13 +112,16 @@ public class StateMachineCompositeCompartmentEditPart extends LinkLFShapeCompart
* @generated
*/
protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
+ ((GraphicalEditPart) getParent()).setLayoutConstraint(
+ this,
+ getFigure(),
+ new Rectangle(loc, size));
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeCompartmentEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeCompartmentEditPartCN.java
index f3b7c50d2c3..97374561c7d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeCompartmentEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeCompartmentEditPartCN.java
@@ -81,7 +81,7 @@ public class StateMachineCompositeCompartmentEditPartCN extends LinkLFShapeCompa
* @generated
*/
protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
+ if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
super.setRatio(ratio);
}
}
@@ -90,6 +90,7 @@ public class StateMachineCompositeCompartmentEditPartCN extends LinkLFShapeCompa
* @generated
*/
public EditPart getTargetEditPart(Request request) {
+
return super.getTargetEditPart(request);
}
@@ -98,7 +99,10 @@ public class StateMachineCompositeCompartmentEditPartCN extends LinkLFShapeCompa
*/
protected void handleNotificationEvent(Notification notification) {
Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
+ if (NotationPackage.eINSTANCE.getSize_Width().equals(feature)
+ || NotationPackage.eINSTANCE.getSize_Height().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_X().equals(feature)
+ || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
refreshBounds();
}
super.handleNotificationEvent(notification);
@@ -108,13 +112,16 @@ public class StateMachineCompositeCompartmentEditPartCN extends LinkLFShapeCompa
* @generated
*/
protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
+ ((GraphicalEditPart) getParent()).setLayoutConstraint(
+ this,
+ getFigure(),
+ new Rectangle(loc, size));
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeEditPart.java
index 10502867fb4..3d56e9b8a6b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeEditPart.java
@@ -97,7 +97,9 @@ public class StateMachineCompositeEditPart extends RoundedCompartmentEditPart {
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new DefaultCreationEditPolicy());
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
@@ -179,6 +181,7 @@ public class StateMachineCompositeEditPart extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -205,24 +208,35 @@ public class StateMachineCompositeEditPart extends RoundedCompartmentEditPart {
((StateMachineCompositeNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
+
+
if (childEditPart instanceof StateMachineCompositeCompartmentEditPart) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
pane.add(((StateMachineCompositeCompartmentEditPart) childEditPart).getFigure());
return true;
}
+
+
+
// Papyrus Gencode :Affixed Port locator
if (childEditPart instanceof PortEditPart) {
IBorderItemLocator locator = new PortPositionLocator(getMainFigure(), PositionConstants.NONE);
getBorderedFigure().getBorderItemContainer().add(((PortEditPart) childEditPart).getFigure(), locator);
return true;
}
+
+
+
+
// Papyrus Gencode :Affixed Port locator
if (childEditPart instanceof ParameterEditPart) {
IBorderItemLocator locator = new PortPositionLocator(getMainFigure(), PositionConstants.NONE);
getBorderedFigure().getBorderItemContainer().add(((ParameterEditPart) childEditPart).getFigure(), locator);
return true;
}
+
+
return false;
}
@@ -309,6 +323,7 @@ public class StateMachineCompositeEditPart extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeEditPartCN.java
index d5264d81148..1c3686ef7f3 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeEditPartCN.java
@@ -96,7 +96,9 @@ public class StateMachineCompositeEditPartCN extends RoundedCompartmentEditPart
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new DefaultCreationEditPolicy());
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
@@ -120,14 +122,14 @@ public class StateMachineCompositeEditPartCN extends RoundedCompartmentEditPart
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case StateMachineCompositeFloatingLabelEditPartCN.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
@@ -137,7 +139,7 @@ public class StateMachineCompositeEditPartCN extends RoundedCompartmentEditPart
return new BorderItemResizableEditPolicy();
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -157,8 +159,9 @@ public class StateMachineCompositeEditPartCN extends RoundedCompartmentEditPart
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -176,6 +179,7 @@ public class StateMachineCompositeEditPartCN extends RoundedCompartmentEditPart
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -187,38 +191,50 @@ public class StateMachineCompositeEditPartCN extends RoundedCompartmentEditPart
/**
* org.eclipse.papyrus.uml.diagram.composite.custom.figures.StateMachineCompositeFigure
+ *
* @generated
*/
public StateMachineCompositeFigure getPrimaryShape() {
- return (StateMachineCompositeFigure)primaryShape;
+ return (StateMachineCompositeFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof StateMachineCompositeNameEditPartCN) {
- ((StateMachineCompositeNameEditPartCN)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof StateMachineCompositeNameEditPartCN) {
+ ((StateMachineCompositeNameEditPartCN) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
- if(childEditPart instanceof StateMachineCompositeCompartmentEditPartCN) {
+
+
+ if (childEditPart instanceof StateMachineCompositeCompartmentEditPartCN) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((StateMachineCompositeCompartmentEditPartCN)childEditPart).getFigure());
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.add(((StateMachineCompositeCompartmentEditPartCN) childEditPart).getFigure());
return true;
}
- //Papyrus Gencode :Affixed Port locator
- if(childEditPart instanceof PortEditPart) {
+
+
+
+ // Papyrus Gencode :Affixed Port locator
+ if (childEditPart instanceof PortEditPart) {
IBorderItemLocator locator = new PortPositionLocator(getMainFigure(), PositionConstants.NONE);
- getBorderedFigure().getBorderItemContainer().add(((PortEditPart)childEditPart).getFigure(), locator);
+ getBorderedFigure().getBorderItemContainer().add(((PortEditPart) childEditPart).getFigure(), locator);
return true;
}
- //Papyrus Gencode :Affixed Port locator
- if(childEditPart instanceof ParameterEditPart) {
+
+
+
+
+ // Papyrus Gencode :Affixed Port locator
+ if (childEditPart instanceof ParameterEditPart) {
IBorderItemLocator locator = new PortPositionLocator(getMainFigure(), PositionConstants.NONE);
- getBorderedFigure().getBorderItemContainer().add(((ParameterEditPart)childEditPart).getFigure(), locator);
+ getBorderedFigure().getBorderItemContainer().add(((ParameterEditPart) childEditPart).getFigure(), locator);
return true;
}
+
+
return false;
}
@@ -226,20 +242,20 @@ public class StateMachineCompositeEditPartCN extends RoundedCompartmentEditPart
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof StateMachineCompositeNameEditPartCN) {
+ if (childEditPart instanceof StateMachineCompositeNameEditPartCN) {
return true;
}
- if(childEditPart instanceof StateMachineCompositeCompartmentEditPartCN) {
+ if (childEditPart instanceof StateMachineCompositeCompartmentEditPartCN) {
IFigure pane = getPrimaryShape().getCompositeCompartmentFigure();
- pane.remove(((StateMachineCompositeCompartmentEditPartCN)childEditPart).getFigure());
+ pane.remove(((StateMachineCompositeCompartmentEditPartCN) childEditPart).getFigure());
return true;
}
- if(childEditPart instanceof PortEditPart) {
- getBorderedFigure().getBorderItemContainer().remove(((PortEditPart)childEditPart).getFigure());
+ if (childEditPart instanceof PortEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((PortEditPart) childEditPart).getFigure());
return true;
}
- if(childEditPart instanceof ParameterEditPart) {
- getBorderedFigure().getBorderItemContainer().remove(((ParameterEditPart)childEditPart).getFigure());
+ if (childEditPart instanceof ParameterEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((ParameterEditPart) childEditPart).getFigure());
return true;
}
return false;
@@ -249,7 +265,7 @@ public class StateMachineCompositeEditPartCN extends RoundedCompartmentEditPart
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -259,7 +275,7 @@ public class StateMachineCompositeEditPartCN extends RoundedCompartmentEditPart
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -269,10 +285,10 @@ public class StateMachineCompositeEditPartCN extends RoundedCompartmentEditPart
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof StateMachineCompositeCompartmentEditPartCN) {
+ if (editPart instanceof StateMachineCompositeCompartmentEditPartCN) {
return getPrimaryShape().getCompositeCompartmentFigure();
}
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -282,7 +298,7 @@ public class StateMachineCompositeEditPartCN extends RoundedCompartmentEditPart
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof StateMachineCompositeFloatingLabelEditPartCN) {
+ if (borderItemEditPart instanceof StateMachineCompositeFloatingLabelEditPartCN) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -305,16 +321,19 @@ public class StateMachineCompositeEditPartCN extends RoundedCompartmentEditPart
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -326,7 +345,7 @@ public class StateMachineCompositeEditPartCN extends RoundedCompartmentEditPart
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -336,7 +355,7 @@ public class StateMachineCompositeEditPartCN extends RoundedCompartmentEditPart
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -352,8 +371,8 @@ public class StateMachineCompositeEditPartCN extends RoundedCompartmentEditPart
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeFloatingLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeFloatingLabelEditPart.java
index bd7813074b7..d42400bb473 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeFloatingLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeFloatingLabelEditPart.java
@@ -113,15 +113,18 @@ public class StateMachineCompositeFloatingLabelEditPart extends FloatingLabelEdi
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class StateMachineCompositeFloatingLabelEditPart extends FloatingLabelEdi
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class StateMachineCompositeFloatingLabelEditPart extends FloatingLabelEdi
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class StateMachineCompositeFloatingLabelEditPart extends FloatingLabelEdi
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class StateMachineCompositeFloatingLabelEditPart extends FloatingLabelEdi
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class StateMachineCompositeFloatingLabelEditPart extends FloatingLabelEdi
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class StateMachineCompositeFloatingLabelEditPart extends FloatingLabelEdi
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class StateMachineCompositeFloatingLabelEditPart extends FloatingLabelEdi
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class StateMachineCompositeFloatingLabelEditPart extends FloatingLabelEdi
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class StateMachineCompositeFloatingLabelEditPart extends FloatingLabelEdi
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class StateMachineCompositeFloatingLabelEditPart extends FloatingLabelEdi
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class StateMachineCompositeFloatingLabelEditPart extends FloatingLabelEdi
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class StateMachineCompositeFloatingLabelEditPart extends FloatingLabelEdi
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class StateMachineCompositeFloatingLabelEditPart extends FloatingLabelEdi
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.StateMachine_2063, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.StateMachineCompositeFloatingLabelEditPart.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class StateMachineCompositeFloatingLabelEditPart extends FloatingLabelEdi
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class StateMachineCompositeFloatingLabelEditPart extends FloatingLabelEdi
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class StateMachineCompositeFloatingLabelEditPart extends FloatingLabelEdi
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class StateMachineCompositeFloatingLabelEditPart extends FloatingLabelEdi
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class StateMachineCompositeFloatingLabelEditPart extends FloatingLabelEdi
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class StateMachineCompositeFloatingLabelEditPart extends FloatingLabelEdi
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class StateMachineCompositeFloatingLabelEditPart extends FloatingLabelEdi
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class StateMachineCompositeFloatingLabelEditPart extends FloatingLabelEdi
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class StateMachineCompositeFloatingLabelEditPart extends FloatingLabelEdi
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class StateMachineCompositeFloatingLabelEditPart extends FloatingLabelEdi
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class StateMachineCompositeFloatingLabelEditPart extends FloatingLabelEdi
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class StateMachineCompositeFloatingLabelEditPart extends FloatingLabelEdi
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class StateMachineCompositeFloatingLabelEditPart extends FloatingLabelEdi
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class StateMachineCompositeFloatingLabelEditPart extends FloatingLabelEdi
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class StateMachineCompositeFloatingLabelEditPart extends FloatingLabelEdi
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class StateMachineCompositeFloatingLabelEditPart extends FloatingLabelEdi
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class StateMachineCompositeFloatingLabelEditPart extends FloatingLabelEdi
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class StateMachineCompositeFloatingLabelEditPart extends FloatingLabelEdi
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeFloatingLabelEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeFloatingLabelEditPartCN.java
index f740378a496..4b18d8aef94 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeFloatingLabelEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeFloatingLabelEditPartCN.java
@@ -113,15 +113,18 @@ public class StateMachineCompositeFloatingLabelEditPartCN extends FloatingLabelE
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class StateMachineCompositeFloatingLabelEditPartCN extends FloatingLabelE
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class StateMachineCompositeFloatingLabelEditPartCN extends FloatingLabelE
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class StateMachineCompositeFloatingLabelEditPartCN extends FloatingLabelE
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class StateMachineCompositeFloatingLabelEditPartCN extends FloatingLabelE
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class StateMachineCompositeFloatingLabelEditPartCN extends FloatingLabelE
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class StateMachineCompositeFloatingLabelEditPartCN extends FloatingLabelE
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class StateMachineCompositeFloatingLabelEditPartCN extends FloatingLabelE
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class StateMachineCompositeFloatingLabelEditPartCN extends FloatingLabelE
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class StateMachineCompositeFloatingLabelEditPartCN extends FloatingLabelE
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class StateMachineCompositeFloatingLabelEditPartCN extends FloatingLabelE
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class StateMachineCompositeFloatingLabelEditPartCN extends FloatingLabelE
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class StateMachineCompositeFloatingLabelEditPartCN extends FloatingLabelE
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class StateMachineCompositeFloatingLabelEditPartCN extends FloatingLabelE
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.StateMachine_3075, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.StateMachineCompositeFloatingLabelEditPartCN.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class StateMachineCompositeFloatingLabelEditPartCN extends FloatingLabelE
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class StateMachineCompositeFloatingLabelEditPartCN extends FloatingLabelE
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class StateMachineCompositeFloatingLabelEditPartCN extends FloatingLabelE
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class StateMachineCompositeFloatingLabelEditPartCN extends FloatingLabelE
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class StateMachineCompositeFloatingLabelEditPartCN extends FloatingLabelE
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class StateMachineCompositeFloatingLabelEditPartCN extends FloatingLabelE
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class StateMachineCompositeFloatingLabelEditPartCN extends FloatingLabelE
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class StateMachineCompositeFloatingLabelEditPartCN extends FloatingLabelE
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class StateMachineCompositeFloatingLabelEditPartCN extends FloatingLabelE
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class StateMachineCompositeFloatingLabelEditPartCN extends FloatingLabelE
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class StateMachineCompositeFloatingLabelEditPartCN extends FloatingLabelE
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class StateMachineCompositeFloatingLabelEditPartCN extends FloatingLabelE
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class StateMachineCompositeFloatingLabelEditPartCN extends FloatingLabelE
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class StateMachineCompositeFloatingLabelEditPartCN extends FloatingLabelE
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class StateMachineCompositeFloatingLabelEditPartCN extends FloatingLabelE
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class StateMachineCompositeFloatingLabelEditPartCN extends FloatingLabelE
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class StateMachineCompositeFloatingLabelEditPartCN extends FloatingLabelE
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class StateMachineCompositeFloatingLabelEditPartCN extends FloatingLabelE
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeNameEditPart.java
index 1dc27b2db8b..90a2eb93ff9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeNameEditPart.java
@@ -114,12 +114,14 @@ public class StateMachineCompositeNameEditPart extends PapyrusCompartmentEditPar
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class StateMachineCompositeNameEditPart extends PapyrusCompartmentEditPar
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class StateMachineCompositeNameEditPart extends PapyrusCompartmentEditPar
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class StateMachineCompositeNameEditPart extends PapyrusCompartmentEditPar
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class StateMachineCompositeNameEditPart extends PapyrusCompartmentEditPar
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class StateMachineCompositeNameEditPart extends PapyrusCompartmentEditPar
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class StateMachineCompositeNameEditPart extends PapyrusCompartmentEditPar
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class StateMachineCompositeNameEditPart extends PapyrusCompartmentEditPar
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class StateMachineCompositeNameEditPart extends PapyrusCompartmentEditPar
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class StateMachineCompositeNameEditPart extends PapyrusCompartmentEditPar
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class StateMachineCompositeNameEditPart extends PapyrusCompartmentEditPar
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class StateMachineCompositeNameEditPart extends PapyrusCompartmentEditPar
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class StateMachineCompositeNameEditPart extends PapyrusCompartmentEditPar
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.StateMachine_2063, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.StateMachineCompositeNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class StateMachineCompositeNameEditPart extends PapyrusCompartmentEditPar
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class StateMachineCompositeNameEditPart extends PapyrusCompartmentEditPar
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class StateMachineCompositeNameEditPart extends PapyrusCompartmentEditPar
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class StateMachineCompositeNameEditPart extends PapyrusCompartmentEditPar
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class StateMachineCompositeNameEditPart extends PapyrusCompartmentEditPar
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class StateMachineCompositeNameEditPart extends PapyrusCompartmentEditPar
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class StateMachineCompositeNameEditPart extends PapyrusCompartmentEditPar
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class StateMachineCompositeNameEditPart extends PapyrusCompartmentEditPar
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class StateMachineCompositeNameEditPart extends PapyrusCompartmentEditPar
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class StateMachineCompositeNameEditPart extends PapyrusCompartmentEditPar
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class StateMachineCompositeNameEditPart extends PapyrusCompartmentEditPar
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class StateMachineCompositeNameEditPart extends PapyrusCompartmentEditPar
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class StateMachineCompositeNameEditPart extends PapyrusCompartmentEditPar
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class StateMachineCompositeNameEditPart extends PapyrusCompartmentEditPar
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class StateMachineCompositeNameEditPart extends PapyrusCompartmentEditPar
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class StateMachineCompositeNameEditPart extends PapyrusCompartmentEditPar
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class StateMachineCompositeNameEditPart extends PapyrusCompartmentEditPar
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class StateMachineCompositeNameEditPart extends PapyrusCompartmentEditPar
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class StateMachineCompositeNameEditPart extends PapyrusCompartmentEditPar
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class StateMachineCompositeNameEditPart extends PapyrusCompartmentEditPar
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class StateMachineCompositeNameEditPart extends PapyrusCompartmentEditPar
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeNameEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeNameEditPartCN.java
index 271528f2049..4e8841f0289 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeNameEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeNameEditPartCN.java
@@ -114,12 +114,14 @@ public class StateMachineCompositeNameEditPartCN extends PapyrusCompartmentEditP
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class StateMachineCompositeNameEditPartCN extends PapyrusCompartmentEditP
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class StateMachineCompositeNameEditPartCN extends PapyrusCompartmentEditP
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class StateMachineCompositeNameEditPartCN extends PapyrusCompartmentEditP
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class StateMachineCompositeNameEditPartCN extends PapyrusCompartmentEditP
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class StateMachineCompositeNameEditPartCN extends PapyrusCompartmentEditP
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class StateMachineCompositeNameEditPartCN extends PapyrusCompartmentEditP
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class StateMachineCompositeNameEditPartCN extends PapyrusCompartmentEditP
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class StateMachineCompositeNameEditPartCN extends PapyrusCompartmentEditP
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class StateMachineCompositeNameEditPartCN extends PapyrusCompartmentEditP
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class StateMachineCompositeNameEditPartCN extends PapyrusCompartmentEditP
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class StateMachineCompositeNameEditPartCN extends PapyrusCompartmentEditP
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class StateMachineCompositeNameEditPartCN extends PapyrusCompartmentEditP
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.StateMachine_3075, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.StateMachineCompositeNameEditPartCN.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class StateMachineCompositeNameEditPartCN extends PapyrusCompartmentEditP
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class StateMachineCompositeNameEditPartCN extends PapyrusCompartmentEditP
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class StateMachineCompositeNameEditPartCN extends PapyrusCompartmentEditP
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class StateMachineCompositeNameEditPartCN extends PapyrusCompartmentEditP
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class StateMachineCompositeNameEditPartCN extends PapyrusCompartmentEditP
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class StateMachineCompositeNameEditPartCN extends PapyrusCompartmentEditP
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class StateMachineCompositeNameEditPartCN extends PapyrusCompartmentEditP
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class StateMachineCompositeNameEditPartCN extends PapyrusCompartmentEditP
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class StateMachineCompositeNameEditPartCN extends PapyrusCompartmentEditP
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class StateMachineCompositeNameEditPartCN extends PapyrusCompartmentEditP
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class StateMachineCompositeNameEditPartCN extends PapyrusCompartmentEditP
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class StateMachineCompositeNameEditPartCN extends PapyrusCompartmentEditP
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class StateMachineCompositeNameEditPartCN extends PapyrusCompartmentEditP
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class StateMachineCompositeNameEditPartCN extends PapyrusCompartmentEditP
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class StateMachineCompositeNameEditPartCN extends PapyrusCompartmentEditP
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class StateMachineCompositeNameEditPartCN extends PapyrusCompartmentEditP
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class StateMachineCompositeNameEditPartCN extends PapyrusCompartmentEditP
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class StateMachineCompositeNameEditPartCN extends PapyrusCompartmentEditP
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class StateMachineCompositeNameEditPartCN extends PapyrusCompartmentEditP
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class StateMachineCompositeNameEditPartCN extends PapyrusCompartmentEditP
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class StateMachineCompositeNameEditPartCN extends PapyrusCompartmentEditP
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StringExpressionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StringExpressionEditPart.java
index 3b04c2072fc..16e5b753c7c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StringExpressionEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StringExpressionEditPart.java
@@ -84,7 +84,9 @@ public class StringExpressionEditPart extends RoundedCompartmentEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
@@ -101,21 +103,21 @@ public class StringExpressionEditPart extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case StringExpressionFloatingLabelEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -135,8 +137,9 @@ public class StringExpressionEditPart extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -154,6 +157,7 @@ public class StringExpressionEditPart extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -165,20 +169,23 @@ public class StringExpressionEditPart extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure
+ *
* @generated
*/
public RoundedCompartmentFigure getPrimaryShape() {
- return (RoundedCompartmentFigure)primaryShape;
+ return (RoundedCompartmentFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof StringExpressionNameEditPart) {
- ((StringExpressionNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof StringExpressionNameEditPart) {
+ ((StringExpressionNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
+
+
return false;
}
@@ -186,7 +193,7 @@ public class StringExpressionEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof StringExpressionNameEditPart) {
+ if (childEditPart instanceof StringExpressionNameEditPart) {
return true;
}
return false;
@@ -196,7 +203,7 @@ public class StringExpressionEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -206,7 +213,7 @@ public class StringExpressionEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -216,7 +223,7 @@ public class StringExpressionEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -226,7 +233,7 @@ public class StringExpressionEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof StringExpressionFloatingLabelEditPart) {
+ if (borderItemEditPart instanceof StringExpressionFloatingLabelEditPart) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -249,16 +256,19 @@ public class StringExpressionEditPart extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -270,7 +280,7 @@ public class StringExpressionEditPart extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -280,7 +290,7 @@ public class StringExpressionEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -296,8 +306,8 @@ public class StringExpressionEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StringExpressionFloatingLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StringExpressionFloatingLabelEditPart.java
index e27eb63fc3e..5a9c3176e04 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StringExpressionFloatingLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StringExpressionFloatingLabelEditPart.java
@@ -113,15 +113,18 @@ public class StringExpressionFloatingLabelEditPart extends FloatingLabelEditPart
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class StringExpressionFloatingLabelEditPart extends FloatingLabelEditPart
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class StringExpressionFloatingLabelEditPart extends FloatingLabelEditPart
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class StringExpressionFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class StringExpressionFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class StringExpressionFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class StringExpressionFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class StringExpressionFloatingLabelEditPart extends FloatingLabelEditPart
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class StringExpressionFloatingLabelEditPart extends FloatingLabelEditPart
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class StringExpressionFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class StringExpressionFloatingLabelEditPart extends FloatingLabelEditPart
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class StringExpressionFloatingLabelEditPart extends FloatingLabelEditPart
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class StringExpressionFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class StringExpressionFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.StringExpression_2100, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.StringExpressionFloatingLabelEditPart.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class StringExpressionFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class StringExpressionFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class StringExpressionFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class StringExpressionFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class StringExpressionFloatingLabelEditPart extends FloatingLabelEditPart
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class StringExpressionFloatingLabelEditPart extends FloatingLabelEditPart
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class StringExpressionFloatingLabelEditPart extends FloatingLabelEditPart
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class StringExpressionFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class StringExpressionFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class StringExpressionFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class StringExpressionFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class StringExpressionFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class StringExpressionFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class StringExpressionFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class StringExpressionFloatingLabelEditPart extends FloatingLabelEditPart
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class StringExpressionFloatingLabelEditPart extends FloatingLabelEditPart
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class StringExpressionFloatingLabelEditPart extends FloatingLabelEditPart
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class StringExpressionFloatingLabelEditPart extends FloatingLabelEditPart
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StringExpressionNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StringExpressionNameEditPart.java
index 2d88f840cad..b587251826a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StringExpressionNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StringExpressionNameEditPart.java
@@ -114,12 +114,14 @@ public class StringExpressionNameEditPart extends PapyrusCompartmentEditPart imp
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class StringExpressionNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class StringExpressionNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class StringExpressionNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class StringExpressionNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class StringExpressionNameEditPart extends PapyrusCompartmentEditPart imp
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class StringExpressionNameEditPart extends PapyrusCompartmentEditPart imp
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class StringExpressionNameEditPart extends PapyrusCompartmentEditPart imp
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class StringExpressionNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class StringExpressionNameEditPart extends PapyrusCompartmentEditPart imp
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class StringExpressionNameEditPart extends PapyrusCompartmentEditPart imp
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class StringExpressionNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class StringExpressionNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.StringExpression_2100, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.StringExpressionNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class StringExpressionNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class StringExpressionNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class StringExpressionNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class StringExpressionNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class StringExpressionNameEditPart extends PapyrusCompartmentEditPart imp
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class StringExpressionNameEditPart extends PapyrusCompartmentEditPart imp
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class StringExpressionNameEditPart extends PapyrusCompartmentEditPart imp
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class StringExpressionNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class StringExpressionNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class StringExpressionNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class StringExpressionNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class StringExpressionNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class StringExpressionNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class StringExpressionNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class StringExpressionNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class StringExpressionNameEditPart extends PapyrusCompartmentEditPart imp
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class StringExpressionNameEditPart extends PapyrusCompartmentEditPart imp
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class StringExpressionNameEditPart extends PapyrusCompartmentEditPart imp
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class StringExpressionNameEditPart extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class StringExpressionNameEditPart extends PapyrusCompartmentEditPart imp
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class StringExpressionNameEditPart extends PapyrusCompartmentEditPart imp
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SubstitutionAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SubstitutionAppliedStereotypeEditPart.java
index d7f8c8aefd3..77ac5f346d7 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SubstitutionAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SubstitutionAppliedStereotypeEditPart.java
@@ -123,6 +123,7 @@ public class SubstitutionAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -211,8 +212,7 @@ public class SubstitutionAppliedStereotypeEditPart extends PapyrusLabelEditPart
/**
* @generated
*/
- public void setLabel(IFigure
- figure) {
+ public void setLabel(IFigure figure) {
unregisterVisuals();
setFigure(figure);
defaultText = getLabelTextHelper(figure);
@@ -324,15 +324,14 @@ public class SubstitutionAppliedStereotypeEditPart extends PapyrusLabelEditPart
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid =
- (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
@@ -461,8 +460,7 @@ public class SubstitutionAppliedStereotypeEditPart extends PapyrusLabelEditPart
IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- }
- else if (configuration instanceof IAdvancedEditorConfiguration) {
+ } 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);
@@ -507,8 +505,7 @@ public class SubstitutionAppliedStereotypeEditPart extends PapyrusLabelEditPart
RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- }
- else {
+ } else {
performDirectEdit();
}
}
@@ -558,17 +555,15 @@ public class SubstitutionAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected void refreshUnderline() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
if (resolveSemanticElement() instanceof Feature) {
if (((Feature) resolveSemanticElement()).isStatic()) {
((WrappingLabel) getFigure()).setTextUnderline(true);
- }
- else {
+ } else {
((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
@@ -578,9 +573,8 @@ public class SubstitutionAppliedStereotypeEditPart extends PapyrusLabelEditPart
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
@@ -591,14 +585,12 @@ public class SubstitutionAppliedStereotypeEditPart extends PapyrusLabelEditPart
*/
@Override
protected void refreshFont() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ 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));
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -684,7 +676,7 @@ public class SubstitutionAppliedStereotypeEditPart extends PapyrusLabelEditPart
*/
protected boolean checkExtendedEditor() {
if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -708,9 +700,9 @@ public class SubstitutionAppliedStereotypeEditPart extends PapyrusLabelEditPart
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());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
@@ -724,8 +716,7 @@ public class SubstitutionAppliedStereotypeEditPart extends PapyrusLabelEditPart
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement()
- .eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
@@ -777,18 +768,15 @@ public class SubstitutionAppliedStereotypeEditPart extends PapyrusLabelEditPart
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)) {
+ } 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();
+ ISemanticParser modelParser = (ISemanticParser) getParser();
if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
if (resolveSemanticElement() != null) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SubstitutionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SubstitutionEditPart.java
index 10f8a9f465a..7b1dede8271 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SubstitutionEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SubstitutionEditPart.java
@@ -52,10 +52,12 @@ public class SubstitutionEditPart extends UMLConnectionNodeEditPart implements I
*/
protected boolean addFixedChild(EditPart childEditPart) {
if (childEditPart instanceof SubstitutionNameEditPart) {
- ((SubstitutionNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ ((SubstitutionNameEditPart) childEditPart).setLabel(
+ getPrimaryShape().getNameLabel());
}
if (childEditPart instanceof SubstitutionAppliedStereotypeEditPart) {
- ((SubstitutionAppliedStereotypeEditPart) childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
+ ((SubstitutionAppliedStereotypeEditPart) childEditPart).setLabel(
+ getPrimaryShape().getAppliedStereotypeLabel());
}
return false;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SubstitutionNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SubstitutionNameEditPart.java
index 078b0b48a83..b96cd514067 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SubstitutionNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/SubstitutionNameEditPart.java
@@ -123,6 +123,7 @@ public class SubstitutionNameEditPart extends PapyrusLabelEditPart implements IT
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -211,8 +212,7 @@ public class SubstitutionNameEditPart extends PapyrusLabelEditPart implements IT
/**
* @generated
*/
- public void setLabel(IFigure
- figure) {
+ public void setLabel(IFigure figure) {
unregisterVisuals();
setFigure(figure);
defaultText = getLabelTextHelper(figure);
@@ -324,15 +324,14 @@ public class SubstitutionNameEditPart extends PapyrusLabelEditPart implements IT
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid =
- (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
@@ -461,8 +460,7 @@ public class SubstitutionNameEditPart extends PapyrusLabelEditPart implements IT
IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- }
- else if (configuration instanceof IAdvancedEditorConfiguration) {
+ } 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);
@@ -507,8 +505,7 @@ public class SubstitutionNameEditPart extends PapyrusLabelEditPart implements IT
RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- }
- else {
+ } else {
performDirectEdit();
}
}
@@ -558,17 +555,15 @@ public class SubstitutionNameEditPart extends PapyrusLabelEditPart implements IT
* @generated
*/
protected void refreshUnderline() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
if (resolveSemanticElement() instanceof Feature) {
if (((Feature) resolveSemanticElement()).isStatic()) {
((WrappingLabel) getFigure()).setTextUnderline(true);
- }
- else {
+ } else {
((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
@@ -578,9 +573,8 @@ public class SubstitutionNameEditPart extends PapyrusLabelEditPart implements IT
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
@@ -591,14 +585,12 @@ public class SubstitutionNameEditPart extends PapyrusLabelEditPart implements IT
*/
@Override
protected void refreshFont() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ 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));
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -692,7 +684,7 @@ public class SubstitutionNameEditPart extends PapyrusLabelEditPart implements IT
*/
protected boolean checkExtendedEditor() {
if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -716,9 +708,9 @@ public class SubstitutionNameEditPart extends PapyrusLabelEditPart implements IT
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());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
@@ -732,8 +724,7 @@ public class SubstitutionNameEditPart extends PapyrusLabelEditPart implements IT
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement()
- .eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
@@ -785,18 +776,15 @@ public class SubstitutionNameEditPart extends PapyrusLabelEditPart implements IT
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)) {
+ } 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();
+ ISemanticParser modelParser = (ISemanticParser) getParser();
if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
if (resolveSemanticElement() != null) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeConstraintEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeConstraintEditPart.java
index d0ca6611f14..019ebee5c43 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeConstraintEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeConstraintEditPart.java
@@ -70,7 +70,9 @@ public class TimeConstraintEditPart extends AbstractConstraintEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
// XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
@@ -86,7 +88,7 @@ public class TimeConstraintEditPart extends AbstractConstraintEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -106,11 +108,13 @@ public class TimeConstraintEditPart extends AbstractConstraintEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
super.handleNotificationEvent(event);
+
}
/**
@@ -122,24 +126,27 @@ public class TimeConstraintEditPart extends AbstractConstraintEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.ConstraintFigure
+ *
* @generated
*/
public ConstraintFigure getPrimaryShape() {
- return (ConstraintFigure)primaryShape;
+ return (ConstraintFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof TimeConstraintNameEditPart) {
- ((TimeConstraintNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof TimeConstraintNameEditPart) {
+ ((TimeConstraintNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
- if(childEditPart instanceof TimeConstraintSpecificationEditPart) {
- ((TimeConstraintSpecificationEditPart)childEditPart).setLabel(getPrimaryShape().getConstraintFigure());
+ if (childEditPart instanceof TimeConstraintSpecificationEditPart) {
+ ((TimeConstraintSpecificationEditPart) childEditPart).setLabel(getPrimaryShape().getConstraintFigure());
return true;
}
+
+
return false;
}
@@ -147,10 +154,10 @@ public class TimeConstraintEditPart extends AbstractConstraintEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof TimeConstraintNameEditPart) {
+ if (childEditPart instanceof TimeConstraintNameEditPart) {
return true;
}
- if(childEditPart instanceof TimeConstraintSpecificationEditPart) {
+ if (childEditPart instanceof TimeConstraintSpecificationEditPart) {
return true;
}
return false;
@@ -160,7 +167,7 @@ public class TimeConstraintEditPart extends AbstractConstraintEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -170,7 +177,7 @@ public class TimeConstraintEditPart extends AbstractConstraintEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -198,16 +205,19 @@ public class TimeConstraintEditPart extends AbstractConstraintEditPart {
*/
protected NodeFigure createNodeFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -219,7 +229,7 @@ public class TimeConstraintEditPart extends AbstractConstraintEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -229,7 +239,7 @@ public class TimeConstraintEditPart extends AbstractConstraintEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -245,8 +255,8 @@ public class TimeConstraintEditPart extends AbstractConstraintEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeConstraintEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeConstraintEditPartCN.java
index 5f029b52644..9d7c89b81e5 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeConstraintEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeConstraintEditPartCN.java
@@ -70,7 +70,9 @@ public class TimeConstraintEditPartCN extends AbstractConstraintEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
// XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
@@ -86,7 +88,7 @@ public class TimeConstraintEditPartCN extends AbstractConstraintEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -106,11 +108,13 @@ public class TimeConstraintEditPartCN extends AbstractConstraintEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
super.handleNotificationEvent(event);
+
}
/**
@@ -122,24 +126,27 @@ public class TimeConstraintEditPartCN extends AbstractConstraintEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.ConstraintFigure
+ *
* @generated
*/
public ConstraintFigure getPrimaryShape() {
- return (ConstraintFigure)primaryShape;
+ return (ConstraintFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof TimeConstraintNameEditPartCN) {
- ((TimeConstraintNameEditPartCN)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof TimeConstraintNameEditPartCN) {
+ ((TimeConstraintNameEditPartCN) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
- if(childEditPart instanceof TimeConstraintSpecificationEditPartCN) {
- ((TimeConstraintSpecificationEditPartCN)childEditPart).setLabel(getPrimaryShape().getConstraintFigure());
+ if (childEditPart instanceof TimeConstraintSpecificationEditPartCN) {
+ ((TimeConstraintSpecificationEditPartCN) childEditPart).setLabel(getPrimaryShape().getConstraintFigure());
return true;
}
+
+
return false;
}
@@ -147,10 +154,10 @@ public class TimeConstraintEditPartCN extends AbstractConstraintEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof TimeConstraintNameEditPartCN) {
+ if (childEditPart instanceof TimeConstraintNameEditPartCN) {
return true;
}
- if(childEditPart instanceof TimeConstraintSpecificationEditPartCN) {
+ if (childEditPart instanceof TimeConstraintSpecificationEditPartCN) {
return true;
}
return false;
@@ -160,7 +167,7 @@ public class TimeConstraintEditPartCN extends AbstractConstraintEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -170,7 +177,7 @@ public class TimeConstraintEditPartCN extends AbstractConstraintEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -198,16 +205,19 @@ public class TimeConstraintEditPartCN extends AbstractConstraintEditPart {
*/
protected NodeFigure createNodeFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -219,7 +229,7 @@ public class TimeConstraintEditPartCN extends AbstractConstraintEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -229,7 +239,7 @@ public class TimeConstraintEditPartCN extends AbstractConstraintEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -245,8 +255,8 @@ public class TimeConstraintEditPartCN extends AbstractConstraintEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeConstraintNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeConstraintNameEditPart.java
index 12c9ab6fae9..4e78810b6f4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeConstraintNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeConstraintNameEditPart.java
@@ -114,12 +114,14 @@ public class TimeConstraintNameEditPart extends PapyrusCompartmentEditPart imple
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class TimeConstraintNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class TimeConstraintNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class TimeConstraintNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class TimeConstraintNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class TimeConstraintNameEditPart extends PapyrusCompartmentEditPart imple
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class TimeConstraintNameEditPart extends PapyrusCompartmentEditPart imple
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class TimeConstraintNameEditPart extends PapyrusCompartmentEditPart imple
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class TimeConstraintNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class TimeConstraintNameEditPart extends PapyrusCompartmentEditPart imple
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class TimeConstraintNameEditPart extends PapyrusCompartmentEditPart imple
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class TimeConstraintNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class TimeConstraintNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.TimeConstraint_2111, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.TimeConstraintNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class TimeConstraintNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class TimeConstraintNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class TimeConstraintNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class TimeConstraintNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class TimeConstraintNameEditPart extends PapyrusCompartmentEditPart imple
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class TimeConstraintNameEditPart extends PapyrusCompartmentEditPart imple
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class TimeConstraintNameEditPart extends PapyrusCompartmentEditPart imple
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class TimeConstraintNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class TimeConstraintNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class TimeConstraintNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class TimeConstraintNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class TimeConstraintNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class TimeConstraintNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class TimeConstraintNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class TimeConstraintNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class TimeConstraintNameEditPart extends PapyrusCompartmentEditPart imple
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class TimeConstraintNameEditPart extends PapyrusCompartmentEditPart imple
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class TimeConstraintNameEditPart extends PapyrusCompartmentEditPart imple
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class TimeConstraintNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class TimeConstraintNameEditPart extends PapyrusCompartmentEditPart imple
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class TimeConstraintNameEditPart extends PapyrusCompartmentEditPart imple
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeConstraintNameEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeConstraintNameEditPartCN.java
index 1e444bb7807..01925c0e9b9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeConstraintNameEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeConstraintNameEditPartCN.java
@@ -114,12 +114,14 @@ public class TimeConstraintNameEditPartCN extends PapyrusCompartmentEditPart imp
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class TimeConstraintNameEditPartCN extends PapyrusCompartmentEditPart imp
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class TimeConstraintNameEditPartCN extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class TimeConstraintNameEditPartCN extends PapyrusCompartmentEditPart imp
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class TimeConstraintNameEditPartCN extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class TimeConstraintNameEditPartCN extends PapyrusCompartmentEditPart imp
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class TimeConstraintNameEditPartCN extends PapyrusCompartmentEditPart imp
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class TimeConstraintNameEditPartCN extends PapyrusCompartmentEditPart imp
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class TimeConstraintNameEditPartCN extends PapyrusCompartmentEditPart imp
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class TimeConstraintNameEditPartCN extends PapyrusCompartmentEditPart imp
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class TimeConstraintNameEditPartCN extends PapyrusCompartmentEditPart imp
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class TimeConstraintNameEditPartCN extends PapyrusCompartmentEditPart imp
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class TimeConstraintNameEditPartCN extends PapyrusCompartmentEditPart imp
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.TimeConstraint_3117, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.TimeConstraintNameEditPartCN.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class TimeConstraintNameEditPartCN extends PapyrusCompartmentEditPart imp
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class TimeConstraintNameEditPartCN extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class TimeConstraintNameEditPartCN extends PapyrusCompartmentEditPart imp
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class TimeConstraintNameEditPartCN extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class TimeConstraintNameEditPartCN extends PapyrusCompartmentEditPart imp
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class TimeConstraintNameEditPartCN extends PapyrusCompartmentEditPart imp
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class TimeConstraintNameEditPartCN extends PapyrusCompartmentEditPart imp
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class TimeConstraintNameEditPartCN extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class TimeConstraintNameEditPartCN extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class TimeConstraintNameEditPartCN extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class TimeConstraintNameEditPartCN extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class TimeConstraintNameEditPartCN extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class TimeConstraintNameEditPartCN extends PapyrusCompartmentEditPart imp
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class TimeConstraintNameEditPartCN extends PapyrusCompartmentEditPart imp
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class TimeConstraintNameEditPartCN extends PapyrusCompartmentEditPart imp
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class TimeConstraintNameEditPartCN extends PapyrusCompartmentEditPart imp
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class TimeConstraintNameEditPartCN extends PapyrusCompartmentEditPart imp
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class TimeConstraintNameEditPartCN extends PapyrusCompartmentEditPart imp
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class TimeConstraintNameEditPartCN extends PapyrusCompartmentEditPart imp
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class TimeConstraintNameEditPartCN extends PapyrusCompartmentEditPart imp
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class TimeConstraintNameEditPartCN extends PapyrusCompartmentEditPart imp
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeConstraintSpecificationEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeConstraintSpecificationEditPart.java
index 97798dc084f..c99d906e6ad 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeConstraintSpecificationEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeConstraintSpecificationEditPart.java
@@ -110,12 +110,14 @@ public class TimeConstraintSpecificationEditPart extends PapyrusCompartmentEditP
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -141,12 +143,12 @@ public class TimeConstraintSpecificationEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -154,12 +156,12 @@ public class TimeConstraintSpecificationEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -167,12 +169,12 @@ public class TimeConstraintSpecificationEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -180,12 +182,12 @@ public class TimeConstraintSpecificationEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -241,10 +243,12 @@ public class TimeConstraintSpecificationEditPart extends PapyrusCompartmentEditP
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -256,12 +260,12 @@ public class TimeConstraintSpecificationEditPart extends PapyrusCompartmentEditP
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -269,10 +273,12 @@ public class TimeConstraintSpecificationEditPart extends PapyrusCompartmentEditP
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -290,15 +296,16 @@ public class TimeConstraintSpecificationEditPart extends PapyrusCompartmentEditP
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -306,6 +313,7 @@ public class TimeConstraintSpecificationEditPart extends PapyrusCompartmentEditP
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -316,7 +324,7 @@ public class TimeConstraintSpecificationEditPart extends PapyrusCompartmentEditP
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -333,7 +341,7 @@ public class TimeConstraintSpecificationEditPart extends PapyrusCompartmentEditP
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.TimeConstraint_2111, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.TimeConstraintSpecificationEditPart.VISUAL_ID));
}
return parser;
@@ -343,8 +351,10 @@ public class TimeConstraintSpecificationEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -373,8 +383,8 @@ public class TimeConstraintSpecificationEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -382,8 +392,8 @@ public class TimeConstraintSpecificationEditPart extends PapyrusCompartmentEditP
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -393,46 +403,52 @@ public class TimeConstraintSpecificationEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -454,12 +470,12 @@ public class TimeConstraintSpecificationEditPart extends PapyrusCompartmentEditP
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -489,12 +505,12 @@ public class TimeConstraintSpecificationEditPart extends PapyrusCompartmentEditP
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -503,12 +519,12 @@ public class TimeConstraintSpecificationEditPart extends PapyrusCompartmentEditP
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -516,15 +532,16 @@ public class TimeConstraintSpecificationEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -533,9 +550,10 @@ public class TimeConstraintSpecificationEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -543,9 +561,12 @@ public class TimeConstraintSpecificationEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -561,11 +582,11 @@ public class TimeConstraintSpecificationEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -576,8 +597,8 @@ public class TimeConstraintSpecificationEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -589,7 +610,7 @@ public class TimeConstraintSpecificationEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -615,13 +636,14 @@ public class TimeConstraintSpecificationEditPart extends PapyrusCompartmentEditP
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -633,8 +655,8 @@ public class TimeConstraintSpecificationEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -651,35 +673,40 @@ public class TimeConstraintSpecificationEditPart extends PapyrusCompartmentEditP
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -689,12 +716,13 @@ public class TimeConstraintSpecificationEditPart extends PapyrusCompartmentEditP
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -729,24 +757,25 @@ public class TimeConstraintSpecificationEditPart extends PapyrusCompartmentEditP
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -781,7 +810,8 @@ public class TimeConstraintSpecificationEditPart extends PapyrusCompartmentEditP
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -790,6 +820,7 @@ public class TimeConstraintSpecificationEditPart extends PapyrusCompartmentEditP
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -797,5 +828,6 @@ public class TimeConstraintSpecificationEditPart extends PapyrusCompartmentEditP
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeConstraintSpecificationEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeConstraintSpecificationEditPartCN.java
index 228288410b3..7b68343b57c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeConstraintSpecificationEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeConstraintSpecificationEditPartCN.java
@@ -110,12 +110,14 @@ public class TimeConstraintSpecificationEditPartCN extends PapyrusCompartmentEdi
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -141,12 +143,12 @@ public class TimeConstraintSpecificationEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -154,12 +156,12 @@ public class TimeConstraintSpecificationEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -167,12 +169,12 @@ public class TimeConstraintSpecificationEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -180,12 +182,12 @@ public class TimeConstraintSpecificationEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -241,10 +243,12 @@ public class TimeConstraintSpecificationEditPartCN extends PapyrusCompartmentEdi
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -256,12 +260,12 @@ public class TimeConstraintSpecificationEditPartCN extends PapyrusCompartmentEdi
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -269,10 +273,12 @@ public class TimeConstraintSpecificationEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -290,15 +296,16 @@ public class TimeConstraintSpecificationEditPartCN extends PapyrusCompartmentEdi
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -306,6 +313,7 @@ public class TimeConstraintSpecificationEditPartCN extends PapyrusCompartmentEdi
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -316,7 +324,7 @@ public class TimeConstraintSpecificationEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -333,7 +341,7 @@ public class TimeConstraintSpecificationEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.TimeConstraint_3117, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.TimeConstraintSpecificationEditPartCN.VISUAL_ID));
}
return parser;
@@ -343,8 +351,10 @@ public class TimeConstraintSpecificationEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -373,8 +383,8 @@ public class TimeConstraintSpecificationEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -382,8 +392,8 @@ public class TimeConstraintSpecificationEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -393,46 +403,52 @@ public class TimeConstraintSpecificationEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -454,12 +470,12 @@ public class TimeConstraintSpecificationEditPartCN extends PapyrusCompartmentEdi
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -489,12 +505,12 @@ public class TimeConstraintSpecificationEditPartCN extends PapyrusCompartmentEdi
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -503,12 +519,12 @@ public class TimeConstraintSpecificationEditPartCN extends PapyrusCompartmentEdi
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -516,15 +532,16 @@ public class TimeConstraintSpecificationEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -533,9 +550,10 @@ public class TimeConstraintSpecificationEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -543,9 +561,12 @@ public class TimeConstraintSpecificationEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -561,11 +582,11 @@ public class TimeConstraintSpecificationEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -576,8 +597,8 @@ public class TimeConstraintSpecificationEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -589,7 +610,7 @@ public class TimeConstraintSpecificationEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -615,13 +636,14 @@ public class TimeConstraintSpecificationEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -633,8 +655,8 @@ public class TimeConstraintSpecificationEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -651,35 +673,40 @@ public class TimeConstraintSpecificationEditPartCN extends PapyrusCompartmentEdi
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -689,12 +716,13 @@ public class TimeConstraintSpecificationEditPartCN extends PapyrusCompartmentEdi
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -729,24 +757,25 @@ public class TimeConstraintSpecificationEditPartCN extends PapyrusCompartmentEdi
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
@@ -781,7 +810,8 @@ public class TimeConstraintSpecificationEditPartCN extends PapyrusCompartmentEdi
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -790,6 +820,7 @@ public class TimeConstraintSpecificationEditPartCN extends PapyrusCompartmentEdi
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -797,5 +828,6 @@ public class TimeConstraintSpecificationEditPartCN extends PapyrusCompartmentEdi
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeEventEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeEventEditPart.java
index 74d0f561dbe..edfc73eff11 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeEventEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeEventEditPart.java
@@ -84,7 +84,9 @@ public class TimeEventEditPart extends RoundedCompartmentEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
@@ -101,21 +103,21 @@ public class TimeEventEditPart extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case TimeEventFloatingLabelEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -135,8 +137,9 @@ public class TimeEventEditPart extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -154,6 +157,7 @@ public class TimeEventEditPart extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -165,20 +169,23 @@ public class TimeEventEditPart extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure
+ *
* @generated
*/
public RoundedCompartmentFigure getPrimaryShape() {
- return (RoundedCompartmentFigure)primaryShape;
+ return (RoundedCompartmentFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof TimeEventNameEditPart) {
- ((TimeEventNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof TimeEventNameEditPart) {
+ ((TimeEventNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
+
+
return false;
}
@@ -186,7 +193,7 @@ public class TimeEventEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof TimeEventNameEditPart) {
+ if (childEditPart instanceof TimeEventNameEditPart) {
return true;
}
return false;
@@ -196,7 +203,7 @@ public class TimeEventEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -206,7 +213,7 @@ public class TimeEventEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -216,7 +223,7 @@ public class TimeEventEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -226,7 +233,7 @@ public class TimeEventEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof TimeEventFloatingLabelEditPart) {
+ if (borderItemEditPart instanceof TimeEventFloatingLabelEditPart) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -249,16 +256,19 @@ public class TimeEventEditPart extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -270,7 +280,7 @@ public class TimeEventEditPart extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -280,7 +290,7 @@ public class TimeEventEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -296,8 +306,8 @@ public class TimeEventEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeEventFloatingLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeEventFloatingLabelEditPart.java
index c4f6b931f62..6df5951abd4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeEventFloatingLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeEventFloatingLabelEditPart.java
@@ -113,15 +113,18 @@ public class TimeEventFloatingLabelEditPart extends FloatingLabelEditPart implem
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class TimeEventFloatingLabelEditPart extends FloatingLabelEditPart implem
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class TimeEventFloatingLabelEditPart extends FloatingLabelEditPart implem
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class TimeEventFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class TimeEventFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class TimeEventFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class TimeEventFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class TimeEventFloatingLabelEditPart extends FloatingLabelEditPart implem
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class TimeEventFloatingLabelEditPart extends FloatingLabelEditPart implem
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class TimeEventFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class TimeEventFloatingLabelEditPart extends FloatingLabelEditPart implem
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class TimeEventFloatingLabelEditPart extends FloatingLabelEditPart implem
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class TimeEventFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class TimeEventFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.TimeEvent_2089, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.TimeEventFloatingLabelEditPart.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class TimeEventFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class TimeEventFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class TimeEventFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class TimeEventFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class TimeEventFloatingLabelEditPart extends FloatingLabelEditPart implem
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class TimeEventFloatingLabelEditPart extends FloatingLabelEditPart implem
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class TimeEventFloatingLabelEditPart extends FloatingLabelEditPart implem
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class TimeEventFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class TimeEventFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class TimeEventFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class TimeEventFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class TimeEventFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class TimeEventFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class TimeEventFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class TimeEventFloatingLabelEditPart extends FloatingLabelEditPart implem
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class TimeEventFloatingLabelEditPart extends FloatingLabelEditPart implem
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class TimeEventFloatingLabelEditPart extends FloatingLabelEditPart implem
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class TimeEventFloatingLabelEditPart extends FloatingLabelEditPart implem
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeEventNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeEventNameEditPart.java
index 49758dba712..32ff61340ea 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeEventNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeEventNameEditPart.java
@@ -114,12 +114,14 @@ public class TimeEventNameEditPart extends PapyrusCompartmentEditPart implements
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class TimeEventNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class TimeEventNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class TimeEventNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class TimeEventNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class TimeEventNameEditPart extends PapyrusCompartmentEditPart implements
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class TimeEventNameEditPart extends PapyrusCompartmentEditPart implements
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class TimeEventNameEditPart extends PapyrusCompartmentEditPart implements
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class TimeEventNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class TimeEventNameEditPart extends PapyrusCompartmentEditPart implements
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class TimeEventNameEditPart extends PapyrusCompartmentEditPart implements
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class TimeEventNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class TimeEventNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.TimeEvent_2089, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.TimeEventNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class TimeEventNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class TimeEventNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class TimeEventNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class TimeEventNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class TimeEventNameEditPart extends PapyrusCompartmentEditPart implements
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class TimeEventNameEditPart extends PapyrusCompartmentEditPart implements
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class TimeEventNameEditPart extends PapyrusCompartmentEditPart implements
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class TimeEventNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class TimeEventNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class TimeEventNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class TimeEventNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class TimeEventNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class TimeEventNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class TimeEventNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class TimeEventNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class TimeEventNameEditPart extends PapyrusCompartmentEditPart implements
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class TimeEventNameEditPart extends PapyrusCompartmentEditPart implements
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class TimeEventNameEditPart extends PapyrusCompartmentEditPart implements
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class TimeEventNameEditPart extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class TimeEventNameEditPart extends PapyrusCompartmentEditPart implements
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class TimeEventNameEditPart extends PapyrusCompartmentEditPart implements
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeExpressionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeExpressionEditPart.java
index 9fb402dfd13..2a0e43c71a7 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeExpressionEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeExpressionEditPart.java
@@ -84,7 +84,9 @@ public class TimeExpressionEditPart extends RoundedCompartmentEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
@@ -101,21 +103,21 @@ public class TimeExpressionEditPart extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case TimeExpressionFloatingLabelEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -135,8 +137,9 @@ public class TimeExpressionEditPart extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -154,6 +157,7 @@ public class TimeExpressionEditPart extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -165,20 +169,23 @@ public class TimeExpressionEditPart extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure
+ *
* @generated
*/
public RoundedCompartmentFigure getPrimaryShape() {
- return (RoundedCompartmentFigure)primaryShape;
+ return (RoundedCompartmentFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof TimeExpressionNameEditPart) {
- ((TimeExpressionNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof TimeExpressionNameEditPart) {
+ ((TimeExpressionNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
+
+
return false;
}
@@ -186,7 +193,7 @@ public class TimeExpressionEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof TimeExpressionNameEditPart) {
+ if (childEditPart instanceof TimeExpressionNameEditPart) {
return true;
}
return false;
@@ -196,7 +203,7 @@ public class TimeExpressionEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -206,7 +213,7 @@ public class TimeExpressionEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -216,7 +223,7 @@ public class TimeExpressionEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -226,7 +233,7 @@ public class TimeExpressionEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof TimeExpressionFloatingLabelEditPart) {
+ if (borderItemEditPart instanceof TimeExpressionFloatingLabelEditPart) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -249,16 +256,19 @@ public class TimeExpressionEditPart extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -270,7 +280,7 @@ public class TimeExpressionEditPart extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -280,7 +290,7 @@ public class TimeExpressionEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -296,8 +306,8 @@ public class TimeExpressionEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeExpressionFloatingLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeExpressionFloatingLabelEditPart.java
index cca428407b8..9cc05955ea0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeExpressionFloatingLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeExpressionFloatingLabelEditPart.java
@@ -113,15 +113,18 @@ public class TimeExpressionFloatingLabelEditPart extends FloatingLabelEditPart i
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class TimeExpressionFloatingLabelEditPart extends FloatingLabelEditPart i
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class TimeExpressionFloatingLabelEditPart extends FloatingLabelEditPart i
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class TimeExpressionFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class TimeExpressionFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class TimeExpressionFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class TimeExpressionFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class TimeExpressionFloatingLabelEditPart extends FloatingLabelEditPart i
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class TimeExpressionFloatingLabelEditPart extends FloatingLabelEditPart i
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class TimeExpressionFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class TimeExpressionFloatingLabelEditPart extends FloatingLabelEditPart i
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class TimeExpressionFloatingLabelEditPart extends FloatingLabelEditPart i
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class TimeExpressionFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class TimeExpressionFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.TimeExpression_2102, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.TimeExpressionFloatingLabelEditPart.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class TimeExpressionFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class TimeExpressionFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class TimeExpressionFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class TimeExpressionFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class TimeExpressionFloatingLabelEditPart extends FloatingLabelEditPart i
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class TimeExpressionFloatingLabelEditPart extends FloatingLabelEditPart i
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class TimeExpressionFloatingLabelEditPart extends FloatingLabelEditPart i
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class TimeExpressionFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class TimeExpressionFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class TimeExpressionFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class TimeExpressionFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class TimeExpressionFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class TimeExpressionFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class TimeExpressionFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class TimeExpressionFloatingLabelEditPart extends FloatingLabelEditPart i
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class TimeExpressionFloatingLabelEditPart extends FloatingLabelEditPart i
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class TimeExpressionFloatingLabelEditPart extends FloatingLabelEditPart i
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class TimeExpressionFloatingLabelEditPart extends FloatingLabelEditPart i
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeExpressionNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeExpressionNameEditPart.java
index 03f1362e494..66bcee930f6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeExpressionNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeExpressionNameEditPart.java
@@ -114,12 +114,14 @@ public class TimeExpressionNameEditPart extends PapyrusCompartmentEditPart imple
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class TimeExpressionNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class TimeExpressionNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class TimeExpressionNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class TimeExpressionNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class TimeExpressionNameEditPart extends PapyrusCompartmentEditPart imple
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class TimeExpressionNameEditPart extends PapyrusCompartmentEditPart imple
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class TimeExpressionNameEditPart extends PapyrusCompartmentEditPart imple
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class TimeExpressionNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class TimeExpressionNameEditPart extends PapyrusCompartmentEditPart imple
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class TimeExpressionNameEditPart extends PapyrusCompartmentEditPart imple
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class TimeExpressionNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class TimeExpressionNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.TimeExpression_2102, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.TimeExpressionNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class TimeExpressionNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class TimeExpressionNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class TimeExpressionNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class TimeExpressionNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class TimeExpressionNameEditPart extends PapyrusCompartmentEditPart imple
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class TimeExpressionNameEditPart extends PapyrusCompartmentEditPart imple
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class TimeExpressionNameEditPart extends PapyrusCompartmentEditPart imple
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class TimeExpressionNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class TimeExpressionNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class TimeExpressionNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class TimeExpressionNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class TimeExpressionNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class TimeExpressionNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class TimeExpressionNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class TimeExpressionNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class TimeExpressionNameEditPart extends PapyrusCompartmentEditPart imple
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class TimeExpressionNameEditPart extends PapyrusCompartmentEditPart imple
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class TimeExpressionNameEditPart extends PapyrusCompartmentEditPart imple
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class TimeExpressionNameEditPart extends PapyrusCompartmentEditPart imple
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class TimeExpressionNameEditPart extends PapyrusCompartmentEditPart imple
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class TimeExpressionNameEditPart extends PapyrusCompartmentEditPart imple
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeIntervalEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeIntervalEditPart.java
index 417b7dda90b..a33125b2058 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeIntervalEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeIntervalEditPart.java
@@ -84,7 +84,9 @@ public class TimeIntervalEditPart extends RoundedCompartmentEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
@@ -101,21 +103,21 @@ public class TimeIntervalEditPart extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case TimeIntervalFloatingLabelEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -135,8 +137,9 @@ public class TimeIntervalEditPart extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -154,6 +157,7 @@ public class TimeIntervalEditPart extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -165,20 +169,23 @@ public class TimeIntervalEditPart extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure
+ *
* @generated
*/
public RoundedCompartmentFigure getPrimaryShape() {
- return (RoundedCompartmentFigure)primaryShape;
+ return (RoundedCompartmentFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof TimeIntervalNameEditPart) {
- ((TimeIntervalNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof TimeIntervalNameEditPart) {
+ ((TimeIntervalNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
+
+
return false;
}
@@ -186,7 +193,7 @@ public class TimeIntervalEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof TimeIntervalNameEditPart) {
+ if (childEditPart instanceof TimeIntervalNameEditPart) {
return true;
}
return false;
@@ -196,7 +203,7 @@ public class TimeIntervalEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -206,7 +213,7 @@ public class TimeIntervalEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -216,7 +223,7 @@ public class TimeIntervalEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -226,7 +233,7 @@ public class TimeIntervalEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof TimeIntervalFloatingLabelEditPart) {
+ if (borderItemEditPart instanceof TimeIntervalFloatingLabelEditPart) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -249,16 +256,19 @@ public class TimeIntervalEditPart extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -270,7 +280,7 @@ public class TimeIntervalEditPart extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -280,7 +290,7 @@ public class TimeIntervalEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -296,8 +306,8 @@ public class TimeIntervalEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeIntervalFloatingLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeIntervalFloatingLabelEditPart.java
index 6e598894712..f946e6dd31d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeIntervalFloatingLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeIntervalFloatingLabelEditPart.java
@@ -113,15 +113,18 @@ public class TimeIntervalFloatingLabelEditPart extends FloatingLabelEditPart imp
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class TimeIntervalFloatingLabelEditPart extends FloatingLabelEditPart imp
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class TimeIntervalFloatingLabelEditPart extends FloatingLabelEditPart imp
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class TimeIntervalFloatingLabelEditPart extends FloatingLabelEditPart imp
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class TimeIntervalFloatingLabelEditPart extends FloatingLabelEditPart imp
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class TimeIntervalFloatingLabelEditPart extends FloatingLabelEditPart imp
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class TimeIntervalFloatingLabelEditPart extends FloatingLabelEditPart imp
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class TimeIntervalFloatingLabelEditPart extends FloatingLabelEditPart imp
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class TimeIntervalFloatingLabelEditPart extends FloatingLabelEditPart imp
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class TimeIntervalFloatingLabelEditPart extends FloatingLabelEditPart imp
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class TimeIntervalFloatingLabelEditPart extends FloatingLabelEditPart imp
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class TimeIntervalFloatingLabelEditPart extends FloatingLabelEditPart imp
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class TimeIntervalFloatingLabelEditPart extends FloatingLabelEditPart imp
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class TimeIntervalFloatingLabelEditPart extends FloatingLabelEditPart imp
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.TimeInterval_2105, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.TimeIntervalFloatingLabelEditPart.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class TimeIntervalFloatingLabelEditPart extends FloatingLabelEditPart imp
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class TimeIntervalFloatingLabelEditPart extends FloatingLabelEditPart imp
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class TimeIntervalFloatingLabelEditPart extends FloatingLabelEditPart imp
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class TimeIntervalFloatingLabelEditPart extends FloatingLabelEditPart imp
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class TimeIntervalFloatingLabelEditPart extends FloatingLabelEditPart imp
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class TimeIntervalFloatingLabelEditPart extends FloatingLabelEditPart imp
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class TimeIntervalFloatingLabelEditPart extends FloatingLabelEditPart imp
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class TimeIntervalFloatingLabelEditPart extends FloatingLabelEditPart imp
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class TimeIntervalFloatingLabelEditPart extends FloatingLabelEditPart imp
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class TimeIntervalFloatingLabelEditPart extends FloatingLabelEditPart imp
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class TimeIntervalFloatingLabelEditPart extends FloatingLabelEditPart imp
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class TimeIntervalFloatingLabelEditPart extends FloatingLabelEditPart imp
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class TimeIntervalFloatingLabelEditPart extends FloatingLabelEditPart imp
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class TimeIntervalFloatingLabelEditPart extends FloatingLabelEditPart imp
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class TimeIntervalFloatingLabelEditPart extends FloatingLabelEditPart imp
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class TimeIntervalFloatingLabelEditPart extends FloatingLabelEditPart imp
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class TimeIntervalFloatingLabelEditPart extends FloatingLabelEditPart imp
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class TimeIntervalFloatingLabelEditPart extends FloatingLabelEditPart imp
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeIntervalNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeIntervalNameEditPart.java
index eb99b0a3ee6..2e12903ff4c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeIntervalNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeIntervalNameEditPart.java
@@ -114,12 +114,14 @@ public class TimeIntervalNameEditPart extends PapyrusCompartmentEditPart impleme
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class TimeIntervalNameEditPart extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class TimeIntervalNameEditPart extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class TimeIntervalNameEditPart extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class TimeIntervalNameEditPart extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class TimeIntervalNameEditPart extends PapyrusCompartmentEditPart impleme
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class TimeIntervalNameEditPart extends PapyrusCompartmentEditPart impleme
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class TimeIntervalNameEditPart extends PapyrusCompartmentEditPart impleme
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class TimeIntervalNameEditPart extends PapyrusCompartmentEditPart impleme
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class TimeIntervalNameEditPart extends PapyrusCompartmentEditPart impleme
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class TimeIntervalNameEditPart extends PapyrusCompartmentEditPart impleme
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class TimeIntervalNameEditPart extends PapyrusCompartmentEditPart impleme
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class TimeIntervalNameEditPart extends PapyrusCompartmentEditPart impleme
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.TimeInterval_2105, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.TimeIntervalNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class TimeIntervalNameEditPart extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class TimeIntervalNameEditPart extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class TimeIntervalNameEditPart extends PapyrusCompartmentEditPart impleme
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class TimeIntervalNameEditPart extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class TimeIntervalNameEditPart extends PapyrusCompartmentEditPart impleme
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class TimeIntervalNameEditPart extends PapyrusCompartmentEditPart impleme
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class TimeIntervalNameEditPart extends PapyrusCompartmentEditPart impleme
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class TimeIntervalNameEditPart extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class TimeIntervalNameEditPart extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class TimeIntervalNameEditPart extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class TimeIntervalNameEditPart extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class TimeIntervalNameEditPart extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class TimeIntervalNameEditPart extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class TimeIntervalNameEditPart extends PapyrusCompartmentEditPart impleme
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class TimeIntervalNameEditPart extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class TimeIntervalNameEditPart extends PapyrusCompartmentEditPart impleme
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class TimeIntervalNameEditPart extends PapyrusCompartmentEditPart impleme
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class TimeIntervalNameEditPart extends PapyrusCompartmentEditPart impleme
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class TimeIntervalNameEditPart extends PapyrusCompartmentEditPart impleme
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class TimeIntervalNameEditPart extends PapyrusCompartmentEditPart impleme
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class TimeIntervalNameEditPart extends PapyrusCompartmentEditPart impleme
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeObservationEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeObservationEditPart.java
index 0e55a2e22b7..265dacabe63 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeObservationEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeObservationEditPart.java
@@ -85,7 +85,9 @@ public class TimeObservationEditPart extends RoundedCompartmentEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeIconlDisplayEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
@@ -104,22 +106,22 @@ public class TimeObservationEditPart extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case TimeObservationNameEditPart.VISUAL_ID:
case TimeObservationStereotypeLabelEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -139,8 +141,9 @@ public class TimeObservationEditPart extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -158,6 +161,7 @@ public class TimeObservationEditPart extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -169,20 +173,22 @@ public class TimeObservationEditPart extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure
+ *
* @generated
*/
public RoundedCompartmentFigure getPrimaryShape() {
- return (RoundedCompartmentFigure)primaryShape;
+ return (RoundedCompartmentFigure) primaryShape;
}
/**
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof TimeObservationNameEditPart) {
+ if (borderItemEditPart instanceof TimeObservationNameEditPart) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
- } else if(borderItemEditPart instanceof TimeObservationStereotypeLabelEditPart) {
+ } else
+ if (borderItemEditPart instanceof TimeObservationStereotypeLabelEditPart) {
IBorderItemLocator locator = new ExternalLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -205,12 +211,15 @@ public class TimeObservationEditPart extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
@@ -221,7 +230,7 @@ public class TimeObservationEditPart extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -231,7 +240,7 @@ public class TimeObservationEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -247,8 +256,8 @@ public class TimeObservationEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeObservationEventEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeObservationEventEditPart.java
index 7627b168ab4..96fb10dfcbe 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeObservationEventEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeObservationEventEditPart.java
@@ -60,6 +60,6 @@ public class TimeObservationEventEditPart extends ConnectionEditPart implements
* @generated
*/
public SimpleDashedEdgeFigure getPrimaryShape() {
- return (SimpleDashedEdgeFigure)getFigure();
+ return (SimpleDashedEdgeFigure) getFigure();
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeObservationNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeObservationNameEditPart.java
index 8bff4f68b97..a510f6d6e03 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeObservationNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeObservationNameEditPart.java
@@ -125,6 +125,7 @@ public class TimeObservationNameEditPart extends FloatingLabelEditPart implement
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -230,8 +231,7 @@ public class TimeObservationNameEditPart extends FloatingLabelEditPart implement
/**
* @generated
*/
- public void setLabel(IFigure
- figure) {
+ public void setLabel(IFigure figure) {
unregisterVisuals();
setFigure(figure);
defaultText = getLabelTextHelper(figure);
@@ -342,15 +342,14 @@ public class TimeObservationNameEditPart extends FloatingLabelEditPart implement
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid =
- (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
@@ -479,8 +478,7 @@ public class TimeObservationNameEditPart extends FloatingLabelEditPart implement
IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- }
- else if (configuration instanceof IAdvancedEditorConfiguration) {
+ } 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);
@@ -525,8 +523,7 @@ public class TimeObservationNameEditPart extends FloatingLabelEditPart implement
RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- }
- else {
+ } else {
performDirectEdit();
}
}
@@ -563,8 +560,7 @@ public class TimeObservationNameEditPart extends FloatingLabelEditPart implement
if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
- }
- else {
+ } else {
setLabelTextHelper(getFigure(), ""); //$NON-NLS-1$
setLabelIconHelper(getFigure(), null);
}
@@ -583,17 +579,15 @@ public class TimeObservationNameEditPart extends FloatingLabelEditPart implement
* @generated
*/
protected void refreshUnderline() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
if (resolveSemanticElement() instanceof Feature) {
if (((Feature) resolveSemanticElement()).isStatic()) {
((WrappingLabel) getFigure()).setTextUnderline(true);
- }
- else {
+ } else {
((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
@@ -603,9 +597,8 @@ public class TimeObservationNameEditPart extends FloatingLabelEditPart implement
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
@@ -616,14 +609,12 @@ public class TimeObservationNameEditPart extends FloatingLabelEditPart implement
*/
@Override
protected void refreshFont() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ 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));
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -717,7 +708,7 @@ public class TimeObservationNameEditPart extends FloatingLabelEditPart implement
*/
protected boolean checkExtendedEditor() {
if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -741,9 +732,9 @@ public class TimeObservationNameEditPart extends FloatingLabelEditPart implement
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());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
@@ -757,8 +748,7 @@ public class TimeObservationNameEditPart extends FloatingLabelEditPart implement
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement()
- .eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
@@ -810,18 +800,15 @@ public class TimeObservationNameEditPart extends FloatingLabelEditPart implement
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)) {
+ } 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();
+ ISemanticParser modelParser = (ISemanticParser) getParser();
if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
if (resolveSemanticElement() != null) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeObservationStereotypeLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeObservationStereotypeLabelEditPart.java
index 8179e314669..b9e1773814a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeObservationStereotypeLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/TimeObservationStereotypeLabelEditPart.java
@@ -127,6 +127,7 @@ public class TimeObservationStereotypeLabelEditPart extends AbstractLabelEditPar
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -233,8 +234,7 @@ public class TimeObservationStereotypeLabelEditPart extends AbstractLabelEditPar
/**
* @generated
*/
- public void setLabel(IFigure
- figure) {
+ public void setLabel(IFigure figure) {
unregisterVisuals();
setFigure(figure);
defaultText = getLabelTextHelper(figure);
@@ -345,15 +345,14 @@ public class TimeObservationStereotypeLabelEditPart extends AbstractLabelEditPar
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid =
- (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
@@ -482,8 +481,7 @@ public class TimeObservationStereotypeLabelEditPart extends AbstractLabelEditPar
IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- }
- else if (configuration instanceof IAdvancedEditorConfiguration) {
+ } 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);
@@ -528,8 +526,7 @@ public class TimeObservationStereotypeLabelEditPart extends AbstractLabelEditPar
RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- }
- else {
+ } else {
performDirectEdit();
}
}
@@ -566,8 +563,7 @@ public class TimeObservationStereotypeLabelEditPart extends AbstractLabelEditPar
if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
- }
- else {
+ } else {
setLabelTextHelper(getFigure(), ""); //$NON-NLS-1$
setLabelIconHelper(getFigure(), null);
}
@@ -586,17 +582,15 @@ public class TimeObservationStereotypeLabelEditPart extends AbstractLabelEditPar
* @generated
*/
protected void refreshUnderline() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
if (resolveSemanticElement() instanceof Feature) {
if (((Feature) resolveSemanticElement()).isStatic()) {
((WrappingLabel) getFigure()).setTextUnderline(true);
- }
- else {
+ } else {
((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
@@ -606,9 +600,8 @@ public class TimeObservationStereotypeLabelEditPart extends AbstractLabelEditPar
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
@@ -619,14 +612,12 @@ public class TimeObservationStereotypeLabelEditPart extends AbstractLabelEditPar
*/
@Override
protected void refreshFont() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ 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));
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -720,7 +711,7 @@ public class TimeObservationStereotypeLabelEditPart extends AbstractLabelEditPar
*/
protected boolean checkExtendedEditor() {
if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -744,9 +735,9 @@ public class TimeObservationStereotypeLabelEditPart extends AbstractLabelEditPar
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());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
@@ -760,8 +751,7 @@ public class TimeObservationStereotypeLabelEditPart extends AbstractLabelEditPar
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement()
- .eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
@@ -813,18 +803,15 @@ public class TimeObservationStereotypeLabelEditPart extends AbstractLabelEditPar
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)) {
+ } 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();
+ ISemanticParser modelParser = (ISemanticParser) getParser();
if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
if (resolveSemanticElement() != null) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UMLEditPartFactory.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UMLEditPartFactory.java
index 01cd0d67399..64776a69092 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UMLEditPartFactory.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UMLEditPartFactory.java
@@ -34,667 +34,1016 @@ public class UMLEditPartFactory implements EditPartFactory {
* @generated
*/
public EditPart createEditPart(EditPart context, Object model) {
- if(model instanceof View) {
- View view = (View)model;
- switch(UMLVisualIDRegistry.getVisualID(view)) {
+ if (model instanceof View) {
+ View view = (View) model;
+ switch (UMLVisualIDRegistry.getVisualID(view)) {
+
case CompositeStructureDiagramEditPart.VISUAL_ID:
return new CompositeStructureDiagramEditPart(view);
+
case ActivityCompositeEditPart.VISUAL_ID:
return new ActivityCompositeEditPart(view);
+
case ActivityCompositeNameEditPart.VISUAL_ID:
return new ActivityCompositeNameEditPart(view);
+
case ActivityCompositeFloatingLabelEditPart.VISUAL_ID:
return new ActivityCompositeFloatingLabelEditPart(view);
+
case InteractionCompositeEditPart.VISUAL_ID:
return new InteractionCompositeEditPart(view);
+
case InteractionCompositeNameEditPart.VISUAL_ID:
return new InteractionCompositeNameEditPart(view);
+
case InteractionCompositeFloatingLabelEditPart.VISUAL_ID:
return new InteractionCompositeFloatingLabelEditPart(view);
+
case ProtocolStateMachineCompositeEditPart.VISUAL_ID:
return new ProtocolStateMachineCompositeEditPart(view);
+
case ProtocolStateMachineCompositeNameEditPart.VISUAL_ID:
return new ProtocolStateMachineCompositeNameEditPart(view);
+
case ProtocolStateMachineCompositeFloatingLabelEditPart.VISUAL_ID:
return new ProtocolStateMachineCompositeFloatingLabelEditPart(view);
+
case StateMachineCompositeEditPart.VISUAL_ID:
return new StateMachineCompositeEditPart(view);
+
case StateMachineCompositeNameEditPart.VISUAL_ID:
return new StateMachineCompositeNameEditPart(view);
+
case StateMachineCompositeFloatingLabelEditPart.VISUAL_ID:
return new StateMachineCompositeFloatingLabelEditPart(view);
+
case FunctionBehaviorCompositeEditPart.VISUAL_ID:
return new FunctionBehaviorCompositeEditPart(view);
+
case FunctionBehaviorCompositeNameEditPart.VISUAL_ID:
return new FunctionBehaviorCompositeNameEditPart(view);
+
case FunctionBehaviorCompositeFloatingLabelEditPart.VISUAL_ID:
return new FunctionBehaviorCompositeFloatingLabelEditPart(view);
+
case OpaqueBehaviorCompositeEditPart.VISUAL_ID:
return new OpaqueBehaviorCompositeEditPart(view);
+
case OpaqueBehaviorCompositeNameEditPart.VISUAL_ID:
return new OpaqueBehaviorCompositeNameEditPart(view);
+
case OpaqueBehaviorCompositeFloatingLabelEditPart.VISUAL_ID:
return new OpaqueBehaviorCompositeFloatingLabelEditPart(view);
+
case ComponentCompositeEditPart.VISUAL_ID:
return new ComponentCompositeEditPart(view);
+
case ComponentCompositeNameEditPart.VISUAL_ID:
return new ComponentCompositeNameEditPart(view);
+
case ComponentCompositeFloatingLabelEditPart.VISUAL_ID:
return new ComponentCompositeFloatingLabelEditPart(view);
+
case DeviceCompositeEditPart.VISUAL_ID:
return new DeviceCompositeEditPart(view);
+
case DeviceCompositeNameEditPart.VISUAL_ID:
return new DeviceCompositeNameEditPart(view);
+
case DeviceCompositeFloatingLabelEditPart.VISUAL_ID:
return new DeviceCompositeFloatingLabelEditPart(view);
+
case ExecutionEnvironmentCompositeEditPart.VISUAL_ID:
return new ExecutionEnvironmentCompositeEditPart(view);
+
case ExecutionEnvironmentCompositeNameEditPart.VISUAL_ID:
return new ExecutionEnvironmentCompositeNameEditPart(view);
+
case ExecutionEnvironmentCompositeFloatingLabelEditPart.VISUAL_ID:
return new ExecutionEnvironmentCompositeFloatingLabelEditPart(view);
+
case NodeCompositeEditPart.VISUAL_ID:
return new NodeCompositeEditPart(view);
+
case NodeCompositeNameEditPart.VISUAL_ID:
return new NodeCompositeNameEditPart(view);
+
case NodeCompositeFloatingLabelEditPart.VISUAL_ID:
return new NodeCompositeFloatingLabelEditPart(view);
+
case ClassCompositeEditPart.VISUAL_ID:
return new ClassCompositeEditPart(view);
+
case ClassCompositeNameEditPart.VISUAL_ID:
return new ClassCompositeNameEditPart(view);
+
case ClassCompositeFloatingLabelEditPart.VISUAL_ID:
return new ClassCompositeFloatingLabelEditPart(view);
+
case CollaborationCompositeEditPart.VISUAL_ID:
return new CollaborationCompositeEditPart(view);
+
case CollaborationCompositeNameEditPart.VISUAL_ID:
return new CollaborationCompositeNameEditPart(view);
+
case CollaborationCompositeFloatingLabelEditPart.VISUAL_ID:
return new CollaborationCompositeFloatingLabelEditPart(view);
+
case InterfaceEditPart.VISUAL_ID:
return new InterfaceEditPart(view);
+
case InterfaceNameEditPart.VISUAL_ID:
return new InterfaceNameEditPart(view);
+
case InterfaceFloatingLabelEditPart.VISUAL_ID:
return new InterfaceFloatingLabelEditPart(view);
+
case PrimitiveTypeEditPart.VISUAL_ID:
return new PrimitiveTypeEditPart(view);
+
case PrimitiveTypeNameEditPart.VISUAL_ID:
return new PrimitiveTypeNameEditPart(view);
+
case PrimitiveTypeFloatingLabelEditPart.VISUAL_ID:
return new PrimitiveTypeFloatingLabelEditPart(view);
+
case EnumerationEditPart.VISUAL_ID:
return new EnumerationEditPart(view);
+
case EnumerationNameEditPart.VISUAL_ID:
return new EnumerationNameEditPart(view);
+
case EnumerationFloatingLabelEditPart.VISUAL_ID:
return new EnumerationFloatingLabelEditPart(view);
+
case DataTypeEditPart.VISUAL_ID:
return new DataTypeEditPart(view);
+
case DataTypeNameEditPart.VISUAL_ID:
return new DataTypeNameEditPart(view);
+
case DataTypeFloatingLabelEditPart.VISUAL_ID:
return new DataTypeFloatingLabelEditPart(view);
+
case ActorEditPart.VISUAL_ID:
return new ActorEditPart(view);
+
case ActorNameEditPart.VISUAL_ID:
return new ActorNameEditPart(view);
+
case ActorFloatingLabelEditPart.VISUAL_ID:
return new ActorFloatingLabelEditPart(view);
+
case DeploymentSpecificationEditPart.VISUAL_ID:
return new DeploymentSpecificationEditPart(view);
+
case DeploymentSpecificationNameEditPart.VISUAL_ID:
return new DeploymentSpecificationNameEditPart(view);
+
case DeploymentSpecificationFloatingLabelEditPart.VISUAL_ID:
return new DeploymentSpecificationFloatingLabelEditPart(view);
+
case ArtifactEditPart.VISUAL_ID:
return new ArtifactEditPart(view);
+
case ArtifactNameEditPart.VISUAL_ID:
return new ArtifactNameEditPart(view);
+
case ArtifactFloatingLabelEditPart.VISUAL_ID:
return new ArtifactFloatingLabelEditPart(view);
+
case InformationItemEditPart.VISUAL_ID:
return new InformationItemEditPart(view);
+
case InformationItemNameEditPart.VISUAL_ID:
return new InformationItemNameEditPart(view);
+
case InformationItemFloatingLabelEditPart.VISUAL_ID:
return new InformationItemFloatingLabelEditPart(view);
+
case SignalEditPart.VISUAL_ID:
return new SignalEditPart(view);
+
case SignalNameEditPart.VISUAL_ID:
return new SignalNameEditPart(view);
+
case SignalFloatingLabelEditPart.VISUAL_ID:
return new SignalFloatingLabelEditPart(view);
+
case UseCaseEditPart.VISUAL_ID:
return new UseCaseEditPart(view);
+
case UseCaseNameEditPart.VISUAL_ID:
return new UseCaseNameEditPart(view);
+
case UseCaseFloatingLabelEditPart.VISUAL_ID:
return new UseCaseFloatingLabelEditPart(view);
+
case SignalEventEditPart.VISUAL_ID:
return new SignalEventEditPart(view);
+
case SignalEventNameEditPart.VISUAL_ID:
return new SignalEventNameEditPart(view);
+
case SignalEventFloatingLabelEditPart.VISUAL_ID:
return new SignalEventFloatingLabelEditPart(view);
+
case CallEventEditPart.VISUAL_ID:
return new CallEventEditPart(view);
+
case CallEventNameEditPart.VISUAL_ID:
return new CallEventNameEditPart(view);
+
case CallEventFloatingLabelEditPart.VISUAL_ID:
return new CallEventFloatingLabelEditPart(view);
+
case AnyReceiveEventEditPart.VISUAL_ID:
return new AnyReceiveEventEditPart(view);
+
case AnyReceiveEventNameEditPart.VISUAL_ID:
return new AnyReceiveEventNameEditPart(view);
+
case AnyReceiveEventFloatingLabelEditPart.VISUAL_ID:
return new AnyReceiveEventFloatingLabelEditPart(view);
+
case ChangeEventEditPart.VISUAL_ID:
return new ChangeEventEditPart(view);
+
case ChangeEventNameEditPart.VISUAL_ID:
return new ChangeEventNameEditPart(view);
+
case ChangeEventFloatingLabelEditPart.VISUAL_ID:
return new ChangeEventFloatingLabelEditPart(view);
+
case TimeEventEditPart.VISUAL_ID:
return new TimeEventEditPart(view);
+
case TimeEventNameEditPart.VISUAL_ID:
return new TimeEventNameEditPart(view);
+
case TimeEventFloatingLabelEditPart.VISUAL_ID:
return new TimeEventFloatingLabelEditPart(view);
+
case DurationObservationEditPart.VISUAL_ID:
return new DurationObservationEditPart(view);
+
case DurationObservationNameEditPart.VISUAL_ID:
return new DurationObservationNameEditPart(view);
+
case DurationObservationStereotypeLabelEditPart.VISUAL_ID:
return new DurationObservationStereotypeLabelEditPart(view);
+
case TimeObservationEditPart.VISUAL_ID:
return new TimeObservationEditPart(view);
+
case TimeObservationNameEditPart.VISUAL_ID:
return new TimeObservationNameEditPart(view);
+
case TimeObservationStereotypeLabelEditPart.VISUAL_ID:
return new TimeObservationStereotypeLabelEditPart(view);
+
case LiteralBooleanEditPart.VISUAL_ID:
return new LiteralBooleanEditPart(view);
+
case LiteralBooleanNameEditPart.VISUAL_ID:
return new LiteralBooleanNameEditPart(view);
+
case LiteralBooleanFloatingLabelEditPart.VISUAL_ID:
return new LiteralBooleanFloatingLabelEditPart(view);
+
case LiteralIntegerEditPart.VISUAL_ID:
return new LiteralIntegerEditPart(view);
+
case LiteralIntegerNameEditPart.VISUAL_ID:
return new LiteralIntegerNameEditPart(view);
+
case LiteralIntegerFloatingLabelEditPart.VISUAL_ID:
return new LiteralIntegerFloatingLabelEditPart(view);
+
case LiteralNullEditPart.VISUAL_ID:
return new LiteralNullEditPart(view);
+
case LiteralNullNameEditPart.VISUAL_ID:
return new LiteralNullNameEditPart(view);
+
case LiteralNullFloatingLabelEditPart.VISUAL_ID:
return new LiteralNullFloatingLabelEditPart(view);
+
case LiteralStringEditPart.VISUAL_ID:
return new LiteralStringEditPart(view);
+
case LiteralStringNameEditPart.VISUAL_ID:
return new LiteralStringNameEditPart(view);
+
case LiteralStringFloatingLabelEditPart.VISUAL_ID:
return new LiteralStringFloatingLabelEditPart(view);
+
case LiteralUnlimitedNaturalEditPart.VISUAL_ID:
return new LiteralUnlimitedNaturalEditPart(view);
+
case LiteralUnlimitedNaturalNameEditPart.VISUAL_ID:
return new LiteralUnlimitedNaturalNameEditPart(view);
+
case LiteralUnlimitedNaturalFloatingLabelEditPart.VISUAL_ID:
return new LiteralUnlimitedNaturalFloatingLabelEditPart(view);
+
case StringExpressionEditPart.VISUAL_ID:
return new StringExpressionEditPart(view);
+
case StringExpressionNameEditPart.VISUAL_ID:
return new StringExpressionNameEditPart(view);
+
case StringExpressionFloatingLabelEditPart.VISUAL_ID:
return new StringExpressionFloatingLabelEditPart(view);
+
case OpaqueExpressionEditPart.VISUAL_ID:
return new OpaqueExpressionEditPart(view);
+
case OpaqueExpressionNameEditPart.VISUAL_ID:
return new OpaqueExpressionNameEditPart(view);
+
case OpaqueExpressionFloatingLabelEditPart.VISUAL_ID:
return new OpaqueExpressionFloatingLabelEditPart(view);
+
case TimeExpressionEditPart.VISUAL_ID:
return new TimeExpressionEditPart(view);
+
case TimeExpressionNameEditPart.VISUAL_ID:
return new TimeExpressionNameEditPart(view);
+
case TimeExpressionFloatingLabelEditPart.VISUAL_ID:
return new TimeExpressionFloatingLabelEditPart(view);
+
case ExpressionEditPart.VISUAL_ID:
return new ExpressionEditPart(view);
+
case ExpressionNameEditPart.VISUAL_ID:
return new ExpressionNameEditPart(view);
+
case ExpressionFloatingLabelEditPart.VISUAL_ID:
return new ExpressionFloatingLabelEditPart(view);
+
case DurationEditPart.VISUAL_ID:
return new DurationEditPart(view);
+
case DurationNameEditPart.VISUAL_ID:
return new DurationNameEditPart(view);
+
case DurationFloatingLabelEditPart.VISUAL_ID:
return new DurationFloatingLabelEditPart(view);
+
case TimeIntervalEditPart.VISUAL_ID:
return new TimeIntervalEditPart(view);
+
case TimeIntervalNameEditPart.VISUAL_ID:
return new TimeIntervalNameEditPart(view);
+
case TimeIntervalFloatingLabelEditPart.VISUAL_ID:
return new TimeIntervalFloatingLabelEditPart(view);
+
case DurationIntervalEditPart.VISUAL_ID:
return new DurationIntervalEditPart(view);
+
case DurationIntervalNameEditPart.VISUAL_ID:
return new DurationIntervalNameEditPart(view);
+
case DurationIntervalFloatingLabelEditPart.VISUAL_ID:
return new DurationIntervalFloatingLabelEditPart(view);
+
case IntervalEditPart.VISUAL_ID:
return new IntervalEditPart(view);
+
case IntervalNameEditPart.VISUAL_ID:
return new IntervalNameEditPart(view);
+
case IntervalFloatingLabelEditPart.VISUAL_ID:
return new IntervalFloatingLabelEditPart(view);
+
case InstanceValueEditPart.VISUAL_ID:
return new InstanceValueEditPart(view);
+
case InstanceValueNameEditPart.VISUAL_ID:
return new InstanceValueNameEditPart(view);
+
case InstanceValueFloatingLabelEditPart.VISUAL_ID:
return new InstanceValueFloatingLabelEditPart(view);
+
case CommentEditPart.VISUAL_ID:
return new CommentEditPart(view);
+
case CommentBodyEditPart.VISUAL_ID:
return new CommentBodyEditPart(view);
+
case DurationConstraintEditPart.VISUAL_ID:
return new DurationConstraintEditPart(view);
+
case DurationConstraintNameEditPart.VISUAL_ID:
return new DurationConstraintNameEditPart(view);
+
case DurationConstraintSpecificationEditPart.VISUAL_ID:
return new DurationConstraintSpecificationEditPart(view);
+
case TimeConstraintEditPart.VISUAL_ID:
return new TimeConstraintEditPart(view);
+
case TimeConstraintNameEditPart.VISUAL_ID:
return new TimeConstraintNameEditPart(view);
+
case TimeConstraintSpecificationEditPart.VISUAL_ID:
return new TimeConstraintSpecificationEditPart(view);
+
case IntervalConstraintEditPart.VISUAL_ID:
return new IntervalConstraintEditPart(view);
+
case IntervalConstraintNameEditPart.VISUAL_ID:
return new IntervalConstraintNameEditPart(view);
+
case IntervalConstraintSpecificationEditPart.VISUAL_ID:
return new IntervalConstraintSpecificationEditPart(view);
+
case InteractionConstraintEditPart.VISUAL_ID:
return new InteractionConstraintEditPart(view);
+
case InteractionConstraintNameEditPart.VISUAL_ID:
return new InteractionConstraintNameEditPart(view);
+
case InteractionConstraintSpecificationEditPart.VISUAL_ID:
return new InteractionConstraintSpecificationEditPart(view);
+
case ConstraintEditPart.VISUAL_ID:
return new ConstraintEditPart(view);
+
case ConstraintNameEditPart.VISUAL_ID:
return new ConstraintNameEditPart(view);
+
case ConstraintSpecificationEditPart.VISUAL_ID:
return new ConstraintSpecificationEditPart(view);
+
case BehaviorPortEditPart.VISUAL_ID:
return new BehaviorPortEditPart(view);
+
case BehaviorPortFloatingLabelEditPart.VISUAL_ID:
return new BehaviorPortFloatingLabelEditPart(view);
+
case PortEditPart.VISUAL_ID:
return new PortEditPart(view);
+
case PortNameEditPart.VISUAL_ID:
return new PortNameEditPart(view);
+
case PortAppliedStereotypeEditPart.VISUAL_ID:
return new PortAppliedStereotypeEditPart(view);
+
case ParameterEditPart.VISUAL_ID:
return new ParameterEditPart(view);
+
case ParameterNameEditPart.VISUAL_ID:
return new ParameterNameEditPart(view);
+
case ParameterAppliedStereotypeEditPart.VISUAL_ID:
return new ParameterAppliedStereotypeEditPart(view);
+
case PropertyPartEditPartCN.VISUAL_ID:
return new PropertyPartEditPartCN(view);
+
case PropertyPartNameEditPartCN.VISUAL_ID:
return new PropertyPartNameEditPartCN(view);
+
case PropertyPartFloatingLabelEditPartCN.VISUAL_ID:
return new PropertyPartFloatingLabelEditPartCN(view);
+
case CollaborationRoleEditPartCN.VISUAL_ID:
return new CollaborationRoleEditPartCN(view);
+
case CollaborationRoleNameEditPartCN.VISUAL_ID:
return new CollaborationRoleNameEditPartCN(view);
+
case CollaborationRoleFloatingLabelEditPartCN.VISUAL_ID:
return new CollaborationRoleFloatingLabelEditPartCN(view);
+
case CollaborationUseEditPartCN.VISUAL_ID:
return new CollaborationUseEditPartCN(view);
+
case CollaborationUseNameEditPart.VISUAL_ID:
return new CollaborationUseNameEditPart(view);
+
case CollaborationUseFloatingLabelEditPartCN.VISUAL_ID:
return new CollaborationUseFloatingLabelEditPartCN(view);
+
case ActivityCompositeEditPartCN.VISUAL_ID:
return new ActivityCompositeEditPartCN(view);
+
case ActivityCompositeNameEditPartCN.VISUAL_ID:
return new ActivityCompositeNameEditPartCN(view);
+
case ActivityCompositeFloatingLabelEditPartCN.VISUAL_ID:
return new ActivityCompositeFloatingLabelEditPartCN(view);
+
case InteractionCompositeEditPartCN.VISUAL_ID:
return new InteractionCompositeEditPartCN(view);
+
case InteractionCompositeNameEditPartCN.VISUAL_ID:
return new InteractionCompositeNameEditPartCN(view);
+
case InteractionCompositeFloatingLabelEditPartCN.VISUAL_ID:
return new InteractionCompositeFloatingLabelEditPartCN(view);
+
case ProtocolStateMachineCompositeEditPartCN.VISUAL_ID:
return new ProtocolStateMachineCompositeEditPartCN(view);
+
case ProtocolStateMachineCompositeNameEditPartCN.VISUAL_ID:
return new ProtocolStateMachineCompositeNameEditPartCN(view);
+
case ProtocolStateMachineCompositeFloatingLabelEditPartCN.VISUAL_ID:
return new ProtocolStateMachineCompositeFloatingLabelEditPartCN(view);
+
case StateMachineCompositeEditPartCN.VISUAL_ID:
return new StateMachineCompositeEditPartCN(view);
+
case StateMachineCompositeNameEditPartCN.VISUAL_ID:
return new StateMachineCompositeNameEditPartCN(view);
+
case StateMachineCompositeFloatingLabelEditPartCN.VISUAL_ID:
return new StateMachineCompositeFloatingLabelEditPartCN(view);
+
case FunctionBehaviorCompositeEditPartCN.VISUAL_ID:
return new FunctionBehaviorCompositeEditPartCN(view);
+
case FunctionBehaviorCompositeNameEditPartCN.VISUAL_ID:
return new FunctionBehaviorCompositeNameEditPartCN(view);
+
case FunctionBehaviorCompositeFloatingLabelEditPartCN.VISUAL_ID:
return new FunctionBehaviorCompositeFloatingLabelEditPartCN(view);
+
case OpaqueBehaviorCompositeEditPartCN.VISUAL_ID:
return new OpaqueBehaviorCompositeEditPartCN(view);
+
case OpaqueBehaviorCompositeNameEditPartCN.VISUAL_ID:
return new OpaqueBehaviorCompositeNameEditPartCN(view);
+
case OpaqueBehaviorCompositeFloatingLabelEditPartCN.VISUAL_ID:
return new OpaqueBehaviorCompositeFloatingLabelEditPartCN(view);
+
case ComponentCompositeEditPartCN.VISUAL_ID:
return new ComponentCompositeEditPartCN(view);
+
case ComponentCompositeNameEditPartCN.VISUAL_ID:
return new ComponentCompositeNameEditPartCN(view);
+
case ComponentCompositeFloatingLabelEditPartCN.VISUAL_ID:
return new ComponentCompositeFloatingLabelEditPartCN(view);
+
case DeviceCompositeEditPartCN.VISUAL_ID:
return new DeviceCompositeEditPartCN(view);
+
case DeviceCompositeNameEditPartCN.VISUAL_ID:
return new DeviceCompositeNameEditPartCN(view);
+
case DeviceCompositeFloatingLabelEditPartCN.VISUAL_ID:
return new DeviceCompositeFloatingLabelEditPartCN(view);
+
case ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID:
return new ExecutionEnvironmentCompositeEditPartCN(view);
+
case ExecutionEnvironmentCompositeNameEditPartCN.VISUAL_ID:
return new ExecutionEnvironmentCompositeNameEditPartCN(view);
+
case ExecutionEnvironmentCompositeFloatingLabelEditPartCN.VISUAL_ID:
return new ExecutionEnvironmentCompositeFloatingLabelEditPartCN(view);
+
case NodeCompositeEditPartCN.VISUAL_ID:
return new NodeCompositeEditPartCN(view);
+
case NodeCompositeNameEditPartCN.VISUAL_ID:
return new NodeCompositeNameEditPartCN(view);
+
case NodeCompositeFloatingLabelEditPartCN.VISUAL_ID:
return new NodeCompositeFloatingLabelEditPartCN(view);
+
case ClassCompositeEditPartCN.VISUAL_ID:
return new ClassCompositeEditPartCN(view);
+
case ClassCompositeNameEditPartCN.VISUAL_ID:
return new ClassCompositeNameEditPartCN(view);
+
case ClassCompositeFloatingLabelEditPartCN.VISUAL_ID:
return new ClassCompositeFloatingLabelEditPartCN(view);
+
case CollaborationCompositeEditPartCN.VISUAL_ID:
return new CollaborationCompositeEditPartCN(view);
+
case CollaborationCompositeNameEditPartCN.VISUAL_ID:
return new CollaborationCompositeNameEditPartCN(view);
+
case CollaborationCompositeFloatingLabelEditPartCN.VISUAL_ID:
return new CollaborationCompositeFloatingLabelEditPartCN(view);
+
case InterfaceEditPartCN.VISUAL_ID:
return new InterfaceEditPartCN(view);
+
case InterfaceNameEditPartCN.VISUAL_ID:
return new InterfaceNameEditPartCN(view);
+
case InterfaceFloatingLabelEditPartCN.VISUAL_ID:
return new InterfaceFloatingLabelEditPartCN(view);
+
case PrimitiveTypeEditPartCN.VISUAL_ID:
return new PrimitiveTypeEditPartCN(view);
+
case PrimitiveTypeNameEditPartCN.VISUAL_ID:
return new PrimitiveTypeNameEditPartCN(view);
+
case PrimitiveTypeFloatingLabelEditPartCN.VISUAL_ID:
return new PrimitiveTypeFloatingLabelEditPartCN(view);
+
case EnumerationEditPartCN.VISUAL_ID:
return new EnumerationEditPartCN(view);
+
case EnumerationNameEditPartCN.VISUAL_ID:
return new EnumerationNameEditPartCN(view);
+
case EnumerationFloatingLabelEditPartCN.VISUAL_ID:
return new EnumerationFloatingLabelEditPartCN(view);
+
case DataTypeEditPartCN.VISUAL_ID:
return new DataTypeEditPartCN(view);
+
case DataTypeNameEditPartCN.VISUAL_ID:
return new DataTypeNameEditPartCN(view);
+
case DataTypeFloatingLabelEditPartCN.VISUAL_ID:
return new DataTypeFloatingLabelEditPartCN(view);
+
case ActorEditPartCN.VISUAL_ID:
return new ActorEditPartCN(view);
+
case ActorNameEditPartCN.VISUAL_ID:
return new ActorNameEditPartCN(view);
+
case ActorFloatingLabelEditPartCN.VISUAL_ID:
return new ActorFloatingLabelEditPartCN(view);
+
case DeploymentSpecificationEditPartCN.VISUAL_ID:
return new DeploymentSpecificationEditPartCN(view);
+
case DeploymentSpecificationNameEditPartCN.VISUAL_ID:
return new DeploymentSpecificationNameEditPartCN(view);
+
case DeploymentSpecificationFloatingLabelEditPartCN.VISUAL_ID:
return new DeploymentSpecificationFloatingLabelEditPartCN(view);
+
case ArtifactEditPartCN.VISUAL_ID:
return new ArtifactEditPartCN(view);
+
case ArtifactNameEditPartCN.VISUAL_ID:
return new ArtifactNameEditPartCN(view);
+
case ArtifactFloatingLabelEditPartCN.VISUAL_ID:
return new ArtifactFloatingLabelEditPartCN(view);
+
case InformationItemEditPartCN.VISUAL_ID:
return new InformationItemEditPartCN(view);
+
case InformationItemNameEditPartCN.VISUAL_ID:
return new InformationItemNameEditPartCN(view);
+
case InformationItemFloatingLabelEditPartCN.VISUAL_ID:
return new InformationItemFloatingLabelEditPartCN(view);
+
case SignalEditPartCN.VISUAL_ID:
return new SignalEditPartCN(view);
+
case SignalNameEditPartCN.VISUAL_ID:
return new SignalNameEditPartCN(view);
+
case SignalFloatingLabelEditPartCN.VISUAL_ID:
return new SignalFloatingLabelEditPartCN(view);
+
case UseCaseEditPartCN.VISUAL_ID:
return new UseCaseEditPartCN(view);
+
case UseCaseNameEditPartCN.VISUAL_ID:
return new UseCaseNameEditPartCN(view);
+
case UseCaseFloatingLabelEditPartCN.VISUAL_ID:
return new UseCaseFloatingLabelEditPartCN(view);
+
case CommentEditPartCN.VISUAL_ID:
return new CommentEditPartCN(view);
+
case CommentBodyEditPartCN.VISUAL_ID:
return new CommentBodyEditPartCN(view);
+
case DurationConstraintEditPartCN.VISUAL_ID:
return new DurationConstraintEditPartCN(view);
+
case DurationConstraintNameEditPartCN.VISUAL_ID:
return new DurationConstraintNameEditPartCN(view);
+
case DurationConstraintSpecificationEditPartCN.VISUAL_ID:
return new DurationConstraintSpecificationEditPartCN(view);
+
case TimeConstraintEditPartCN.VISUAL_ID:
return new TimeConstraintEditPartCN(view);
+
case TimeConstraintNameEditPartCN.VISUAL_ID:
return new TimeConstraintNameEditPartCN(view);
+
case TimeConstraintSpecificationEditPartCN.VISUAL_ID:
return new TimeConstraintSpecificationEditPartCN(view);
+
case IntervalConstraintEditPartCN.VISUAL_ID:
return new IntervalConstraintEditPartCN(view);
+
case IntervalConstraintNameEditPartCN.VISUAL_ID:
return new IntervalConstraintNameEditPartCN(view);
+
case IntervalConstraintSpecificationEditPartCN.VISUAL_ID:
return new IntervalConstraintSpecificationEditPartCN(view);
+
case InteractionConstraintEditPartCN.VISUAL_ID:
return new InteractionConstraintEditPartCN(view);
+
case InteractionConstraintNameEditPartCN.VISUAL_ID:
return new InteractionConstraintNameEditPartCN(view);
+
case InteractionConstraintSpecificationEditPartCN.VISUAL_ID:
return new InteractionConstraintSpecificationEditPartCN(view);
+
case ConstraintEditPartCN.VISUAL_ID:
return new ConstraintEditPartCN(view);
+
case ConstraintNameEditPartCN.VISUAL_ID:
return new ConstraintNameEditPartCN(view);
+
case ConstraintSpecificationEditPartCN.VISUAL_ID:
return new ConstraintSpecificationEditPartCN(view);
+
case PropertyEditPartCLN.VISUAL_ID:
return new PropertyEditPartCLN(view);
+
case OperationEditPartCLN.VISUAL_ID:
return new OperationEditPartCLN(view);
+
case EnumerationLiteralEditPartCLN.VISUAL_ID:
return new EnumerationLiteralEditPartCLN(view);
+
case DataTypeAttributeCompartmentEditPart.VISUAL_ID:
return new DataTypeAttributeCompartmentEditPart(view);
+
case DataTypeOperationCompartmentEditPart.VISUAL_ID:
return new DataTypeOperationCompartmentEditPart(view);
+
case DataTypeAttributeCompartmentEditPartCN.VISUAL_ID:
return new DataTypeAttributeCompartmentEditPartCN(view);
+
case DataTypeOperationCompartmentEditPartCN.VISUAL_ID:
return new DataTypeOperationCompartmentEditPartCN(view);
+
case EnumerationEnumerationLiteralCompartmentEditPart.VISUAL_ID:
return new EnumerationEnumerationLiteralCompartmentEditPart(view);
+
case EnumerationEnumerationLiteralCompartmentEditPartCN.VISUAL_ID:
return new EnumerationEnumerationLiteralCompartmentEditPartCN(view);
+
case ActivityCompositeCompartmentEditPartCN.VISUAL_ID:
return new ActivityCompositeCompartmentEditPartCN(view);
+
case InteractionCompositeCompartmentEditPartCN.VISUAL_ID:
return new InteractionCompositeCompartmentEditPartCN(view);
+
case ProtocolStateMachineCompositeCompartmentEditPartCN.VISUAL_ID:
return new ProtocolStateMachineCompositeCompartmentEditPartCN(view);
+
case StateMachineCompositeCompartmentEditPartCN.VISUAL_ID:
return new StateMachineCompositeCompartmentEditPartCN(view);
+
case FunctionBehaviorCompositeCompartmentEditPartCN.VISUAL_ID:
return new FunctionBehaviorCompositeCompartmentEditPartCN(view);
+
case OpaqueBehaviorCompositeCompartmentEditPartCN.VISUAL_ID:
return new OpaqueBehaviorCompositeCompartmentEditPartCN(view);
+
case ComponentCompositeCompartmentEditPartCN.VISUAL_ID:
return new ComponentCompositeCompartmentEditPartCN(view);
+
case DeviceCompositeCompartmentEditPartCN.VISUAL_ID:
return new DeviceCompositeCompartmentEditPartCN(view);
+
case ExecutionEnvironmentCompositeCompartmentEditPartCN.VISUAL_ID:
return new ExecutionEnvironmentCompositeCompartmentEditPartCN(view);
+
case NodeCompositeCompartmentEditPartCN.VISUAL_ID:
return new NodeCompositeCompartmentEditPartCN(view);
+
case ClassCompositeCompartmentEditPartCN.VISUAL_ID:
return new ClassCompositeCompartmentEditPartCN(view);
+
case CollaborationCompositeCompartmentEditPartCN.VISUAL_ID:
return new CollaborationCompositeCompartmentEditPartCN(view);
+
case ActivityCompositeCompartmentEditPart.VISUAL_ID:
return new ActivityCompositeCompartmentEditPart(view);
+
case InteractionCompositeCompartmentEditPart.VISUAL_ID:
return new InteractionCompositeCompartmentEditPart(view);
+
case ProtocolStateMachineCompositeCompartmentEditPart.VISUAL_ID:
return new ProtocolStateMachineCompositeCompartmentEditPart(view);
+
case StateMachineCompositeCompartmentEditPart.VISUAL_ID:
return new StateMachineCompositeCompartmentEditPart(view);
+
case FunctionBehaviorCompositeCompartmentEditPart.VISUAL_ID:
return new FunctionBehaviorCompositeCompartmentEditPart(view);
+
case OpaqueBehaviorCompositeCompartmentEditPart.VISUAL_ID:
return new OpaqueBehaviorCompositeCompartmentEditPart(view);
+
case ComponentCompositeCompartmentEditPart.VISUAL_ID:
return new ComponentCompositeCompartmentEditPart(view);
+
case DeviceCompositeCompartmentEditPart.VISUAL_ID:
return new DeviceCompositeCompartmentEditPart(view);
+
case ExecutionEnvironmentCompositeCompartmentEditPart.VISUAL_ID:
return new ExecutionEnvironmentCompositeCompartmentEditPart(view);
+
case NodeCompositeCompartmentEditPart.VISUAL_ID:
return new NodeCompositeCompartmentEditPart(view);
+
case ClassCompositeCompartmentEditPart.VISUAL_ID:
return new ClassCompositeCompartmentEditPart(view);
+
case CollaborationCompositeCompartmentEditPart.VISUAL_ID:
return new CollaborationCompositeCompartmentEditPart(view);
+
case PropertyPartCompartmentEditPartCN.VISUAL_ID:
return new PropertyPartCompartmentEditPartCN(view);
+
case BehaviorPortLinkEditPart.VISUAL_ID:
return new BehaviorPortLinkEditPart(view);
+
+
case LinkDescriptorEditPart.VISUAL_ID:
return new LinkDescriptorEditPart(view);
+
+
case CommentAnnotatedElementEditPart.VISUAL_ID:
return new CommentAnnotatedElementEditPart(view);
+
+
case ConstraintConstrainedElementEditPart.VISUAL_ID:
return new ConstraintConstrainedElementEditPart(view);
+
+
case ComponentRealizationEditPart.VISUAL_ID:
return new ComponentRealizationEditPart(view);
+
case ComponentRealizationNameEditPart.VISUAL_ID:
return new ComponentRealizationNameEditPart(view);
+
case ComponentRealizationAppliedStereotypeEditPart.VISUAL_ID:
return new ComponentRealizationAppliedStereotypeEditPart(view);
+
+
case InterfaceRealizationEditPart.VISUAL_ID:
return new InterfaceRealizationEditPart(view);
+
case InterfaceRealizationNameEditPart.VISUAL_ID:
return new InterfaceRealizationNameEditPart(view);
+
case InterfaceRealizationAppliedStereotypeEditPart.VISUAL_ID:
return new InterfaceRealizationAppliedStereotypeEditPart(view);
+
+
case SubstitutionEditPart.VISUAL_ID:
return new SubstitutionEditPart(view);
+
case SubstitutionNameEditPart.VISUAL_ID:
return new SubstitutionNameEditPart(view);
+
case SubstitutionAppliedStereotypeEditPart.VISUAL_ID:
return new SubstitutionAppliedStereotypeEditPart(view);
+
+
case RealizationEditPart.VISUAL_ID:
return new RealizationEditPart(view);
+
case RealizationNameEditPart.VISUAL_ID:
return new RealizationNameEditPart(view);
+
case RealizationAppliedStereotypeEditPart.VISUAL_ID:
return new RealizationAppliedStereotypeEditPart(view);
+
+
case ManifestationEditPart.VISUAL_ID:
return new ManifestationEditPart(view);
+
case ManifestationNameEditPart.VISUAL_ID:
return new ManifestationNameEditPart(view);
+
case ManifestationAppliedStereotypeEditPart.VISUAL_ID:
return new ManifestationAppliedStereotypeEditPart(view);
+
+
case AbstractionEditPart.VISUAL_ID:
return new AbstractionEditPart(view);
+
case AbstractionNameEditPart.VISUAL_ID:
return new AbstractionNameEditPart(view);
+
case AbstractionAppliedStereotypeEditPart.VISUAL_ID:
return new AbstractionAppliedStereotypeEditPart(view);
+
+
case UsageEditPart.VISUAL_ID:
return new UsageEditPart(view);
+
case UsageNameEditPart.VISUAL_ID:
return new UsageNameEditPart(view);
+
case UsageAppliedStereotypeEditPart.VISUAL_ID:
return new UsageAppliedStereotypeEditPart(view);
+
+
case DeploymentEditPart.VISUAL_ID:
return new DeploymentEditPart(view);
+
case DeploymentNameEditPart.VISUAL_ID:
return new DeploymentNameEditPart(view);
+
case DeploymentAppliedStereotypeEditPart.VISUAL_ID:
return new DeploymentAppliedStereotypeEditPart(view);
+
+
case RoleBindingEditPart.VISUAL_ID:
return new RoleBindingEditPart(view);
+
case RoleBindingRoleNameEditPart.VISUAL_ID:
return new RoleBindingRoleNameEditPart(view);
+
case RoleBindingAppliedStereotypeEditPart.VISUAL_ID:
return new RoleBindingAppliedStereotypeEditPart(view);
+
+
case DependencyEditPart.VISUAL_ID:
return new DependencyEditPart(view);
+
case DependencyNameEditPart.VISUAL_ID:
return new DependencyNameEditPart(view);
+
case DependencyAppliedStereotypeEditPart.VISUAL_ID:
return new DependencyAppliedStereotypeEditPart(view);
+
+
case ConnectorEditPart.VISUAL_ID:
return new ConnectorEditPart(view);
+
case ConnectorAppliedStereotypeEditPart.VISUAL_ID:
return new ConnectorAppliedStereotypeEditPart(view);
+
case ConnectorNameEditPart.VISUAL_ID:
return new ConnectorNameEditPart(view);
+
case ConnectorMultiplicitySourceEditPart.VISUAL_ID:
return new ConnectorMultiplicitySourceEditPart(view);
+
case ConnectorMultiplicityTargetEditPart.VISUAL_ID:
return new ConnectorMultiplicityTargetEditPart(view);
+
+
case GeneralizationEditPart.VISUAL_ID:
return new GeneralizationEditPart(view);
+
case GeneralizationAppliedStereotypeEditPart.VISUAL_ID:
return new GeneralizationAppliedStereotypeEditPart(view);
+
+
case TimeObservationEventEditPart.VISUAL_ID:
return new TimeObservationEventEditPart(view);
+
+
case DurationObservationEventEditPart.VISUAL_ID:
return new DurationObservationEventEditPart(view);
+
+
case RepresentationEditPart.VISUAL_ID:
return new RepresentationEditPart(view);
+
case RepresentationTagLabelEditPart.VISUAL_ID:
return new RepresentationTagLabelEditPart(view);
+
+
case InformationFlowEditPart.VISUAL_ID:
return new InformationFlowEditPart(view);
+
case InformationFlowConveyedLabelEditPart.VISUAL_ID:
return new InformationFlowConveyedLabelEditPart(view);
+
case InformationFlowAppliedStereotypeEditPart.VISUAL_ID:
return new InformationFlowAppliedStereotypeEditPart(view);
+
}
}
return createUnrecognizedEditPart(context, model);
@@ -712,10 +1061,12 @@ public class UMLEditPartFactory implements EditPartFactory {
* @generated
*/
public static CellEditorLocator getTextCellEditorLocator(ITextAwareEditPart source) {
- if(source.getFigure() instanceof IMultilineEditableFigure) {
- return new MultilineCellEditorLocator((IMultilineEditableFigure)source.getFigure());
+ if (source.getFigure() instanceof IMultilineEditableFigure) {
+ return new MultilineCellEditorLocator(
+ (IMultilineEditableFigure) source.getFigure());
} else {
return CellEditorLocatorAccess.INSTANCE.getTextCellEditorLocator(source);
+
}
}
@@ -747,15 +1098,16 @@ public class UMLEditPartFactory implements EditPartFactory {
* @generated
*/
public void relocate(CellEditor celleditor) {
- Text text = (Text)celleditor.getControl();
+ 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 (getMultilineEditableFigure().getText().length() > 0) {
+ rect.setSize(new Dimension(text.computeSize(rect.width,
+ SWT.DEFAULT)));
}
- if(!rect.equals(new Rectangle(text.getBounds()))) {
+ if (!rect.equals(new Rectangle(text.getBounds()))) {
text.setBounds(rect.x, rect.y, rect.width, rect.height);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UsageAppliedStereotypeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UsageAppliedStereotypeEditPart.java
index 022e39578d6..6aa78599e89 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UsageAppliedStereotypeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UsageAppliedStereotypeEditPart.java
@@ -123,6 +123,7 @@ public class UsageAppliedStereotypeEditPart extends PapyrusLabelEditPart impleme
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -211,8 +212,7 @@ public class UsageAppliedStereotypeEditPart extends PapyrusLabelEditPart impleme
/**
* @generated
*/
- public void setLabel(IFigure
- figure) {
+ public void setLabel(IFigure figure) {
unregisterVisuals();
setFigure(figure);
defaultText = getLabelTextHelper(figure);
@@ -324,15 +324,14 @@ public class UsageAppliedStereotypeEditPart extends PapyrusLabelEditPart impleme
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid =
- (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
@@ -461,8 +460,7 @@ public class UsageAppliedStereotypeEditPart extends PapyrusLabelEditPart impleme
IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- }
- else if (configuration instanceof IAdvancedEditorConfiguration) {
+ } 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);
@@ -507,8 +505,7 @@ public class UsageAppliedStereotypeEditPart extends PapyrusLabelEditPart impleme
RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- }
- else {
+ } else {
performDirectEdit();
}
}
@@ -558,17 +555,15 @@ public class UsageAppliedStereotypeEditPart extends PapyrusLabelEditPart impleme
* @generated
*/
protected void refreshUnderline() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
if (resolveSemanticElement() instanceof Feature) {
if (((Feature) resolveSemanticElement()).isStatic()) {
((WrappingLabel) getFigure()).setTextUnderline(true);
- }
- else {
+ } else {
((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
@@ -578,9 +573,8 @@ public class UsageAppliedStereotypeEditPart extends PapyrusLabelEditPart impleme
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
@@ -591,14 +585,12 @@ public class UsageAppliedStereotypeEditPart extends PapyrusLabelEditPart impleme
*/
@Override
protected void refreshFont() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ 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));
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -684,7 +676,7 @@ public class UsageAppliedStereotypeEditPart extends PapyrusLabelEditPart impleme
*/
protected boolean checkExtendedEditor() {
if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -708,9 +700,9 @@ public class UsageAppliedStereotypeEditPart extends PapyrusLabelEditPart impleme
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());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
@@ -724,8 +716,7 @@ public class UsageAppliedStereotypeEditPart extends PapyrusLabelEditPart impleme
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement()
- .eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
@@ -777,18 +768,15 @@ public class UsageAppliedStereotypeEditPart extends PapyrusLabelEditPart impleme
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)) {
+ } 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();
+ ISemanticParser modelParser = (ISemanticParser) getParser();
if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
if (resolveSemanticElement() != null) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UsageEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UsageEditPart.java
index c2484e92573..57bb33d4f2d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UsageEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UsageEditPart.java
@@ -52,10 +52,12 @@ public class UsageEditPart extends UMLConnectionNodeEditPart implements ITreeBra
*/
protected boolean addFixedChild(EditPart childEditPart) {
if (childEditPart instanceof UsageNameEditPart) {
- ((UsageNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ ((UsageNameEditPart) childEditPart).setLabel(
+ getPrimaryShape().getNameLabel());
}
if (childEditPart instanceof UsageAppliedStereotypeEditPart) {
- ((UsageAppliedStereotypeEditPart) childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
+ ((UsageAppliedStereotypeEditPart) childEditPart).setLabel(
+ getPrimaryShape().getAppliedStereotypeLabel());
}
return false;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UsageNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UsageNameEditPart.java
index 0ed751cd5b2..e18fb2de143 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UsageNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UsageNameEditPart.java
@@ -123,6 +123,7 @@ public class UsageNameEditPart extends PapyrusLabelEditPart implements ITextAwar
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -211,8 +212,7 @@ public class UsageNameEditPart extends PapyrusLabelEditPart implements ITextAwar
/**
* @generated
*/
- public void setLabel(IFigure
- figure) {
+ public void setLabel(IFigure figure) {
unregisterVisuals();
setFigure(figure);
defaultText = getLabelTextHelper(figure);
@@ -324,15 +324,14 @@ public class UsageNameEditPart extends PapyrusLabelEditPart implements ITextAwar
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid =
- (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
- }
- });
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
+ }
+ });
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
ie.printStackTrace();
@@ -461,8 +460,7 @@ public class UsageNameEditPart extends PapyrusLabelEditPart implements ITextAwar
IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- }
- else if (configuration instanceof IAdvancedEditorConfiguration) {
+ } 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);
@@ -507,8 +505,7 @@ public class UsageNameEditPart extends PapyrusLabelEditPart implements ITextAwar
RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- }
- else {
+ } else {
performDirectEdit();
}
}
@@ -558,17 +555,15 @@ public class UsageNameEditPart extends PapyrusLabelEditPart implements ITextAwar
* @generated
*/
protected void refreshUnderline() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
if (resolveSemanticElement() instanceof Feature) {
if (((Feature) resolveSemanticElement()).isStatic()) {
((WrappingLabel) getFigure()).setTextUnderline(true);
- }
- else {
+ } else {
((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
@@ -578,9 +573,8 @@ public class UsageNameEditPart extends PapyrusLabelEditPart implements ITextAwar
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
@@ -591,14 +585,12 @@ public class UsageNameEditPart extends PapyrusLabelEditPart implements ITextAwar
*/
@Override
protected void refreshFont() {
- FontStyle style =
- (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
+ 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));
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -692,7 +684,7 @@ public class UsageNameEditPart extends PapyrusLabelEditPart implements ITextAwar
*/
protected boolean checkExtendedEditor() {
if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -716,9 +708,9 @@ public class UsageNameEditPart extends PapyrusLabelEditPart implements ITextAwar
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());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
@@ -732,8 +724,7 @@ public class UsageNameEditPart extends PapyrusLabelEditPart implements ITextAwar
String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement()
- .eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
@@ -785,18 +776,15 @@ public class UsageNameEditPart extends PapyrusLabelEditPart implements ITextAwar
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)) {
+ } 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();
+ ISemanticParser modelParser = (ISemanticParser) getParser();
if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
if (resolveSemanticElement() != null) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UseCaseEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UseCaseEditPart.java
index 105bef09ecd..a299a534a0e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UseCaseEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UseCaseEditPart.java
@@ -84,7 +84,9 @@ public class UseCaseEditPart extends RoundedCompartmentEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
@@ -101,21 +103,21 @@ public class UseCaseEditPart extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case UseCaseFloatingLabelEditPart.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -135,8 +137,9 @@ public class UseCaseEditPart extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -154,6 +157,7 @@ public class UseCaseEditPart extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -165,20 +169,23 @@ public class UseCaseEditPart extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure
+ *
* @generated
*/
public RoundedCompartmentFigure getPrimaryShape() {
- return (RoundedCompartmentFigure)primaryShape;
+ return (RoundedCompartmentFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof UseCaseNameEditPart) {
- ((UseCaseNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof UseCaseNameEditPart) {
+ ((UseCaseNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
+
+
return false;
}
@@ -186,7 +193,7 @@ public class UseCaseEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof UseCaseNameEditPart) {
+ if (childEditPart instanceof UseCaseNameEditPart) {
return true;
}
return false;
@@ -196,7 +203,7 @@ public class UseCaseEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -206,7 +213,7 @@ public class UseCaseEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -216,7 +223,7 @@ public class UseCaseEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -226,7 +233,7 @@ public class UseCaseEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof UseCaseFloatingLabelEditPart) {
+ if (borderItemEditPart instanceof UseCaseFloatingLabelEditPart) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -249,16 +256,19 @@ public class UseCaseEditPart extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -270,7 +280,7 @@ public class UseCaseEditPart extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -280,7 +290,7 @@ public class UseCaseEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -296,8 +306,8 @@ public class UseCaseEditPart extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UseCaseEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UseCaseEditPartCN.java
index 91e9ba430dd..74c6818f36d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UseCaseEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UseCaseEditPartCN.java
@@ -84,7 +84,9 @@ public class UseCaseEditPartCN extends RoundedCompartmentEditPart {
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+
installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
@@ -101,21 +103,21 @@ public class UseCaseEditPartCN extends RoundedCompartmentEditPart {
@Override
protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(UMLVisualIDRegistry.getVisualID(childView)) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
case UseCaseFloatingLabelEditPartCN.VISUAL_ID:
return new BorderItemSelectionEditPolicy() {
@Override
protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
mh.setBorder(null);
return Collections.singletonList(mh);
}
};
}
EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
+ if (result == null) {
result = new NonResizableEditPolicy();
}
return result;
@@ -135,8 +137,9 @@ public class UseCaseEditPartCN extends RoundedCompartmentEditPart {
}
/**
- *Papyrus codeGen
- *@generated
+ * Papyrus codeGen
+ *
+ * @generated
**/
protected void handleNotificationEvent(Notification event) {
/*
@@ -154,6 +157,7 @@ public class UseCaseEditPartCN extends RoundedCompartmentEditPart {
}
}
super.handleNotificationEvent(event);
+
}
/**
@@ -165,20 +169,23 @@ public class UseCaseEditPartCN extends RoundedCompartmentEditPart {
/**
* org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure
+ *
* @generated
*/
public RoundedCompartmentFigure getPrimaryShape() {
- return (RoundedCompartmentFigure)primaryShape;
+ return (RoundedCompartmentFigure) primaryShape;
}
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof UseCaseNameEditPartCN) {
- ((UseCaseNameEditPartCN)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ if (childEditPart instanceof UseCaseNameEditPartCN) {
+ ((UseCaseNameEditPartCN) childEditPart).setLabel(getPrimaryShape().getNameLabel());
return true;
}
+
+
return false;
}
@@ -186,7 +193,7 @@ public class UseCaseEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof UseCaseNameEditPartCN) {
+ if (childEditPart instanceof UseCaseNameEditPartCN) {
return true;
}
return false;
@@ -196,7 +203,7 @@ public class UseCaseEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
+ if (addFixedChild(childEditPart)) {
return;
}
super.addChildVisual(childEditPart, -1);
@@ -206,7 +213,7 @@ public class UseCaseEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
+ if (removeFixedChild(childEditPart)) {
return;
}
super.removeChildVisual(childEditPart);
@@ -216,7 +223,7 @@ public class UseCaseEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if(editPart instanceof IBorderItemEditPart) {
+ if (editPart instanceof IBorderItemEditPart) {
return getBorderedFigure().getBorderItemContainer();
}
return getContentPane();
@@ -226,7 +233,7 @@ public class UseCaseEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof UseCaseFloatingLabelEditPartCN) {
+ if (borderItemEditPart instanceof UseCaseFloatingLabelEditPartCN) {
IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
} else {
@@ -249,16 +256,19 @@ public class UseCaseEditPartCN extends RoundedCompartmentEditPart {
*/
protected NodeFigure createMainFigure() {
return new SelectableBorderedNodeFigure(createMainFigureWithSVG());
+
}
/**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
- * @param nodeShape instance of generated figure class
+ *
+ * @param nodeShape
+ * instance of generated figure class
* @generated
*/
protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
+ if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
@@ -270,7 +280,7 @@ public class UseCaseEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
public IFigure getContentPane() {
- if(contentPane != null) {
+ if (contentPane != null) {
return contentPane;
}
return super.getContentPane();
@@ -280,7 +290,7 @@ public class UseCaseEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
+ if (primaryShape != null) {
primaryShape.setForegroundColor(color);
}
}
@@ -296,8 +306,8 @@ public class UseCaseEditPartCN extends RoundedCompartmentEditPart {
* @generated
*/
protected void setLineType(int style) {
- if(primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure)primaryShape).setLineStyle(style);
+ if (primaryShape instanceof IPapyrusNodeFigure) {
+ ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UseCaseFloatingLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UseCaseFloatingLabelEditPart.java
index 1346b487d84..4d399968cb8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UseCaseFloatingLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UseCaseFloatingLabelEditPart.java
@@ -113,15 +113,18 @@ public class UseCaseFloatingLabelEditPart extends FloatingLabelEditPart implemen
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class UseCaseFloatingLabelEditPart extends FloatingLabelEditPart implemen
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class UseCaseFloatingLabelEditPart extends FloatingLabelEditPart implemen
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class UseCaseFloatingLabelEditPart extends FloatingLabelEditPart implemen
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class UseCaseFloatingLabelEditPart extends FloatingLabelEditPart implemen
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class UseCaseFloatingLabelEditPart extends FloatingLabelEditPart implemen
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class UseCaseFloatingLabelEditPart extends FloatingLabelEditPart implemen
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class UseCaseFloatingLabelEditPart extends FloatingLabelEditPart implemen
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class UseCaseFloatingLabelEditPart extends FloatingLabelEditPart implemen
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class UseCaseFloatingLabelEditPart extends FloatingLabelEditPart implemen
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class UseCaseFloatingLabelEditPart extends FloatingLabelEditPart implemen
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class UseCaseFloatingLabelEditPart extends FloatingLabelEditPart implemen
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class UseCaseFloatingLabelEditPart extends FloatingLabelEditPart implemen
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class UseCaseFloatingLabelEditPart extends FloatingLabelEditPart implemen
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.UseCase_2082, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.UseCaseFloatingLabelEditPart.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class UseCaseFloatingLabelEditPart extends FloatingLabelEditPart implemen
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class UseCaseFloatingLabelEditPart extends FloatingLabelEditPart implemen
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class UseCaseFloatingLabelEditPart extends FloatingLabelEditPart implemen
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class UseCaseFloatingLabelEditPart extends FloatingLabelEditPart implemen
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class UseCaseFloatingLabelEditPart extends FloatingLabelEditPart implemen
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class UseCaseFloatingLabelEditPart extends FloatingLabelEditPart implemen
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class UseCaseFloatingLabelEditPart extends FloatingLabelEditPart implemen
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class UseCaseFloatingLabelEditPart extends FloatingLabelEditPart implemen
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class UseCaseFloatingLabelEditPart extends FloatingLabelEditPart implemen
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class UseCaseFloatingLabelEditPart extends FloatingLabelEditPart implemen
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class UseCaseFloatingLabelEditPart extends FloatingLabelEditPart implemen
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class UseCaseFloatingLabelEditPart extends FloatingLabelEditPart implemen
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class UseCaseFloatingLabelEditPart extends FloatingLabelEditPart implemen
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class UseCaseFloatingLabelEditPart extends FloatingLabelEditPart implemen
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class UseCaseFloatingLabelEditPart extends FloatingLabelEditPart implemen
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class UseCaseFloatingLabelEditPart extends FloatingLabelEditPart implemen
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class UseCaseFloatingLabelEditPart extends FloatingLabelEditPart implemen
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class UseCaseFloatingLabelEditPart extends FloatingLabelEditPart implemen
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UseCaseFloatingLabelEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UseCaseFloatingLabelEditPartCN.java
index 4efca2bba6d..de8ba3a8994 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UseCaseFloatingLabelEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UseCaseFloatingLabelEditPartCN.java
@@ -113,15 +113,18 @@ public class UseCaseFloatingLabelEditPartCN extends FloatingLabelEditPart implem
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
+
/**
* @generated
*/
@@ -151,9 +154,9 @@ public class UseCaseFloatingLabelEditPartCN extends FloatingLabelEditPart implem
*/
public IBorderItemLocator getBorderItemLocator() {
IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
+ return (IBorderItemLocator) constraint;
}
return null;
}
@@ -162,10 +165,10 @@ public class UseCaseFloatingLabelEditPartCN extends FloatingLabelEditPart implem
* @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();
+ 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));
}
@@ -173,12 +176,12 @@ public class UseCaseFloatingLabelEditPartCN extends FloatingLabelEditPart implem
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -186,12 +189,12 @@ public class UseCaseFloatingLabelEditPartCN extends FloatingLabelEditPart implem
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -199,12 +202,12 @@ public class UseCaseFloatingLabelEditPartCN extends FloatingLabelEditPart implem
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -212,12 +215,12 @@ public class UseCaseFloatingLabelEditPartCN extends FloatingLabelEditPart implem
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -273,10 +276,12 @@ public class UseCaseFloatingLabelEditPartCN extends FloatingLabelEditPart implem
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -288,12 +293,12 @@ public class UseCaseFloatingLabelEditPartCN extends FloatingLabelEditPart implem
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -301,10 +306,12 @@ public class UseCaseFloatingLabelEditPartCN extends FloatingLabelEditPart implem
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -322,15 +329,16 @@ public class UseCaseFloatingLabelEditPartCN extends FloatingLabelEditPart implem
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -338,6 +346,7 @@ public class UseCaseFloatingLabelEditPartCN extends FloatingLabelEditPart implem
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -348,7 +357,7 @@ public class UseCaseFloatingLabelEditPartCN extends FloatingLabelEditPart implem
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -365,7 +374,7 @@ public class UseCaseFloatingLabelEditPartCN extends FloatingLabelEditPart implem
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.UseCase_3096, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.UseCaseFloatingLabelEditPartCN.VISUAL_ID));
}
return parser;
@@ -375,8 +384,10 @@ public class UseCaseFloatingLabelEditPartCN extends FloatingLabelEditPart implem
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -405,8 +416,8 @@ public class UseCaseFloatingLabelEditPartCN extends FloatingLabelEditPart implem
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -414,8 +425,8 @@ public class UseCaseFloatingLabelEditPartCN extends FloatingLabelEditPart implem
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -425,46 +436,52 @@ public class UseCaseFloatingLabelEditPartCN extends FloatingLabelEditPart implem
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -486,12 +503,12 @@ public class UseCaseFloatingLabelEditPartCN extends FloatingLabelEditPart implem
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -521,12 +538,12 @@ public class UseCaseFloatingLabelEditPartCN extends FloatingLabelEditPart implem
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -535,12 +552,12 @@ public class UseCaseFloatingLabelEditPartCN extends FloatingLabelEditPart implem
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -548,15 +565,16 @@ public class UseCaseFloatingLabelEditPartCN extends FloatingLabelEditPart implem
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -565,9 +583,10 @@ public class UseCaseFloatingLabelEditPartCN extends FloatingLabelEditPart implem
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -575,9 +594,12 @@ public class UseCaseFloatingLabelEditPartCN extends FloatingLabelEditPart implem
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -593,11 +615,11 @@ public class UseCaseFloatingLabelEditPartCN extends FloatingLabelEditPart implem
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -608,8 +630,8 @@ public class UseCaseFloatingLabelEditPartCN extends FloatingLabelEditPart implem
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -621,7 +643,7 @@ public class UseCaseFloatingLabelEditPartCN extends FloatingLabelEditPart implem
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -647,13 +669,14 @@ public class UseCaseFloatingLabelEditPartCN extends FloatingLabelEditPart implem
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -665,8 +688,8 @@ public class UseCaseFloatingLabelEditPartCN extends FloatingLabelEditPart implem
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -683,35 +706,40 @@ public class UseCaseFloatingLabelEditPartCN extends FloatingLabelEditPart implem
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -721,12 +749,13 @@ public class UseCaseFloatingLabelEditPartCN extends FloatingLabelEditPart implem
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -744,24 +773,25 @@ public class UseCaseFloatingLabelEditPartCN extends FloatingLabelEditPart implem
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UseCaseNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UseCaseNameEditPart.java
index 6adc88ca2c7..d07f6a1f0b9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UseCaseNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UseCaseNameEditPart.java
@@ -114,12 +114,14 @@ public class UseCaseNameEditPart extends PapyrusCompartmentEditPart implements I
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class UseCaseNameEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class UseCaseNameEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class UseCaseNameEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class UseCaseNameEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class UseCaseNameEditPart extends PapyrusCompartmentEditPart implements I
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class UseCaseNameEditPart extends PapyrusCompartmentEditPart implements I
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class UseCaseNameEditPart extends PapyrusCompartmentEditPart implements I
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class UseCaseNameEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class UseCaseNameEditPart extends PapyrusCompartmentEditPart implements I
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class UseCaseNameEditPart extends PapyrusCompartmentEditPart implements I
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class UseCaseNameEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class UseCaseNameEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.UseCase_2082, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.UseCaseNameEditPart.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class UseCaseNameEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class UseCaseNameEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class UseCaseNameEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class UseCaseNameEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class UseCaseNameEditPart extends PapyrusCompartmentEditPart implements I
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class UseCaseNameEditPart extends PapyrusCompartmentEditPart implements I
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class UseCaseNameEditPart extends PapyrusCompartmentEditPart implements I
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class UseCaseNameEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class UseCaseNameEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class UseCaseNameEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class UseCaseNameEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class UseCaseNameEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class UseCaseNameEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class UseCaseNameEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class UseCaseNameEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class UseCaseNameEditPart extends PapyrusCompartmentEditPart implements I
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class UseCaseNameEditPart extends PapyrusCompartmentEditPart implements I
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class UseCaseNameEditPart extends PapyrusCompartmentEditPart implements I
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class UseCaseNameEditPart extends PapyrusCompartmentEditPart implements I
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class UseCaseNameEditPart extends PapyrusCompartmentEditPart implements I
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class UseCaseNameEditPart extends PapyrusCompartmentEditPart implements I
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UseCaseNameEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UseCaseNameEditPartCN.java
index 4ab2069e098..adfba2ab07e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UseCaseNameEditPartCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/UseCaseNameEditPartCN.java
@@ -114,12 +114,14 @@ public class UseCaseNameEditPartCN extends PapyrusCompartmentEditPart implements
/**
* direct edition mode (default, undefined, registered editor, etc.)
+ *
* @generated
*/
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
/**
* configuration from a registered edit dialog
+ *
* @generated
*/
protected IDirectEditorConfiguration configuration;
@@ -145,12 +147,12 @@ public class UseCaseNameEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
} else {
- return ((Label)figure).getText();
+ return ((Label) figure).getText();
}
}
@@ -158,12 +160,12 @@ public class UseCaseNameEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setText(text);
} else {
- ((Label)figure).setText(text);
+ ((Label) figure).setText(text);
}
}
@@ -171,12 +173,12 @@ public class UseCaseNameEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
} else {
- return ((Label)figure).getIcon();
+ return ((Label) figure).getIcon();
}
}
@@ -184,12 +186,12 @@ public class UseCaseNameEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else if (figure instanceof ILabelFigure) {
+ ((ILabelFigure) figure).setIcon(icon);
} else {
- ((Label)figure).setIcon(icon);
+ ((Label) figure).setIcon(icon);
}
}
@@ -237,12 +239,12 @@ public class UseCaseNameEditPartCN extends PapyrusCompartmentEditPart implements
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
- if(parserElement == null) {
+ if (parserElement == null) {
return null;
}
List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(AppearanceHelper.showElementIcon(view)) {
+ for (View view : views) {
+ if (AppearanceHelper.showElementIcon(view)) {
return UMLElementTypes.getImage(parserElement.eClass());
}
}
@@ -255,10 +257,12 @@ public class UseCaseNameEditPartCN extends PapyrusCompartmentEditPart implements
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
- if(text == null || text.length() == 0) {
+ if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
@@ -270,12 +274,12 @@ public class UseCaseNameEditPartCN extends PapyrusCompartmentEditPart implements
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -283,10 +287,12 @@ public class UseCaseNameEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -304,15 +310,16 @@ public class UseCaseNameEditPartCN extends PapyrusCompartmentEditPart implements
@Override
public String isValid(final Object value) {
- if(value instanceof String) {
+ if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
- IParserEditStatus valid = (IParserEditStatus)getEditingDomain().runExclusive(new RunnableWithResult.Impl<java.lang.Object>() {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
@Override
public void run() {
- setResult(parser.isValidEditString(new EObjectAdapter(element), (String)value));
+ setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
@@ -320,6 +327,7 @@ public class UseCaseNameEditPartCN extends PapyrusCompartmentEditPart implements
ie.printStackTrace();
}
}
+
// shouldn't get here
return null;
}
@@ -330,7 +338,7 @@ public class UseCaseNameEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
+ if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
@@ -347,7 +355,7 @@ public class UseCaseNameEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
public IParser getParser() {
- if(parser == null) {
+ if (parser == null) {
parser = UMLParserProvider.getParser(UMLElementTypes.UseCase_3096, getParserElement(), UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.composite.edit.parts.UseCaseNameEditPartCN.VISUAL_ID));
}
return parser;
@@ -357,8 +365,10 @@ public class UseCaseNameEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
}
return manager;
}
@@ -387,8 +397,8 @@ public class UseCaseNameEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -396,8 +406,8 @@ public class UseCaseNameEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -407,46 +417,52 @@ public class UseCaseNameEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void performDirectEditRequest(Request request) {
+
final Request theRequest = request;
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
- switch(directEditionMode) {
+ switch (directEditionMode) {
case IDirectEdition.NO_DIRECT_EDITION:
// no direct edition mode => does nothing
return;
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
+ if (configuration == null || configuration.getLanguage() == null) {
// Create default edit manager
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), UMLEditPartFactory.getTextCellEditorLocator(this)));
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if(configuration instanceof ICustomDirectEditorConfiguration) {
- setManager(((ICustomDirectEditorConfiguration)configuration).createDirectEditManager(this));
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
initializeDirectEditManager(theRequest);
return;
- } else if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
final Dialog finalDialog = dialog;
- if(Window.OK == dialog.open()) {
+
+ if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@Override
protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -468,12 +484,12 @@ public class UseCaseNameEditPartCN extends PapyrusCompartmentEditPart implements
// initialize the direct edit manager
try {
getEditingDomain().runExclusive(new Runnable() {
-
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else {
performDirectEdit();
@@ -503,12 +519,12 @@ public class UseCaseNameEditPartCN extends PapyrusCompartmentEditPart implements
*/
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
+ if (maskLabelPolicy == null) {
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
- if(maskLabelPolicy == null) {
- View view = (View)getModel();
- if(view.isVisible()) {
+ if (maskLabelPolicy == null) {
+ View view = (View) getModel();
+ if (view.isVisible()) {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
} else {
@@ -517,12 +533,12 @@ public class UseCaseNameEditPartCN extends PapyrusCompartmentEditPart implements
}
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
}
}
@@ -530,15 +546,16 @@ public class UseCaseNameEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- if(resolveSemanticElement() instanceof Feature) {
- if(((Feature)resolveSemanticElement()).isStatic()) {
- ((WrappingLabel)getFigure()).setTextUnderline(true);
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
} else {
- ((WrappingLabel)getFigure()).setTextUnderline(false);
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
}
}
}
@@ -547,9 +564,10 @@ public class UseCaseNameEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -557,9 +575,12 @@ public class UseCaseNameEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
@@ -575,11 +596,11 @@ public class UseCaseNameEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
+ if (getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser)getParser()).getSemanticElementsBeingParsed(element);
- for(int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject)parserElements.get(i)); //$NON-NLS-1$
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.addSemanticListeners();
@@ -590,8 +611,8 @@ public class UseCaseNameEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
}
} else {
@@ -603,7 +624,7 @@ public class UseCaseNameEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
+ if (accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
@Override
@@ -629,13 +650,14 @@ public class UseCaseNameEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
public int getDirectEditionType() {
- if(checkExtendedEditor()) {
+ if (checkExtendedEditor()) {
initExtendedEditorConfiguration();
return IDirectEdition.EXTENDED_DIRECT_EDITOR;
}
- if(checkDefaultEdition()) {
+ if (checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
+
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -647,8 +669,8 @@ public class UseCaseNameEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
}
return false;
}
@@ -665,35 +687,40 @@ public class UseCaseNameEditPartCN extends PapyrusCompartmentEditPart implements
/**
* Initializes the extended editor configuration
+ *
* @generated
*/
protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
+ 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());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
}
}
}
/**
* Updates the preference configuration
+ *
* @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else if(IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
}
/**
* Performs the direct edit usually used by GMF editors.
- * @param theRequest the direct edit request that starts the direct edit system
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
* @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
@@ -703,12 +730,13 @@ public class UseCaseNameEditPartCN extends PapyrusCompartmentEditPart implements
@Override
public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ if (isActive() && isEditable()) {
+ if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
@@ -743,31 +771,32 @@ public class UseCaseNameEditPartCN extends PapyrusCompartmentEditPart implements
protected void handleNotificationEvent(Notification event) {
refreshLabel();
Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer)event.getNewValue();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if(NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
refreshUnderline();
- } else if(NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if(NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
- if(getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
refreshLabel();
}
- if(getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser)getParser();
- if(modelParser.areSemanticElementsAffected(null, event)) {
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
- if(resolveSemanticElement() != null) {
+ if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
@@ -798,7 +827,8 @@ public class UseCaseNameEditPartCN extends PapyrusCompartmentEditPart implements
* @generated
*/
protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel()));
+ addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
+
}
/**
@@ -807,6 +837,7 @@ public class UseCaseNameEditPartCN extends PapyrusCompartmentEditPart implements
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
+
}
/**
@@ -814,5 +845,6 @@ public class UseCaseNameEditPartCN extends PapyrusCompartmentEditPart implements
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
+
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/policies/UMLBaseItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/policies/UMLBaseItemSemanticEditPolicy.java
index ee568a059c2..4e05e2ed3b9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/policies/UMLBaseItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/policies/UMLBaseItemSemanticEditPolicy.java
@@ -97,12 +97,14 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
/**
* Extended request data key to hold editpart visual id.
+ *
* @generated
*/
public static final String VISUAL_ID_KEY = "visual_id"; //$NON-NLS-1$
/**
* Extended request data key to hold the edge view during a reconnect request.
+ *
* @generated
*/
public static final String GRAPHICAL_RECONNECTED_EDGE = "graphical_edge"; //$NON-NLS-1$
@@ -126,17 +128,17 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
* It is done in those cases when it's not possible to deduce diagram
* element kind from domain element.
* Add the reoriented view to the request extended data so that the view
- * currently edited can be distinguished from other views of the same element
- * and these latter possibly removed if they become inconsistent after reconnect
+ * currently edited can be distinguished from other views of the same element
+ * and these latter possibly removed if they become inconsistent after reconnect
*
* @generated
*/
@SuppressWarnings("unchecked")
public Command getCommand(Request request) {
- if(request instanceof ReconnectRequest) {
- Object view = ((ReconnectRequest)request).getConnectionEditPart().getModel();
- if(view instanceof View) {
- Integer id = new Integer(UMLVisualIDRegistry.getVisualID((View)view));
+ if (request instanceof ReconnectRequest) {
+ Object view = ((ReconnectRequest) request).getConnectionEditPart().getModel();
+ if (view instanceof View) {
+ Integer id = new Integer(UMLVisualIDRegistry.getVisualID((View) view));
request.getExtendedData().put(VISUAL_ID_KEY, id);
request.getExtendedData().put(GRAPHICAL_RECONNECTED_EDGE, view);
}
@@ -146,11 +148,12 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
/**
* 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;
+ return id instanceof Integer ? ((Integer) id).intValue() : -1;
}
/**
@@ -160,8 +163,8 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
IEditCommandRequest completedRequest = completeRequest(request);
Command semanticCommand = getSemanticCommandSwitch(completedRequest);
semanticCommand = getEditHelperCommand(completedRequest, semanticCommand);
- if(completedRequest instanceof DestroyRequest) {
- DestroyRequest destroyRequest = (DestroyRequest)completedRequest;
+ if (completedRequest instanceof DestroyRequest) {
+ DestroyRequest destroyRequest = (DestroyRequest) completedRequest;
return shouldProceed(destroyRequest) ? addDeleteViewCommand(semanticCommand, destroyRequest) : null;
}
return semanticCommand;
@@ -171,7 +174,7 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
* @generated
*/
protected Command addDeleteViewCommand(Command mainCommand, DestroyRequest completedRequest) {
- Command deleteViewCommand = getGEFWrapper(new DeleteCommand(getEditingDomain(), (View)getHost().getModel()));
+ Command deleteViewCommand = getGEFWrapper(new DeleteCommand(getEditingDomain(), (View) getHost().getModel()));
return mainCommand == null ? deleteViewCommand : mainCommand.chain(deleteViewCommand);
}
@@ -179,8 +182,8 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
* @generated
*/
private Command getEditHelperCommand(IEditCommandRequest request, Command editPolicyCommand) {
- if(editPolicyCommand != null) {
- ICommand command = editPolicyCommand instanceof ICommandProxy ? ((ICommandProxy)editPolicyCommand).getICommand() : new CommandProxy(editPolicyCommand);
+ if (editPolicyCommand != null) {
+ ICommand command = editPolicyCommand instanceof ICommandProxy ? ((ICommandProxy) editPolicyCommand).getICommand() : new CommandProxy(editPolicyCommand);
request.setParameter(GeneratedEditHelperBase.EDIT_POLICY_COMMAND, command);
}
IElementType requestContextElementType = getContextElementType(request);
@@ -188,8 +191,8 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
ICommand command = requestContextElementType.getEditCommand(request);
request.setParameter(GeneratedEditHelperBase.EDIT_POLICY_COMMAND, null);
request.setParameter(GeneratedEditHelperBase.CONTEXT_ELEMENT_TYPE, null);
- if(command != null) {
- if(!(command instanceof CompositeTransactionalCommand)) {
+ if (command != null) {
+ if (!(command instanceof CompositeTransactionalCommand)) {
command = new CompositeTransactionalCommand(getEditingDomain(), command.getLabel()).compose(command);
}
return new ICommandProxy(command);
@@ -209,28 +212,28 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
* @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);
+ 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;
}
@@ -254,11 +257,11 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
*/
protected Command getCreateCommand(CreateElementRequest req) {
IElementType requestElementType = req.getElementType();
- if(requestElementType instanceof IElementType) {
+ if (requestElementType instanceof IElementType) {
IElementEditService commandProvider = ElementEditServiceUtils.getCommandProvider(req.getContainer());
- if(commandProvider != null) {
+ if (commandProvider != null) {
ICommand command = commandProvider.getEditCommand(req);
- if(command != null && command.canExecute()) {
+ if (command != null && command.canExecute()) {
return new ICommandProxy(command);
}
}
@@ -272,7 +275,7 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
*/
protected Command getExtendedTypeCreationCommand(CreateElementRequest request, IElementType requestElementType) {
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(request.getContainer());
- if(provider == null) {
+ if (provider == null) {
return UnexecutableCommand.INSTANCE;
}
// Retrieve create command from the Element Edit service
@@ -285,7 +288,7 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
*/
protected Command getExtendedStartCreateRelationshipCommand(CreateElementRequest request, IElementType requestElementType) {
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(requestElementType);
- if(provider == null) {
+ if (provider == null) {
return UnexecutableCommand.INSTANCE;
}
// Retrieve create command from the Element Edit service
@@ -298,7 +301,7 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
*/
protected Command getExtendedCompleteCreateRelationshipCommand(CreateElementRequest request, IElementType requestElementType) {
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(requestElementType);
- if(provider == null) {
+ if (provider == null) {
return UnexecutableCommand.INSTANCE;
}
// Retrieve create command from the Element Edit service
@@ -347,11 +350,11 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
*/
protected Command getMoveCommand(MoveRequest req) {
EObject targetCEObject = req.getTargetContainer();
- if(targetCEObject != null) {
+ if (targetCEObject != null) {
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(targetCEObject);
- if(provider != null) {
+ if (provider != null) {
ICommand moveCommand = provider.getEditCommand(req);
- if(moveCommand != null) {
+ if (moveCommand != null) {
return new ICommandProxy(moveCommand);
}
}
@@ -359,6 +362,7 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
} else {
return getGEFWrapper(new MoveElementsCommand(req));
}
+
}
/**
@@ -384,21 +388,23 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
/**
* Returns editing domain from the host edit part.
+ *
* @generated
*/
protected TransactionalEditingDomain getEditingDomain() {
- return ((IGraphicalEditPart)getHost()).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$
+ 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));
@@ -410,7 +416,7 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
*/
public static LinkConstraints getLinkConstraints() {
LinkConstraints cached = UMLDiagramEditorPlugin.getInstance().getLinkConstraints();
- if(cached == null) {
+ if (cached == null) {
UMLDiagramEditorPlugin.getInstance().setLinkConstraints(cached = new LinkConstraints());
}
return cached;
@@ -445,151 +451,180 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
* @generated
*/
public boolean canCreateCommentAnnotatedElement_4002(Comment source, Element target) {
- if(source != null) {
- if(source.getAnnotatedElements().contains(target)) {
+ if (source != null) {
+ if (source.getAnnotatedElements()
+ .contains(target)) {
return false;
}
}
- return canExistCommentAnnotatedElement_4002(source, target);
+
+ return canExistCommentAnnotatedElement_4002(
+ source, target);
}
/**
* @generated
*/
public boolean canCreateConstraintConstrainedElement_4003(Constraint source, Element target) {
- if(source != null) {
- if(source.getConstrainedElements().contains(target)) {
+ if (source != null) {
+ if (source.getConstrainedElements()
+ .contains(target)) {
return false;
}
}
- return canExistConstraintConstrainedElement_4003(source, target);
+
+ return canExistConstraintConstrainedElement_4003(
+ source, target);
}
/**
* @generated
*/
public boolean canCreateComponentRealization_4004(Package container, NamedElement source, NamedElement target) {
- return canExistComponentRealization_4004(container, null, source, target);
+ return canExistComponentRealization_4004(
+ container, null, source, target);
}
/**
* @generated
*/
public boolean canCreateInterfaceRealization_4005(Package container, NamedElement source, NamedElement target) {
- return canExistInterfaceRealization_4005(container, null, source, target);
+ return canExistInterfaceRealization_4005(
+ container, null, source, target);
}
/**
* @generated
*/
public boolean canCreateSubstitution_4011(Package container, NamedElement source, NamedElement target) {
- return canExistSubstitution_4011(container, null, source, target);
+ return canExistSubstitution_4011(
+ container, null, source, target);
}
/**
* @generated
*/
public boolean canCreateRealization_4006(Package container, NamedElement source, NamedElement target) {
- return canExistRealization_4006(container, null, source, target);
+ return canExistRealization_4006(
+ container, null, source, target);
}
/**
* @generated
*/
public boolean canCreateManifestation_4012(Package container, NamedElement source, NamedElement target) {
- return canExistManifestation_4012(container, null, source, target);
+ return canExistManifestation_4012(
+ container, null, source, target);
}
/**
* @generated
*/
public boolean canCreateAbstraction_4007(Package container, NamedElement source, NamedElement target) {
- return canExistAbstraction_4007(container, null, source, target);
+ return canExistAbstraction_4007(
+ container, null, source, target);
}
/**
* @generated
*/
public boolean canCreateUsage_4008(Package container, NamedElement source, NamedElement target) {
- return canExistUsage_4008(container, null, source, target);
+ return canExistUsage_4008(
+ container, null, source, target);
}
/**
* @generated
*/
public boolean canCreateDeployment_4009(Package container, NamedElement source, NamedElement target) {
- return canExistDeployment_4009(container, null, source, target);
+ return canExistDeployment_4009(
+ container, null, source, target);
}
/**
* @generated
*/
public boolean canCreateDependency_4017(Package container, NamedElement source, NamedElement target) {
- return canExistDependency_4017(container, null, source, target);
+ return canExistDependency_4017(
+ container, null, source, target);
}
/**
* @generated
*/
public boolean canCreateDependency_4010(Package container, NamedElement source, NamedElement target) {
- return canExistDependency_4010(container, null, source, target);
+ return canExistDependency_4010(
+ container, null, source, target);
}
/**
* @generated
*/
public boolean canCreateConnector_4013(StructuredClassifier container, ConnectorEnd source, ConnectorEnd target) {
- return canExistConnector_4013(container, null, source, target);
+ return canExistConnector_4013(
+ container, null, source, target);
}
/**
* @generated
*/
public boolean canCreateGeneralization_4015(Classifier container, Classifier source, Classifier target) {
- return canExistGeneralization_4015(container, null, source, target);
+ return canExistGeneralization_4015(
+ container, null, source, target);
}
/**
* @generated
*/
public boolean canCreateTimeObservationEvent_4018(TimeObservation source, NamedElement target) {
- if(source != null) {
- if(source.getEvent() != null) {
+ if (source != null) {
+ if (source.getEvent() != null) {
return false;
}
}
- return canExistTimeObservationEvent_4018(source, target);
+
+ return canExistTimeObservationEvent_4018(
+ source, target);
}
/**
* @generated
*/
public boolean canCreateDurationObservationEvent_4019(DurationObservation source, NamedElement target) {
- if(source != null) {
- if(source.getEvents().size() >= 2 || source.getEvents().contains(target)) {
+ if (source != null) {
+ if (source.getEvents()
+ .size() >= 2
+ || source.getEvents()
+ .contains(target)) {
return false;
}
}
- return canExistDurationObservationEvent_4019(source, target);
+
+ return canExistDurationObservationEvent_4019(
+ source, target);
}
/**
* @generated
*/
public boolean canCreateInformationItemRepresented_4020(InformationItem source, Classifier target) {
- if(source != null) {
- if(source.getRepresenteds().contains(target)) {
+ if (source != null) {
+ if (source.getRepresenteds()
+ .contains(target)) {
return false;
}
}
- return canExistInformationItemRepresented_4020(source, target);
+
+ return canExistInformationItemRepresented_4020(
+ source, target);
}
/**
* @generated
*/
public boolean canCreateInformationFlow_4021(Package container, NamedElement source, NamedElement target) {
- return canExistInformationFlow_4021(container, null, source, target);
+ return canExistInformationFlow_4021(
+ container, null, source, target);
}
/**
@@ -682,19 +717,19 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
public boolean canExistDependency_4017(Package container, Dependency linkInstance, NamedElement source, NamedElement target) {
try {
// RoleBinding source constraint
- if((source != null) && !(source instanceof CollaborationUse)) {
+ if ((source != null) && !(source instanceof CollaborationUse)) {
return false;
}
// RoleBinding source has a type
- if((source != null) && (((CollaborationUse)source).getType() == null)) {
+ if ((source != null) && (((CollaborationUse) source).getType() == null)) {
return false;
}
// RoleBinding target constraint
- if((target != null) && !(target instanceof ConnectableElement)) {
+ if ((target != null) && !(target instanceof ConnectableElement)) {
return false;
}
// RoleBinding source and target have the same semantic parent
- if((source != null) && (target != null) && (source.getOwner() != target.getOwner())) {
+ if ((source != null) && (target != null) && (source.getOwner() != target.getOwner())) {
return false;
}
return true;
@@ -745,8 +780,11 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
public boolean canExistInformationItemRepresented_4020(InformationItem source, Classifier target) {
try {
// Represented InformationItem Target
- if(target != null) {
- if(!((target instanceof Class) || (target instanceof Interface) || (target instanceof InformationItem) || (target instanceof Signal) || (target instanceof Component))) {
+ if (target != null) {
+ if (!((target instanceof Class)
+ || (target instanceof Interface)
+ || (target instanceof InformationItem)
+ || (target instanceof Signal) || (target instanceof Component))) {
return false;
}
}
@@ -762,29 +800,55 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
*/
public boolean canExistInformationFlow_4021(Package container, InformationFlow linkInstance, NamedElement source, NamedElement target) {
try {
- //Information Flow source constraint
- if(source != null) {
- if(!((source instanceof Actor) || (source instanceof Node) || (source instanceof UseCase) || (source instanceof Artifact) || (source instanceof Class) || (source instanceof Component) || (source instanceof Port) || (source instanceof Property) || (source instanceof Interface) || (source instanceof Package) || (source instanceof ActivityNode) || (source instanceof ActivityPartition) || (source instanceof InstanceSpecification))) {
+ // Information Flow source constraint
+ if (source != null) {
+ if (!((source instanceof Actor)
+ || (source instanceof Node)
+ || (source instanceof UseCase)
+ || (source instanceof Artifact)
+ || (source instanceof Class)
+ || (source instanceof Component)
+ || (source instanceof Port)
+ || (source instanceof Property)
+ || (source instanceof Interface)
+ || (source instanceof Package)
+ || (source instanceof ActivityNode)
+ || (source instanceof ActivityPartition) || (source instanceof InstanceSpecification))) {
+
return false;
+
}
- if(source instanceof InstanceSpecification) {
- EList<Classifier> classes = ((InstanceSpecification)source).getClassifiers();
- for(int i = 0; i < classes.size(); i++) {
- if(classes.get(i) instanceof Relationship) {
+ if (source instanceof InstanceSpecification) {
+ EList<Classifier> classes = ((InstanceSpecification) source).getClassifiers();
+ for (int i = 0; i < classes.size(); i++) {
+ if (classes.get(i) instanceof Relationship) {
return false;
}
}
}
}
- //Information Flow target constraint
- if(target != null) {
- if(!((target instanceof Actor) || (target instanceof Node) || (target instanceof UseCase) || (target instanceof Artifact) || (target instanceof Class) || (target instanceof Component) || (target instanceof Port) || (target instanceof Property) || (target instanceof Interface) || (target instanceof Package) || (target instanceof ActivityNode) || (target instanceof ActivityPartition) || (target instanceof InstanceSpecification))) {
+ // Information Flow target constraint
+ if (target != null) {
+ if (!((target instanceof Actor)
+ || (target instanceof Node)
+ || (target instanceof UseCase)
+ || (target instanceof Artifact)
+ || (target instanceof Class)
+ || (target instanceof Component)
+ || (target instanceof Port)
+ || (target instanceof Property)
+ || (target instanceof Interface)
+ || (target instanceof Package)
+ || (target instanceof ActivityNode)
+ || (target instanceof ActivityPartition) || (target instanceof InstanceSpecification))) {
+
return false;
+
}
- if(target instanceof InstanceSpecification) {
- EList<Classifier> classes = ((InstanceSpecification)target).getClassifiers();
- for(int i = 0; i < classes.size(); i++) {
- if(classes.get(i) instanceof Relationship) {
+ if (target instanceof InstanceSpecification) {
+ EList<Classifier> classes = ((InstanceSpecification) target).getClassifiers();
+ for (int i = 0; i < classes.size(); i++) {
+ if (classes.get(i) instanceof Relationship) {
return false;
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/policies/UMLTextNonResizableEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/policies/UMLTextNonResizableEditPolicy.java
index 9f08f43c77d..cdbfd56d4a5 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/policies/UMLTextNonResizableEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/policies/UMLTextNonResizableEditPolicy.java
@@ -53,9 +53,9 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl
* @generated
*/
protected void showPrimarySelection() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setSelected(true);
- ((WrappingLabel)getHostFigure()).setFocus(true);
+ if (getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getHostFigure()).setSelected(true);
+ ((WrappingLabel) getHostFigure()).setFocus(true);
} else {
showSelection();
showFocus();
@@ -66,9 +66,9 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl
* @generated
*/
protected void showSelection() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setSelected(true);
- ((WrappingLabel)getHostFigure()).setFocus(false);
+ if (getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getHostFigure()).setSelected(true);
+ ((WrappingLabel) getHostFigure()).setFocus(false);
} else {
hideSelection();
addFeedback(selectionFeedbackFigure = createSelectionFeedbackFigure());
@@ -82,11 +82,11 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl
* @generated
*/
protected void hideSelection() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setSelected(false);
- ((WrappingLabel)getHostFigure()).setFocus(false);
+ if (getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getHostFigure()).setSelected(false);
+ ((WrappingLabel) getHostFigure()).setFocus(false);
} else {
- if(selectionFeedbackFigure != null) {
+ if (selectionFeedbackFigure != null) {
removeFeedback(selectionFeedbackFigure);
getHostFigure().removeFigureListener(getHostPositionListener());
selectionFeedbackFigure = null;
@@ -99,8 +99,8 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl
* @generated
*/
protected void showFocus() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setFocus(true);
+ if (getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getHostFigure()).setFocus(true);
} else {
hideFocus();
addFeedback(focusFeedbackFigure = createFocusFeedbackFigure());
@@ -112,10 +112,10 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl
* @generated
*/
protected void hideFocus() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setFocus(false);
+ if (getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getHostFigure()).setFocus(false);
} else {
- if(focusFeedbackFigure != null) {
+ if (focusFeedbackFigure != null) {
removeFeedback(focusFeedbackFigure);
focusFeedbackFigure = null;
}
@@ -127,8 +127,8 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl
*/
protected Rectangle getFeedbackBounds() {
Rectangle bounds;
- if(getHostFigure() instanceof Label) {
- bounds = ((Label)getHostFigure()).getTextBounds();
+ if (getHostFigure() instanceof Label) {
+ bounds = ((Label) getHostFigure()).getTextBounds();
bounds.intersect(getHostFigure().getBounds());
} else {
bounds = getHostFigure().getBounds().getCopy();
@@ -142,7 +142,7 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl
* @generated
*/
protected IFigure createSelectionFeedbackFigure() {
- if(getHostFigure() instanceof Label) {
+ if (getHostFigure() instanceof Label) {
Label feedbackFigure = new Label();
feedbackFigure.setOpaque(true);
feedbackFigure.setBackgroundColor(ColorConstants.menuBackgroundSelected);
@@ -172,7 +172,7 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl
* @generated
*/
protected void updateLabel(Label target) {
- Label source = (Label)getHostFigure();
+ Label source = (Label) getHostFigure();
target.setText(source.getText());
target.setTextAlignment(source.getTextAlignment());
target.setFont(source.getFont());
@@ -182,9 +182,9 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl
* @generated
*/
protected void refreshSelectionFeedback() {
- if(selectionFeedbackFigure != null) {
- if(selectionFeedbackFigure instanceof Label) {
- updateLabel((Label)selectionFeedbackFigure);
+ if (selectionFeedbackFigure != null) {
+ if (selectionFeedbackFigure instanceof Label) {
+ updateLabel((Label) selectionFeedbackFigure);
selectionFeedbackFigure.setBounds(getFeedbackBounds());
} else {
selectionFeedbackFigure.setBounds(getFeedbackBounds().expand(5, 5));
@@ -196,7 +196,7 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl
* @generated
*/
protected void refreshFocusFeedback() {
- if(focusFeedbackFigure != null) {
+ if (focusFeedbackFigure != null) {
focusFeedbackFigure.setBounds(getFeedbackBounds());
}
}
@@ -214,9 +214,8 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl
* @generated
*/
private FigureListener getHostPositionListener() {
- if(hostPositionListener == null) {
+ if (hostPositionListener == null) {
hostPositionListener = new FigureListener() {
-
@Override
public void figureMoved(IFigure source) {
refreshFeedback();
@@ -230,7 +229,7 @@ public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx impl
* @generated
*/
protected List<?> createSelectionHandles() {
- MoveHandle moveHandle = new MoveHandle((GraphicalEditPart)getHost());
+ 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.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/policies/UMLTextSelectionEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/policies/UMLTextSelectionEditPolicy.java
index 861ee3973bb..365f637458b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/policies/UMLTextSelectionEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/policies/UMLTextSelectionEditPolicy.java
@@ -47,9 +47,9 @@ public class UMLTextSelectionEditPolicy extends SelectionEditPolicy implements I
* @generated
*/
protected void showPrimarySelection() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setSelected(true);
- ((WrappingLabel)getHostFigure()).setFocus(true);
+ if (getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getHostFigure()).setSelected(true);
+ ((WrappingLabel) getHostFigure()).setFocus(true);
} else {
showSelection();
showFocus();
@@ -60,9 +60,9 @@ public class UMLTextSelectionEditPolicy extends SelectionEditPolicy implements I
* @generated
*/
protected void showSelection() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setSelected(true);
- ((WrappingLabel)getHostFigure()).setFocus(false);
+ if (getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getHostFigure()).setSelected(true);
+ ((WrappingLabel) getHostFigure()).setFocus(false);
} else {
hideSelection();
addFeedback(selectionFeedbackFigure = createSelectionFeedbackFigure());
@@ -76,11 +76,11 @@ public class UMLTextSelectionEditPolicy extends SelectionEditPolicy implements I
* @generated
*/
protected void hideSelection() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setSelected(false);
- ((WrappingLabel)getHostFigure()).setFocus(false);
+ if (getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getHostFigure()).setSelected(false);
+ ((WrappingLabel) getHostFigure()).setFocus(false);
} else {
- if(selectionFeedbackFigure != null) {
+ if (selectionFeedbackFigure != null) {
removeFeedback(selectionFeedbackFigure);
getHostFigure().removeFigureListener(getHostPositionListener());
selectionFeedbackFigure = null;
@@ -93,8 +93,8 @@ public class UMLTextSelectionEditPolicy extends SelectionEditPolicy implements I
* @generated
*/
protected void showFocus() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setFocus(true);
+ if (getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getHostFigure()).setFocus(true);
} else {
hideFocus();
addFeedback(focusFeedbackFigure = createFocusFeedbackFigure());
@@ -106,10 +106,10 @@ public class UMLTextSelectionEditPolicy extends SelectionEditPolicy implements I
* @generated
*/
protected void hideFocus() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setFocus(false);
+ if (getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getHostFigure()).setFocus(false);
} else {
- if(focusFeedbackFigure != null) {
+ if (focusFeedbackFigure != null) {
removeFeedback(focusFeedbackFigure);
focusFeedbackFigure = null;
}
@@ -121,8 +121,8 @@ public class UMLTextSelectionEditPolicy extends SelectionEditPolicy implements I
*/
protected Rectangle getFeedbackBounds() {
Rectangle bounds;
- if(getHostFigure() instanceof Label) {
- bounds = ((Label)getHostFigure()).getTextBounds();
+ if (getHostFigure() instanceof Label) {
+ bounds = ((Label) getHostFigure()).getTextBounds();
bounds.intersect(getHostFigure().getBounds());
} else {
bounds = getHostFigure().getBounds().getCopy();
@@ -136,7 +136,7 @@ public class UMLTextSelectionEditPolicy extends SelectionEditPolicy implements I
* @generated
*/
protected IFigure createSelectionFeedbackFigure() {
- if(getHostFigure() instanceof Label) {
+ if (getHostFigure() instanceof Label) {
Label feedbackFigure = new Label();
feedbackFigure.setOpaque(true);
feedbackFigure.setBackgroundColor(ColorConstants.menuBackgroundSelected);
@@ -166,7 +166,7 @@ public class UMLTextSelectionEditPolicy extends SelectionEditPolicy implements I
* @generated
*/
protected void updateLabel(Label target) {
- Label source = (Label)getHostFigure();
+ Label source = (Label) getHostFigure();
target.setText(source.getText());
target.setTextAlignment(source.getTextAlignment());
target.setFont(source.getFont());
@@ -176,9 +176,9 @@ public class UMLTextSelectionEditPolicy extends SelectionEditPolicy implements I
* @generated
*/
protected void refreshSelectionFeedback() {
- if(selectionFeedbackFigure != null) {
- if(selectionFeedbackFigure instanceof Label) {
- updateLabel((Label)selectionFeedbackFigure);
+ if (selectionFeedbackFigure != null) {
+ if (selectionFeedbackFigure instanceof Label) {
+ updateLabel((Label) selectionFeedbackFigure);
selectionFeedbackFigure.setBounds(getFeedbackBounds());
} else {
selectionFeedbackFigure.setBounds(getFeedbackBounds().expand(5, 5));
@@ -190,7 +190,7 @@ public class UMLTextSelectionEditPolicy extends SelectionEditPolicy implements I
* @generated
*/
protected void refreshFocusFeedback() {
- if(focusFeedbackFigure != null) {
+ if (focusFeedbackFigure != null) {
focusFeedbackFigure.setBounds(getFeedbackBounds());
}
}
@@ -208,9 +208,8 @@ public class UMLTextSelectionEditPolicy extends SelectionEditPolicy implements I
* @generated
*/
private FigureListener getHostPositionListener() {
- if(hostPositionListener == null) {
+ if (hostPositionListener == null) {
hostPositionListener = new FigureListener() {
-
@Override
public void figureMoved(IFigure source) {
refreshFeedback();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/parsers/AbstractParser.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/parsers/AbstractParser.java
index 663b3700530..a625f09edb5 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/parsers/AbstractParser.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/parsers/AbstractParser.java
@@ -1 +1 @@
-//Since GMFT 3.1 we don't generate class AbstractParser into every diagram, instead extend org.eclipse.gmf.tooling.runtime.parsers.AbstractAttributeParser.
+// Since GMFT 3.1 we don't generate class AbstractParser into every diagram, instead extend org.eclipse.gmf.tooling.runtime.parsers.AbstractAttributeParser.
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/parsers/MessageFormatParser.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/parsers/MessageFormatParser.java
index 36f86a781e7..40071a66e22 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/parsers/MessageFormatParser.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/parsers/MessageFormatParser.java
@@ -21,15 +21,15 @@ 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.gmf.tooling.runtime.parsers.AbstractAttributeParser;
import org.eclipse.osgi.util.NLS;
-import org.eclipse.papyrus.infra.gmfdiag.common.parsers.AbstractElementTypeBasedAttributeParser;
import org.eclipse.papyrus.uml.diagram.composite.part.Messages;
import org.eclipse.papyrus.uml.diagram.composite.part.UMLDiagramEditorPlugin;
/**
* @generated
*/
-public class MessageFormatParser extends AbstractElementTypeBasedAttributeParser {
+public class MessageFormatParser extends AbstractAttributeParser {
/**
* @generated
@@ -74,10 +74,10 @@ public class MessageFormatParser extends AbstractElementTypeBasedAttributeParser
* @generated
*/
protected String getDefaultPattern() {
- if(defaultPattern == null) {
+ if (defaultPattern == null) {
StringBuffer sb = new StringBuffer();
- for(int i = 0; i < features.length; i++) {
- if(i > 0) {
+ for (int i = 0; i < features.length; i++) {
+ if (i > 0) {
sb.append(' ');
}
sb.append('{');
@@ -109,7 +109,7 @@ public class MessageFormatParser extends AbstractElementTypeBasedAttributeParser
* @generated
*/
protected MessageFormat getViewProcessor() {
- if(viewProcessor == null) {
+ if (viewProcessor == null) {
viewProcessor = new MessageFormat(getViewPattern() == null ? getDefaultPattern() : getViewPattern());
}
return viewProcessor;
@@ -119,7 +119,7 @@ public class MessageFormatParser extends AbstractElementTypeBasedAttributeParser
* @generated
*/
protected MessageFormat getEditorProcessor() {
- if(editorProcessor == null) {
+ if (editorProcessor == null) {
editorProcessor = new MessageFormat(getEditorPattern() == null ? getDefaultEditablePattern() : getEditorPattern());
}
return editorProcessor;
@@ -129,10 +129,10 @@ public class MessageFormatParser extends AbstractElementTypeBasedAttributeParser
* @generated
*/
protected String getDefaultEditablePattern() {
- if(defaultEditablePattern == null) {
+ if (defaultEditablePattern == null) {
StringBuffer sb = new StringBuffer();
- for(int i = 0; i < editableFeatures.length; i++) {
- if(i > 0) {
+ for (int i = 0; i < editableFeatures.length; i++) {
+ if (i > 0) {
sb.append(' ');
}
sb.append('{');
@@ -156,7 +156,7 @@ public class MessageFormatParser extends AbstractElementTypeBasedAttributeParser
* @generated
*/
protected MessageFormat getEditProcessor() {
- if(editProcessor == null) {
+ if (editProcessor == null) {
editProcessor = new MessageFormat(getEditPattern() == null ? getDefaultEditablePattern() : getEditPattern());
}
return editProcessor;
@@ -166,7 +166,7 @@ public class MessageFormatParser extends AbstractElementTypeBasedAttributeParser
* @generated
*/
public String getEditString(IAdaptable adapter, int flags) {
- EObject element = (EObject)adapter.getAdapter(EObject.class);
+ EObject element = (EObject) adapter.getAdapter(EObject.class);
return getEditorProcessor().format(getEditableValues(element), new StringBuffer(), new FieldPosition(0)).toString();
}
@@ -176,8 +176,13 @@ public class MessageFormatParser extends AbstractElementTypeBasedAttributeParser
public IParserEditStatus isValidEditString(IAdaptable adapter, String editString) {
ParsePosition pos = new ParsePosition(0);
Object[] values = getEditProcessor().parse(editString, pos);
- if(values == null) {
- return new ParserEditStatus(UMLDiagramEditorPlugin.ID, IParserEditStatus.UNEDITABLE, NLS.bind(Messages.MessageFormatParser_InvalidInputError, new Integer(pos.getErrorIndex())));
+ if (values == null) {
+ return new ParserEditStatus(
+ UMLDiagramEditorPlugin.ID,
+ IParserEditStatus.UNEDITABLE,
+ NLS.bind(
+ Messages.MessageFormatParser_InvalidInputError,
+ new Integer(pos.getErrorIndex())));
}
return validateNewValues(values);
}
@@ -194,7 +199,7 @@ public class MessageFormatParser extends AbstractElementTypeBasedAttributeParser
* @generated
*/
public String getPrintString(IAdaptable adapter, int flags) {
- EObject element = (EObject)adapter.getAdapter(EObject.class);
+ EObject element = (EObject) adapter.getAdapter(EObject.class);
return getViewProcessor().format(getValues(element), new StringBuffer(), new FieldPosition(0)).toString();
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/DiagramEditorContextMenuProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/DiagramEditorContextMenuProvider.java
index 4600dcb97ba..91a465ba9b9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/DiagramEditorContextMenuProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/DiagramEditorContextMenuProvider.java
@@ -44,14 +44,16 @@ public class DiagramEditorContextMenuProvider extends DiagramContextMenuProvider
public void buildContextMenu(final IMenuManager menu) {
getViewer().flush();
try {
- TransactionUtil.getEditingDomain((EObject)getViewer().getContents().getModel()).runExclusive(new Runnable() {
+ TransactionUtil.getEditingDomain(
+ (EObject) getViewer().getContents().getModel()).runExclusive(new Runnable() {
- @Override
- public void run() {
- ContributionItemService.getInstance().contributeToPopupMenu(DiagramEditorContextMenuProvider.this, part);
- menu.remove(ActionIds.ACTION_DELETE_FROM_MODEL);
- }
- });
+ @Override
+ public void run() {
+ ContributionItemService.getInstance().contributeToPopupMenu(
+ DiagramEditorContextMenuProvider.this, part);
+ menu.remove(ActionIds.ACTION_DELETE_FROM_MODEL);
+ }
+ });
} catch (Exception e) {
UMLDiagramEditorPlugin.getInstance().logError("Error building context menu", e);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/Messages.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/Messages.java
index caf7f75c56e..a78ccc17f49 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/Messages.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/Messages.java
@@ -765,5 +765,5 @@ public class Messages extends NLS {
* @generated
*/
public static String UMLModelingAssistantProviderMessage;
- //TODO: put accessor fields manually
+ // TODO: put accessor fields manually
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/ModelElementSelectionPage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/ModelElementSelectionPage.java
index 8bd2c0f3525..b9ec5286bf8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/ModelElementSelectionPage.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/ModelElementSelectionPage.java
@@ -15,6 +15,7 @@ import org.eclipse.gmf.tooling.runtime.part.DefaultModelElementSelectionPage;
/**
* Wizard page that allows to select element from model.
+ *
* @generated
*/
public class ModelElementSelectionPage extends DefaultModelElementSelectionPage {
@@ -28,6 +29,7 @@ public class ModelElementSelectionPage extends DefaultModelElementSelectionPage
/**
* Override to provide custom model element description.
+ *
* @generated
*/
protected String getSelectionTitle() {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLCreationWizard.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLCreationWizard.java
index aa0b7007e29..337b91505c3 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLCreationWizard.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLCreationWizard.java
@@ -102,7 +102,8 @@ public class UMLCreationWizard extends Wizard implements INewWizard {
this.workbench = workbench;
this.selection = selection;
setWindowTitle(Messages.UMLCreationWizardTitle);
- setDefaultPageImageDescriptor(UMLDiagramEditorPlugin.getBundledImageDescriptor("icons/wizban/NewUMLWizard.gif")); //$NON-NLS-1$
+ setDefaultPageImageDescriptor(UMLDiagramEditorPlugin.getBundledImageDescriptor(
+ "icons/wizban/NewUMLWizard.gif")); //$NON-NLS-1$
setNeedsProgressMonitor(true);
}
@@ -110,18 +111,22 @@ public class UMLCreationWizard extends Wizard implements INewWizard {
* @generated
*/
public void addPages() {
- diagramModelFilePage = new UMLCreationWizardPage("DiagramModelFile", getSelection(), "uml_csd"); //$NON-NLS-1$ //$NON-NLS-2$
+ diagramModelFilePage = new UMLCreationWizardPage(
+ "DiagramModelFile", getSelection(), "uml_csd"); //$NON-NLS-1$ //$NON-NLS-2$
diagramModelFilePage.setTitle(Messages.UMLCreationWizard_DiagramModelFilePageTitle);
diagramModelFilePage.setDescription(Messages.UMLCreationWizard_DiagramModelFilePageDescription);
addPage(diagramModelFilePage);
- domainModelFilePage = new UMLCreationWizardPage("DomainModelFile", getSelection(), "uml") { //$NON-NLS-1$ //$NON-NLS-2$
+
+ domainModelFilePage = new UMLCreationWizardPage(
+ "DomainModelFile", getSelection(), "uml") { //$NON-NLS-1$ //$NON-NLS-2$
@Override
public void setVisible(boolean visible) {
- if(visible) {
+ if (visible) {
String fileName = diagramModelFilePage.getFileName();
fileName = fileName.substring(0, fileName.length() - ".uml_csd".length()); //$NON-NLS-1$
- setFileName(UMLDiagramEditorUtil.getUniqueFileName(getContainerFullPath(), fileName, "uml")); //$NON-NLS-1$
+ setFileName(UMLDiagramEditorUtil.getUniqueFileName(
+ getContainerFullPath(), fileName, "uml")); //$NON-NLS-1$
}
super.setVisible(visible);
}
@@ -138,13 +143,17 @@ public class UMLCreationWizard extends Wizard implements INewWizard {
IRunnableWithProgress op = new WorkspaceModifyOperation(null) {
@Override
- protected void execute(IProgressMonitor monitor) throws CoreException, InterruptedException {
- diagram = UMLDiagramEditorUtil.createDiagram(diagramModelFilePage.getURI(), domainModelFilePage.getURI(), monitor);
- if(isOpenNewlyCreatedDiagramEditor() && diagram != null) {
+ protected void execute(IProgressMonitor monitor)
+ throws CoreException, InterruptedException {
+ diagram = UMLDiagramEditorUtil.createDiagram(diagramModelFilePage.getURI(),
+ domainModelFilePage.getURI(),
+ monitor);
+ if (isOpenNewlyCreatedDiagramEditor() && diagram != null) {
try {
UMLDiagramEditorUtil.openDiagram(diagram);
} catch (PartInitException e) {
- ErrorDialog.openError(getContainer().getShell(), Messages.UMLCreationWizardOpenEditorError, null, e.getStatus());
+ ErrorDialog.openError(getContainer().getShell(),
+ Messages.UMLCreationWizardOpenEditorError, null, e.getStatus());
}
}
}
@@ -154,10 +163,13 @@ public class UMLCreationWizard extends Wizard implements INewWizard {
} catch (InterruptedException e) {
return false;
} catch (InvocationTargetException e) {
- if(e.getTargetException() instanceof CoreException) {
- ErrorDialog.openError(getContainer().getShell(), Messages.UMLCreationWizardCreationError, null, ((CoreException)e.getTargetException()).getStatus());
+ if (e.getTargetException() instanceof CoreException) {
+ ErrorDialog.openError(getContainer().getShell(),
+ Messages.UMLCreationWizardCreationError, null,
+ ((CoreException) e.getTargetException()).getStatus());
} else {
- UMLDiagramEditorPlugin.getInstance().logError("Error creating diagram", e.getTargetException()); //$NON-NLS-1$
+ UMLDiagramEditorPlugin.getInstance().logError(
+ "Error creating diagram", e.getTargetException()); //$NON-NLS-1$
}
return false;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLCreationWizardPage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLCreationWizardPage.java
index 8fc3cc6f01b..e3d01952b0b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLCreationWizardPage.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLCreationWizardPage.java
@@ -58,11 +58,11 @@ public class UMLCreationWizardPage extends WizardNewFileCreationPage {
*/
protected IPath getFilePath() {
IPath path = getContainerFullPath();
- if(path == null) {
+ if (path == null) {
path = new Path(""); //$NON-NLS-1$
}
String fileName = getFileName();
- if(fileName != null) {
+ if (fileName != null) {
path = path.append(fileName);
}
return path;
@@ -73,7 +73,8 @@ public class UMLCreationWizardPage extends WizardNewFileCreationPage {
*/
public void createControl(Composite parent) {
super.createControl(parent);
- setFileName(UMLDiagramEditorUtil.getUniqueFileName(getContainerFullPath(), getFileName(), getExtension()));
+ setFileName(UMLDiagramEditorUtil.getUniqueFileName(
+ getContainerFullPath(), getFileName(), getExtension()));
setPageComplete(validatePage());
}
@@ -81,12 +82,13 @@ public class UMLCreationWizardPage extends WizardNewFileCreationPage {
* @generated
*/
protected boolean validatePage() {
- if(!super.validatePage()) {
+ if (!super.validatePage()) {
return false;
}
String extension = getExtension();
- if(extension != null && !getFilePath().toString().endsWith("." + extension)) {
- setErrorMessage(NLS.bind(Messages.UMLCreationWizardPageExtensionError, extension));
+ if (extension != null && !getFilePath().toString().endsWith("." + extension)) {
+ setErrorMessage(NLS.bind(
+ Messages.UMLCreationWizardPageExtensionError, extension));
return false;
}
return true;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLDiagramActionBarContributor.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLDiagramActionBarContributor.java
index e27930b693b..3d0d1e80058 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLDiagramActionBarContributor.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLDiagramActionBarContributor.java
@@ -49,7 +49,7 @@ public class UMLDiagramActionBarContributor extends DiagramActionBarContributor
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$
+ if (editMenu.find("validationGroup") == null) { //$NON-NLS-1$
editMenu.add(new GroupMarker("validationGroup")); //$NON-NLS-1$
}
IAction validateAction = new ValidateAction(page);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLDiagramContentInitializer.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLDiagramContentInitializer.java
index 50fe9dd3160..60c66cd634f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLDiagramContentInitializer.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLDiagramContentInitializer.java
@@ -45,11 +45,11 @@ public class UMLDiagramContentInitializer {
* @generated
*/
public void initDiagramContent(Diagram diagram) {
- if(!CompositeStructureDiagramEditPart.MODEL_ID.equals(diagram.getType())) {
+ if (!CompositeStructureDiagramEditPart.MODEL_ID.equals(diagram.getType())) {
UMLDiagramEditorPlugin.getInstance().logError("Incorrect diagram passed as a parameter: " + diagram.getType());
return;
}
- if(false == diagram.getElement() instanceof Package) {
+ if (false == diagram.getElement() instanceof Package) {
UMLDiagramEditorPlugin.getInstance().logError("Incorrect diagram element specified: " + diagram.getElement() + " instead of Package");
return;
}
@@ -61,9 +61,10 @@ public class UMLDiagramContentInitializer {
* @generated
*/
private void createPackage_1000Children(View view) {
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getPackage_1000SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getPackage_1000SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
}
@@ -72,10 +73,12 @@ public class UMLDiagramContentInitializer {
*/
private void createActivity_2060Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getActivity_2060OutgoingLinks(view));
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getActivity_2060SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getActivity_2060OutgoingLinks(view));
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getActivity_2060SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
createActivityInternalstructure_7063Children(getCompartment(view, ActivityCompositeCompartmentEditPart.VISUAL_ID));
}
@@ -85,10 +88,12 @@ public class UMLDiagramContentInitializer {
*/
private void createInteraction_2061Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getInteraction_2061OutgoingLinks(view));
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getInteraction_2061SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getInteraction_2061OutgoingLinks(view));
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getInteraction_2061SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
createInteractionInternalstructure_7064Children(getCompartment(view, InteractionCompositeCompartmentEditPart.VISUAL_ID));
}
@@ -98,10 +103,12 @@ public class UMLDiagramContentInitializer {
*/
private void createProtocolStateMachine_2062Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getProtocolStateMachine_2062OutgoingLinks(view));
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getProtocolStateMachine_2062SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getProtocolStateMachine_2062OutgoingLinks(view));
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getProtocolStateMachine_2062SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
createProtocolStateMachineInternalstructure_7065Children(getCompartment(view, ProtocolStateMachineCompositeCompartmentEditPart.VISUAL_ID));
}
@@ -111,10 +118,12 @@ public class UMLDiagramContentInitializer {
*/
private void createStateMachine_2063Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getStateMachine_2063OutgoingLinks(view));
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getStateMachine_2063SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getStateMachine_2063OutgoingLinks(view));
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getStateMachine_2063SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
createStateMachineInternalstructure_7066Children(getCompartment(view, StateMachineCompositeCompartmentEditPart.VISUAL_ID));
}
@@ -124,10 +133,12 @@ public class UMLDiagramContentInitializer {
*/
private void createFunctionBehavior_2064Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getFunctionBehavior_2064OutgoingLinks(view));
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getFunctionBehavior_2064SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getFunctionBehavior_2064OutgoingLinks(view));
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getFunctionBehavior_2064SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
createFunctionBehaviorInternalstructure_7067Children(getCompartment(view, FunctionBehaviorCompositeCompartmentEditPart.VISUAL_ID));
}
@@ -137,10 +148,12 @@ public class UMLDiagramContentInitializer {
*/
private void createOpaqueBehavior_2065Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getOpaqueBehavior_2065OutgoingLinks(view));
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getOpaqueBehavior_2065SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getOpaqueBehavior_2065OutgoingLinks(view));
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getOpaqueBehavior_2065SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
createOpaqueBehaviorInternalstructure_7068Children(getCompartment(view, OpaqueBehaviorCompositeCompartmentEditPart.VISUAL_ID));
}
@@ -150,10 +163,12 @@ public class UMLDiagramContentInitializer {
*/
private void createComponent_2069Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getComponent_2069OutgoingLinks(view));
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getComponent_2069SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getComponent_2069OutgoingLinks(view));
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getComponent_2069SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
createComponentInternalstructure_7069Children(getCompartment(view, ComponentCompositeCompartmentEditPart.VISUAL_ID));
}
@@ -163,10 +178,12 @@ public class UMLDiagramContentInitializer {
*/
private void createDevice_2070Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getDevice_2070OutgoingLinks(view));
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getDevice_2070SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getDevice_2070OutgoingLinks(view));
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getDevice_2070SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
createDeviceInternalstructure_7070Children(getCompartment(view, DeviceCompositeCompartmentEditPart.VISUAL_ID));
}
@@ -176,10 +193,12 @@ public class UMLDiagramContentInitializer {
*/
private void createExecutionEnvironment_2071Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getExecutionEnvironment_2071OutgoingLinks(view));
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getExecutionEnvironment_2071SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getExecutionEnvironment_2071OutgoingLinks(view));
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getExecutionEnvironment_2071SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
createExecutionEnvironmentInternalstructure_7071Children(getCompartment(view, ExecutionEnvironmentCompositeCompartmentEditPart.VISUAL_ID));
}
@@ -189,10 +208,12 @@ public class UMLDiagramContentInitializer {
*/
private void createNode_2072Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getNode_2072OutgoingLinks(view));
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getNode_2072SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getNode_2072OutgoingLinks(view));
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getNode_2072SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
createNodeInternalstructure_7072Children(getCompartment(view, NodeCompositeCompartmentEditPart.VISUAL_ID));
}
@@ -202,10 +223,12 @@ public class UMLDiagramContentInitializer {
*/
private void createClass_2073Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getClass_2073OutgoingLinks(view));
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getClass_2073SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getClass_2073OutgoingLinks(view));
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getClass_2073SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
createClassInternalstructure_7073Children(getCompartment(view, ClassCompositeCompartmentEditPart.VISUAL_ID));
}
@@ -215,7 +238,8 @@ public class UMLDiagramContentInitializer {
*/
private void createCollaboration_2075Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getCollaboration_2075OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getCollaboration_2075OutgoingLinks(view));
createCollaborationInternalstructure_7075Children(getCompartment(view, CollaborationCompositeCompartmentEditPart.VISUAL_ID));
}
@@ -224,7 +248,8 @@ public class UMLDiagramContentInitializer {
*/
private void createInterface_2076Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getInterface_2076OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getInterface_2076OutgoingLinks(view));
}
/**
@@ -232,7 +257,8 @@ public class UMLDiagramContentInitializer {
*/
private void createPrimitiveType_2066Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getPrimitiveType_2066OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getPrimitiveType_2066OutgoingLinks(view));
}
/**
@@ -240,10 +266,12 @@ public class UMLDiagramContentInitializer {
*/
private void createEnumeration_2067Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getEnumeration_2067OutgoingLinks(view));
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getEnumeration_2067SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getEnumeration_2067OutgoingLinks(view));
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getEnumeration_2067SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
createEnumerationLiterals_7048Children(getCompartment(view, EnumerationEnumerationLiteralCompartmentEditPart.VISUAL_ID));
}
@@ -253,7 +281,8 @@ public class UMLDiagramContentInitializer {
*/
private void createDataType_2068Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getDataType_2068OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getDataType_2068OutgoingLinks(view));
createDataTypeAttributes_7033Children(getCompartment(view, DataTypeAttributeCompartmentEditPart.VISUAL_ID));
createDataTypeOperations_7034Children(getCompartment(view, DataTypeOperationCompartmentEditPart.VISUAL_ID));
}
@@ -263,7 +292,8 @@ public class UMLDiagramContentInitializer {
*/
private void createActor_2077Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getActor_2077OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getActor_2077OutgoingLinks(view));
}
/**
@@ -271,7 +301,8 @@ public class UMLDiagramContentInitializer {
*/
private void createDeploymentSpecification_2078Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getDeploymentSpecification_2078OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getDeploymentSpecification_2078OutgoingLinks(view));
}
/**
@@ -279,7 +310,8 @@ public class UMLDiagramContentInitializer {
*/
private void createArtifact_2079Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getArtifact_2079OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getArtifact_2079OutgoingLinks(view));
}
/**
@@ -287,7 +319,8 @@ public class UMLDiagramContentInitializer {
*/
private void createInformationItem_2080Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getInformationItem_2080OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getInformationItem_2080OutgoingLinks(view));
}
/**
@@ -295,7 +328,8 @@ public class UMLDiagramContentInitializer {
*/
private void createSignal_2081Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getSignal_2081OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getSignal_2081OutgoingLinks(view));
}
/**
@@ -303,7 +337,8 @@ public class UMLDiagramContentInitializer {
*/
private void createUseCase_2082Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getUseCase_2082OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getUseCase_2082OutgoingLinks(view));
}
/**
@@ -311,7 +346,8 @@ public class UMLDiagramContentInitializer {
*/
private void createSignalEvent_2083Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getSignalEvent_2083OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getSignalEvent_2083OutgoingLinks(view));
}
/**
@@ -319,7 +355,8 @@ public class UMLDiagramContentInitializer {
*/
private void createCallEvent_2084Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getCallEvent_2084OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getCallEvent_2084OutgoingLinks(view));
}
/**
@@ -327,7 +364,8 @@ public class UMLDiagramContentInitializer {
*/
private void createAnyReceiveEvent_2085Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getAnyReceiveEvent_2085OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getAnyReceiveEvent_2085OutgoingLinks(view));
}
/**
@@ -335,7 +373,8 @@ public class UMLDiagramContentInitializer {
*/
private void createChangeEvent_2088Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getChangeEvent_2088OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getChangeEvent_2088OutgoingLinks(view));
}
/**
@@ -343,7 +382,8 @@ public class UMLDiagramContentInitializer {
*/
private void createTimeEvent_2089Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getTimeEvent_2089OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getTimeEvent_2089OutgoingLinks(view));
}
/**
@@ -351,7 +391,8 @@ public class UMLDiagramContentInitializer {
*/
private void createDurationObservation_2093Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getDurationObservation_2093OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getDurationObservation_2093OutgoingLinks(view));
}
/**
@@ -359,7 +400,8 @@ public class UMLDiagramContentInitializer {
*/
private void createTimeObservation_2094Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getTimeObservation_2094OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getTimeObservation_2094OutgoingLinks(view));
}
/**
@@ -367,7 +409,8 @@ public class UMLDiagramContentInitializer {
*/
private void createLiteralBoolean_2095Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getLiteralBoolean_2095OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getLiteralBoolean_2095OutgoingLinks(view));
}
/**
@@ -375,7 +418,8 @@ public class UMLDiagramContentInitializer {
*/
private void createLiteralInteger_2096Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getLiteralInteger_2096OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getLiteralInteger_2096OutgoingLinks(view));
}
/**
@@ -383,7 +427,8 @@ public class UMLDiagramContentInitializer {
*/
private void createLiteralNull_2097Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getLiteralNull_2097OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getLiteralNull_2097OutgoingLinks(view));
}
/**
@@ -391,7 +436,8 @@ public class UMLDiagramContentInitializer {
*/
private void createLiteralString_2098Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getLiteralString_2098OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getLiteralString_2098OutgoingLinks(view));
}
/**
@@ -399,7 +445,8 @@ public class UMLDiagramContentInitializer {
*/
private void createLiteralUnlimitedNatural_2099Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getLiteralUnlimitedNatural_2099OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getLiteralUnlimitedNatural_2099OutgoingLinks(view));
}
/**
@@ -407,7 +454,8 @@ public class UMLDiagramContentInitializer {
*/
private void createStringExpression_2100Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getStringExpression_2100OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getStringExpression_2100OutgoingLinks(view));
}
/**
@@ -415,7 +463,8 @@ public class UMLDiagramContentInitializer {
*/
private void createOpaqueExpression_2101Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getOpaqueExpression_2101OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getOpaqueExpression_2101OutgoingLinks(view));
}
/**
@@ -423,7 +472,8 @@ public class UMLDiagramContentInitializer {
*/
private void createTimeExpression_2102Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getTimeExpression_2102OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getTimeExpression_2102OutgoingLinks(view));
}
/**
@@ -431,7 +481,8 @@ public class UMLDiagramContentInitializer {
*/
private void createExpression_2103Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getExpression_2103OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getExpression_2103OutgoingLinks(view));
}
/**
@@ -439,7 +490,8 @@ public class UMLDiagramContentInitializer {
*/
private void createDuration_2104Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getDuration_2104OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getDuration_2104OutgoingLinks(view));
}
/**
@@ -447,7 +499,8 @@ public class UMLDiagramContentInitializer {
*/
private void createTimeInterval_2105Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getTimeInterval_2105OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getTimeInterval_2105OutgoingLinks(view));
}
/**
@@ -455,7 +508,8 @@ public class UMLDiagramContentInitializer {
*/
private void createDurationInterval_2106Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getDurationInterval_2106OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getDurationInterval_2106OutgoingLinks(view));
}
/**
@@ -463,7 +517,8 @@ public class UMLDiagramContentInitializer {
*/
private void createInterval_2107Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getInterval_2107OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getInterval_2107OutgoingLinks(view));
}
/**
@@ -471,7 +526,8 @@ public class UMLDiagramContentInitializer {
*/
private void createInstanceValue_2108Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getInstanceValue_2108OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getInstanceValue_2108OutgoingLinks(view));
}
/**
@@ -479,7 +535,8 @@ public class UMLDiagramContentInitializer {
*/
private void createComment_2109Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getComment_2109OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getComment_2109OutgoingLinks(view));
}
/**
@@ -487,7 +544,8 @@ public class UMLDiagramContentInitializer {
*/
private void createDurationConstraint_2110Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getDurationConstraint_2110OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getDurationConstraint_2110OutgoingLinks(view));
}
/**
@@ -495,7 +553,8 @@ public class UMLDiagramContentInitializer {
*/
private void createTimeConstraint_2111Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getTimeConstraint_2111OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getTimeConstraint_2111OutgoingLinks(view));
}
/**
@@ -503,7 +562,8 @@ public class UMLDiagramContentInitializer {
*/
private void createIntervalConstraint_2112Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getIntervalConstraint_2112OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getIntervalConstraint_2112OutgoingLinks(view));
}
/**
@@ -511,7 +571,8 @@ public class UMLDiagramContentInitializer {
*/
private void createInteractionConstraint_2113Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getInteractionConstraint_2113OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getInteractionConstraint_2113OutgoingLinks(view));
}
/**
@@ -519,7 +580,8 @@ public class UMLDiagramContentInitializer {
*/
private void createConstraint_2114Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getConstraint_2114OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getConstraint_2114OutgoingLinks(view));
}
/**
@@ -527,7 +589,8 @@ public class UMLDiagramContentInitializer {
*/
private void createPort_3069Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getPort_3069OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getPort_3069OutgoingLinks(view));
}
/**
@@ -535,7 +598,8 @@ public class UMLDiagramContentInitializer {
*/
private void createParameter_3088Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getParameter_3088OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getParameter_3088OutgoingLinks(view));
}
/**
@@ -543,10 +607,12 @@ public class UMLDiagramContentInitializer {
*/
private void createProperty_3070Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getProperty_3070OutgoingLinks(view));
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getProperty_3070SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getProperty_3070OutgoingLinks(view));
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getProperty_3070SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
createPropertyInternalstructure_7077Children(getCompartment(view, PropertyPartCompartmentEditPartCN.VISUAL_ID));
}
@@ -556,7 +622,8 @@ public class UMLDiagramContentInitializer {
*/
private void createConnectableElement_3115Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getConnectableElement_3115OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getConnectableElement_3115OutgoingLinks(view));
}
/**
@@ -564,7 +631,8 @@ public class UMLDiagramContentInitializer {
*/
private void createCollaborationUse_3071Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getCollaborationUse_3071OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getCollaborationUse_3071OutgoingLinks(view));
}
/**
@@ -572,10 +640,12 @@ public class UMLDiagramContentInitializer {
*/
private void createActivity_3072Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getActivity_3072OutgoingLinks(view));
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getActivity_3072SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getActivity_3072OutgoingLinks(view));
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getActivity_3072SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
createActivityInternalstructure_7050Children(getCompartment(view, ActivityCompositeCompartmentEditPartCN.VISUAL_ID));
}
@@ -585,10 +655,12 @@ public class UMLDiagramContentInitializer {
*/
private void createInteraction_3073Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getInteraction_3073OutgoingLinks(view));
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getInteraction_3073SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getInteraction_3073OutgoingLinks(view));
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getInteraction_3073SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
createInteractionInternalstructure_7051Children(getCompartment(view, InteractionCompositeCompartmentEditPartCN.VISUAL_ID));
}
@@ -598,10 +670,12 @@ public class UMLDiagramContentInitializer {
*/
private void createProtocolStateMachine_3074Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getProtocolStateMachine_3074OutgoingLinks(view));
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getProtocolStateMachine_3074SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getProtocolStateMachine_3074OutgoingLinks(view));
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getProtocolStateMachine_3074SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
createProtocolStateMachineInternalstructure_7052Children(getCompartment(view, ProtocolStateMachineCompositeCompartmentEditPartCN.VISUAL_ID));
}
@@ -611,10 +685,12 @@ public class UMLDiagramContentInitializer {
*/
private void createStateMachine_3075Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getStateMachine_3075OutgoingLinks(view));
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getStateMachine_3075SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getStateMachine_3075OutgoingLinks(view));
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getStateMachine_3075SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
createStateMachineInternalstructure_7053Children(getCompartment(view, StateMachineCompositeCompartmentEditPartCN.VISUAL_ID));
}
@@ -624,10 +700,12 @@ public class UMLDiagramContentInitializer {
*/
private void createFunctionBehavior_3076Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getFunctionBehavior_3076OutgoingLinks(view));
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getFunctionBehavior_3076SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getFunctionBehavior_3076OutgoingLinks(view));
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getFunctionBehavior_3076SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
createFunctionBehaviorInternalstructure_7054Children(getCompartment(view, FunctionBehaviorCompositeCompartmentEditPartCN.VISUAL_ID));
}
@@ -637,10 +715,12 @@ public class UMLDiagramContentInitializer {
*/
private void createOpaqueBehavior_3077Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getOpaqueBehavior_3077OutgoingLinks(view));
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getOpaqueBehavior_3077SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getOpaqueBehavior_3077OutgoingLinks(view));
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getOpaqueBehavior_3077SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
createOpaqueBehaviorInternalstructure_7055Children(getCompartment(view, OpaqueBehaviorCompositeCompartmentEditPartCN.VISUAL_ID));
}
@@ -650,10 +730,12 @@ public class UMLDiagramContentInitializer {
*/
private void createComponent_3081Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getComponent_3081OutgoingLinks(view));
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getComponent_3081SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getComponent_3081OutgoingLinks(view));
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getComponent_3081SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
createComponentInternalstructure_7056Children(getCompartment(view, ComponentCompositeCompartmentEditPartCN.VISUAL_ID));
}
@@ -663,10 +745,12 @@ public class UMLDiagramContentInitializer {
*/
private void createDevice_3082Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getDevice_3082OutgoingLinks(view));
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getDevice_3082SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getDevice_3082OutgoingLinks(view));
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getDevice_3082SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
createDeviceInternalstructure_7057Children(getCompartment(view, DeviceCompositeCompartmentEditPartCN.VISUAL_ID));
}
@@ -676,10 +760,12 @@ public class UMLDiagramContentInitializer {
*/
private void createExecutionEnvironment_3083Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getExecutionEnvironment_3083OutgoingLinks(view));
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getExecutionEnvironment_3083SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getExecutionEnvironment_3083OutgoingLinks(view));
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getExecutionEnvironment_3083SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
createExecutionEnvironmentInternalstructure_7058Children(getCompartment(view, ExecutionEnvironmentCompositeCompartmentEditPartCN.VISUAL_ID));
}
@@ -689,10 +775,12 @@ public class UMLDiagramContentInitializer {
*/
private void createNode_3084Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getNode_3084OutgoingLinks(view));
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getNode_3084SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getNode_3084OutgoingLinks(view));
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getNode_3084SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
createNodeInternalstructure_7059Children(getCompartment(view, NodeCompositeCompartmentEditPartCN.VISUAL_ID));
}
@@ -702,10 +790,12 @@ public class UMLDiagramContentInitializer {
*/
private void createClass_3085Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getClass_3085OutgoingLinks(view));
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getClass_3085SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getClass_3085OutgoingLinks(view));
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getClass_3085SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
createClassInternalstructure_7060Children(getCompartment(view, ClassCompositeCompartmentEditPartCN.VISUAL_ID));
}
@@ -715,7 +805,8 @@ public class UMLDiagramContentInitializer {
*/
private void createCollaboration_3086Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getCollaboration_3086OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getCollaboration_3086OutgoingLinks(view));
createCollaborationInternalstructure_7061Children(getCompartment(view, CollaborationCompositeCompartmentEditPartCN.VISUAL_ID));
}
@@ -724,7 +815,8 @@ public class UMLDiagramContentInitializer {
*/
private void createInterface_3087Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getInterface_3087OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getInterface_3087OutgoingLinks(view));
}
/**
@@ -732,7 +824,8 @@ public class UMLDiagramContentInitializer {
*/
private void createPrimitiveType_3078Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getPrimitiveType_3078OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getPrimitiveType_3078OutgoingLinks(view));
}
/**
@@ -740,10 +833,12 @@ public class UMLDiagramContentInitializer {
*/
private void createEnumeration_3079Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getEnumeration_3079OutgoingLinks(view));
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getEnumeration_3079SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getEnumeration_3079OutgoingLinks(view));
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getEnumeration_3079SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
createEnumerationLiterals_7049Children(getCompartment(view, EnumerationEnumerationLiteralCompartmentEditPartCN.VISUAL_ID));
}
@@ -753,7 +848,8 @@ public class UMLDiagramContentInitializer {
*/
private void createDataType_3080Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getDataType_3080OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getDataType_3080OutgoingLinks(view));
createDataTypeAttributes_7036Children(getCompartment(view, DataTypeAttributeCompartmentEditPartCN.VISUAL_ID));
createDataTypeOperations_7037Children(getCompartment(view, DataTypeOperationCompartmentEditPartCN.VISUAL_ID));
}
@@ -763,7 +859,8 @@ public class UMLDiagramContentInitializer {
*/
private void createActor_3091Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getActor_3091OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getActor_3091OutgoingLinks(view));
}
/**
@@ -771,7 +868,8 @@ public class UMLDiagramContentInitializer {
*/
private void createDeploymentSpecification_3092Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getDeploymentSpecification_3092OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getDeploymentSpecification_3092OutgoingLinks(view));
}
/**
@@ -779,7 +877,8 @@ public class UMLDiagramContentInitializer {
*/
private void createArtifact_3093Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getArtifact_3093OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getArtifact_3093OutgoingLinks(view));
}
/**
@@ -787,7 +886,8 @@ public class UMLDiagramContentInitializer {
*/
private void createInformationItem_3094Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getInformationItem_3094OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getInformationItem_3094OutgoingLinks(view));
}
/**
@@ -795,7 +895,8 @@ public class UMLDiagramContentInitializer {
*/
private void createSignal_3095Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getSignal_3095OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getSignal_3095OutgoingLinks(view));
}
/**
@@ -803,7 +904,8 @@ public class UMLDiagramContentInitializer {
*/
private void createUseCase_3096Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getUseCase_3096OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getUseCase_3096OutgoingLinks(view));
}
/**
@@ -811,7 +913,8 @@ public class UMLDiagramContentInitializer {
*/
private void createComment_3097Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getComment_3097OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getComment_3097OutgoingLinks(view));
}
/**
@@ -819,7 +922,8 @@ public class UMLDiagramContentInitializer {
*/
private void createDurationConstraint_3116Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getDurationConstraint_3116OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getDurationConstraint_3116OutgoingLinks(view));
}
/**
@@ -827,7 +931,8 @@ public class UMLDiagramContentInitializer {
*/
private void createTimeConstraint_3117Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getTimeConstraint_3117OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getTimeConstraint_3117OutgoingLinks(view));
}
/**
@@ -835,7 +940,8 @@ public class UMLDiagramContentInitializer {
*/
private void createIntervalConstraint_3118Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getIntervalConstraint_3118OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getIntervalConstraint_3118OutgoingLinks(view));
}
/**
@@ -843,7 +949,8 @@ public class UMLDiagramContentInitializer {
*/
private void createInteractionConstraint_3119Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getInteractionConstraint_3119OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getInteractionConstraint_3119OutgoingLinks(view));
}
/**
@@ -851,7 +958,8 @@ public class UMLDiagramContentInitializer {
*/
private void createConstraint_3120Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getConstraint_3120OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getConstraint_3120OutgoingLinks(view));
}
/**
@@ -859,7 +967,8 @@ public class UMLDiagramContentInitializer {
*/
private void createProperty_3101Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getProperty_3101OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getProperty_3101OutgoingLinks(view));
}
/**
@@ -867,7 +976,8 @@ public class UMLDiagramContentInitializer {
*/
private void createOperation_3102Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getOperation_3102OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getOperation_3102OutgoingLinks(view));
}
/**
@@ -875,16 +985,18 @@ public class UMLDiagramContentInitializer {
*/
private void createEnumerationLiteral_3066Children(View view) {
myDomain2NotationMap.put(view.getElement(), view);
- myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getEnumerationLiteral_3066OutgoingLinks(view));
+ myLinkDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getEnumerationLiteral_3066OutgoingLinks(view));
}
/**
* @generated
*/
private void createDataTypeAttributes_7033Children(View view) {
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getDataTypeAttributes_7033SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getDataTypeAttributes_7033SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
}
@@ -892,9 +1004,10 @@ public class UMLDiagramContentInitializer {
* @generated
*/
private void createDataTypeOperations_7034Children(View view) {
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getDataTypeOperations_7034SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getDataTypeOperations_7034SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
}
@@ -902,9 +1015,10 @@ public class UMLDiagramContentInitializer {
* @generated
*/
private void createDataTypeAttributes_7036Children(View view) {
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getDataTypeAttributes_7036SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getDataTypeAttributes_7036SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
}
@@ -912,9 +1026,10 @@ public class UMLDiagramContentInitializer {
* @generated
*/
private void createDataTypeOperations_7037Children(View view) {
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getDataTypeOperations_7037SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getDataTypeOperations_7037SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
}
@@ -922,9 +1037,10 @@ public class UMLDiagramContentInitializer {
* @generated
*/
private void createEnumerationLiterals_7048Children(View view) {
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getEnumerationLiterals_7048SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getEnumerationLiterals_7048SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
}
@@ -932,9 +1048,10 @@ public class UMLDiagramContentInitializer {
* @generated
*/
private void createEnumerationLiterals_7049Children(View view) {
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getEnumerationLiterals_7049SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getEnumerationLiterals_7049SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
}
@@ -942,9 +1059,10 @@ public class UMLDiagramContentInitializer {
* @generated
*/
private void createActivityInternalstructure_7050Children(View view) {
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getActivityInternalstructure_7050SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getActivityInternalstructure_7050SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
}
@@ -952,9 +1070,10 @@ public class UMLDiagramContentInitializer {
* @generated
*/
private void createInteractionInternalstructure_7051Children(View view) {
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getInteractionInternalstructure_7051SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getInteractionInternalstructure_7051SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
}
@@ -962,9 +1081,10 @@ public class UMLDiagramContentInitializer {
* @generated
*/
private void createProtocolStateMachineInternalstructure_7052Children(View view) {
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getProtocolStateMachineInternalstructure_7052SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getProtocolStateMachineInternalstructure_7052SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
}
@@ -972,9 +1092,10 @@ public class UMLDiagramContentInitializer {
* @generated
*/
private void createStateMachineInternalstructure_7053Children(View view) {
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getStateMachineInternalstructure_7053SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getStateMachineInternalstructure_7053SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
}
@@ -982,9 +1103,10 @@ public class UMLDiagramContentInitializer {
* @generated
*/
private void createFunctionBehaviorInternalstructure_7054Children(View view) {
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getFunctionBehaviorInternalstructure_7054SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getFunctionBehaviorInternalstructure_7054SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
}
@@ -992,9 +1114,10 @@ public class UMLDiagramContentInitializer {
* @generated
*/
private void createOpaqueBehaviorInternalstructure_7055Children(View view) {
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getOpaqueBehaviorInternalstructure_7055SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getOpaqueBehaviorInternalstructure_7055SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
}
@@ -1002,9 +1125,10 @@ public class UMLDiagramContentInitializer {
* @generated
*/
private void createComponentInternalstructure_7056Children(View view) {
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getComponentInternalstructure_7056SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getComponentInternalstructure_7056SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
}
@@ -1012,9 +1136,10 @@ public class UMLDiagramContentInitializer {
* @generated
*/
private void createDeviceInternalstructure_7057Children(View view) {
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getDeviceInternalstructure_7057SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getDeviceInternalstructure_7057SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
}
@@ -1022,9 +1147,10 @@ public class UMLDiagramContentInitializer {
* @generated
*/
private void createExecutionEnvironmentInternalstructure_7058Children(View view) {
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getExecutionEnvironmentInternalstructure_7058SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getExecutionEnvironmentInternalstructure_7058SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
}
@@ -1032,9 +1158,10 @@ public class UMLDiagramContentInitializer {
* @generated
*/
private void createNodeInternalstructure_7059Children(View view) {
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getNodeInternalstructure_7059SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getNodeInternalstructure_7059SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
}
@@ -1042,9 +1169,10 @@ public class UMLDiagramContentInitializer {
* @generated
*/
private void createClassInternalstructure_7060Children(View view) {
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getClassInternalstructure_7060SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getClassInternalstructure_7060SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
}
@@ -1052,9 +1180,10 @@ public class UMLDiagramContentInitializer {
* @generated
*/
private void createCollaborationInternalstructure_7061Children(View view) {
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getCollaborationInternalstructure_7061SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getCollaborationInternalstructure_7061SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
}
@@ -1062,9 +1191,10 @@ public class UMLDiagramContentInitializer {
* @generated
*/
private void createActivityInternalstructure_7063Children(View view) {
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getActivityInternalstructure_7063SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getActivityInternalstructure_7063SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
}
@@ -1072,9 +1202,10 @@ public class UMLDiagramContentInitializer {
* @generated
*/
private void createInteractionInternalstructure_7064Children(View view) {
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getInteractionInternalstructure_7064SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getInteractionInternalstructure_7064SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
}
@@ -1082,9 +1213,10 @@ public class UMLDiagramContentInitializer {
* @generated
*/
private void createProtocolStateMachineInternalstructure_7065Children(View view) {
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getProtocolStateMachineInternalstructure_7065SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getProtocolStateMachineInternalstructure_7065SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
}
@@ -1092,9 +1224,10 @@ public class UMLDiagramContentInitializer {
* @generated
*/
private void createStateMachineInternalstructure_7066Children(View view) {
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getStateMachineInternalstructure_7066SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getStateMachineInternalstructure_7066SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
}
@@ -1102,9 +1235,10 @@ public class UMLDiagramContentInitializer {
* @generated
*/
private void createFunctionBehaviorInternalstructure_7067Children(View view) {
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getFunctionBehaviorInternalstructure_7067SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getFunctionBehaviorInternalstructure_7067SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
}
@@ -1112,9 +1246,10 @@ public class UMLDiagramContentInitializer {
* @generated
*/
private void createOpaqueBehaviorInternalstructure_7068Children(View view) {
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getOpaqueBehaviorInternalstructure_7068SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getOpaqueBehaviorInternalstructure_7068SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
}
@@ -1122,9 +1257,10 @@ public class UMLDiagramContentInitializer {
* @generated
*/
private void createComponentInternalstructure_7069Children(View view) {
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getComponentInternalstructure_7069SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getComponentInternalstructure_7069SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
}
@@ -1132,9 +1268,10 @@ public class UMLDiagramContentInitializer {
* @generated
*/
private void createDeviceInternalstructure_7070Children(View view) {
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getDeviceInternalstructure_7070SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getDeviceInternalstructure_7070SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
}
@@ -1142,9 +1279,10 @@ public class UMLDiagramContentInitializer {
* @generated
*/
private void createExecutionEnvironmentInternalstructure_7071Children(View view) {
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getExecutionEnvironmentInternalstructure_7071SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getExecutionEnvironmentInternalstructure_7071SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
}
@@ -1152,9 +1290,10 @@ public class UMLDiagramContentInitializer {
* @generated
*/
private void createNodeInternalstructure_7072Children(View view) {
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getNodeInternalstructure_7072SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getNodeInternalstructure_7072SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
}
@@ -1162,9 +1301,10 @@ public class UMLDiagramContentInitializer {
* @generated
*/
private void createClassInternalstructure_7073Children(View view) {
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getClassInternalstructure_7073SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getClassInternalstructure_7073SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
}
@@ -1172,9 +1312,10 @@ public class UMLDiagramContentInitializer {
* @generated
*/
private void createCollaborationInternalstructure_7075Children(View view) {
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getCollaborationInternalstructure_7075SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getCollaborationInternalstructure_7075SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
}
@@ -1182,9 +1323,10 @@ public class UMLDiagramContentInitializer {
* @generated
*/
private void createPropertyInternalstructure_7077Children(View view) {
- Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE.getPropertyInternalstructure_7077SemanticChildren(view);
- for(Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
- createNode(view, (UMLNodeDescriptor)it.next());
+ Collection childNodeDescriptors = UMLDiagramUpdater.INSTANCE
+ .getPropertyInternalstructure_7077SemanticChildren(view);
+ for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
+ createNode(view, (UMLNodeDescriptor) it.next());
}
}
@@ -1194,7 +1336,7 @@ public class UMLDiagramContentInitializer {
private void createNode(View parentView, UMLNodeDescriptor nodeDescriptor) {
final String nodeType = UMLVisualIDRegistry.getType(nodeDescriptor.getVisualID());
Node node = ViewService.createNode(parentView, nodeDescriptor.getModelElement(), nodeType, UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
- switch(nodeDescriptor.getVisualID()) {
+ switch (nodeDescriptor.getVisualID()) {
case ActivityCompositeEditPart.VISUAL_ID:
createActivity_2060Children(node);
return;
@@ -1457,63 +1599,76 @@ public class UMLDiagramContentInitializer {
* @generated
*/
private void createLinks(Diagram diagram) {
- for(boolean continueLinkCreation = true; continueLinkCreation;) {
+ for (boolean continueLinkCreation = true; continueLinkCreation;) {
continueLinkCreation = false;
Collection additionalDescriptors = new LinkedList();
- for(Iterator it = myLinkDescriptors.iterator(); it.hasNext();) {
- UMLLinkDescriptor nextLinkDescriptor = (UMLLinkDescriptor)it.next();
- if(!myDomain2NotationMap.containsKey(nextLinkDescriptor.getSource()) || !myDomain2NotationMap.containsKey(nextLinkDescriptor.getDestination())) {
+ for (Iterator it = myLinkDescriptors.iterator(); it.hasNext();) {
+ UMLLinkDescriptor nextLinkDescriptor = (UMLLinkDescriptor) it.next();
+ if (!myDomain2NotationMap.containsKey(nextLinkDescriptor.getSource()) || !myDomain2NotationMap.containsKey(nextLinkDescriptor.getDestination())) {
continue;
}
final String linkType = UMLVisualIDRegistry.getType(nextLinkDescriptor.getVisualID());
Edge edge = ViewService.getInstance().createEdge(nextLinkDescriptor.getSemanticAdapter(), diagram, linkType, ViewUtil.APPEND, true, UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
- if(edge != null) {
- edge.setSource((View)myDomain2NotationMap.get(nextLinkDescriptor.getSource()));
- edge.setTarget((View)myDomain2NotationMap.get(nextLinkDescriptor.getDestination()));
+ if (edge != null) {
+ edge.setSource((View) myDomain2NotationMap.get(nextLinkDescriptor.getSource()));
+ edge.setTarget((View) myDomain2NotationMap.get(nextLinkDescriptor.getDestination()));
it.remove();
- if(nextLinkDescriptor.getModelElement() != null) {
+ if (nextLinkDescriptor.getModelElement() != null) {
myDomain2NotationMap.put(nextLinkDescriptor.getModelElement(), edge);
}
continueLinkCreation = true;
- switch(nextLinkDescriptor.getVisualID()) {
+ switch (nextLinkDescriptor.getVisualID()) {
case ComponentRealizationEditPart.VISUAL_ID:
- additionalDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getComponentRealization_4004OutgoingLinks(edge));
+ additionalDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getComponentRealization_4004OutgoingLinks(edge));
break;
case InterfaceRealizationEditPart.VISUAL_ID:
- additionalDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getInterfaceRealization_4005OutgoingLinks(edge));
+ additionalDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getInterfaceRealization_4005OutgoingLinks(edge));
break;
case SubstitutionEditPart.VISUAL_ID:
- additionalDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getSubstitution_4011OutgoingLinks(edge));
+ additionalDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getSubstitution_4011OutgoingLinks(edge));
break;
case RealizationEditPart.VISUAL_ID:
- additionalDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getRealization_4006OutgoingLinks(edge));
+ additionalDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getRealization_4006OutgoingLinks(edge));
break;
case ManifestationEditPart.VISUAL_ID:
- additionalDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getManifestation_4012OutgoingLinks(edge));
+ additionalDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getManifestation_4012OutgoingLinks(edge));
break;
case AbstractionEditPart.VISUAL_ID:
- additionalDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getAbstraction_4007OutgoingLinks(edge));
+ additionalDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getAbstraction_4007OutgoingLinks(edge));
break;
case UsageEditPart.VISUAL_ID:
- additionalDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getUsage_4008OutgoingLinks(edge));
+ additionalDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getUsage_4008OutgoingLinks(edge));
break;
case DeploymentEditPart.VISUAL_ID:
- additionalDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getDeployment_4009OutgoingLinks(edge));
+ additionalDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getDeployment_4009OutgoingLinks(edge));
break;
case RoleBindingEditPart.VISUAL_ID:
- additionalDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getDependency_4017OutgoingLinks(edge));
+ additionalDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getDependency_4017OutgoingLinks(edge));
break;
case DependencyEditPart.VISUAL_ID:
- additionalDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getDependency_4010OutgoingLinks(edge));
+ additionalDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getDependency_4010OutgoingLinks(edge));
break;
case ConnectorEditPart.VISUAL_ID:
- additionalDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getConnector_4013OutgoingLinks(edge));
+ additionalDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getConnector_4013OutgoingLinks(edge));
break;
case GeneralizationEditPart.VISUAL_ID:
- additionalDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getGeneralization_4015OutgoingLinks(edge));
+ additionalDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getGeneralization_4015OutgoingLinks(edge));
break;
case InformationFlowEditPart.VISUAL_ID:
- additionalDescriptors.addAll(UMLDiagramUpdater.INSTANCE.getInformationFlow_4021OutgoingLinks(edge));
+ additionalDescriptors.addAll(UMLDiagramUpdater.INSTANCE
+ .getInformationFlow_4021OutgoingLinks(edge));
break;
}
}
@@ -1527,10 +1682,10 @@ public class UMLDiagramContentInitializer {
*/
private Node getCompartment(View node, int visualID) {
String type = UMLVisualIDRegistry.getType(visualID);
- for(Iterator it = node.getChildren().iterator(); it.hasNext();) {
- View nextView = (View)it.next();
- if(nextView instanceof Node && type.equals(nextView.getType())) {
- return (Node)nextView;
+ for (Iterator it = node.getChildren().iterator(); it.hasNext();) {
+ View nextView = (View) it.next();
+ if (nextView instanceof Node && type.equals(nextView.getType())) {
+ return (Node) nextView;
}
}
return null;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLDiagramEditor.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLDiagramEditor.java
index 2af9285d2a2..efd00834a64 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLDiagramEditor.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLDiagramEditor.java
@@ -102,13 +102,17 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
*/
public UMLDiagramEditor(ServicesRegistry servicesRegistry, Diagram diagram) throws ServiceException {
super(servicesRegistry, diagram);
+
// adds a listener to the palette service, which reacts to palette customizations
PapyrusPaletteService.getInstance().addProviderChangeListener(this);
+
// Share the same editing provider
editingDomain = servicesRegistry.getService(TransactionalEditingDomain.class);
documentProvider = new GmfMultiDiagramDocumentProvider(editingDomain);
+
// overrides editing domain created by super constructor
setDocumentProvider(documentProvider);
+
}
/**
@@ -123,7 +127,7 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
*/
protected PaletteRoot createPaletteRoot(PaletteRoot existingPaletteRoot) {
PaletteRoot paletteRoot;
- if(existingPaletteRoot == null) {
+ if (existingPaletteRoot == null) {
paletteRoot = PapyrusPaletteService.getInstance().createPalette(this, getDefaultPaletteContent());
} else {
PapyrusPaletteService.getInstance().updatePalette(existingPaletteRoot, this, getDefaultPaletteContent());
@@ -247,7 +251,7 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
* @generated
*/
protected OperationHistoryDirtyState getDirtyState() {
- if(dirtyState == null) {
+ if (dirtyState == null) {
dirtyState = OperationHistoryDirtyState.newInstance(getUndoContext(), getOperationHistory());
}
return dirtyState;
@@ -257,10 +261,11 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
* @generated
*/
protected void setUndoContext(IUndoContext context) {
- if(dirtyState != null) {
+ if (dirtyState != null) {
dirtyState.dispose();
dirtyState = null;
}
+
super.setUndoContext(context);
}
@@ -276,8 +281,9 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
*/
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());
+ if (PapyrusPaletteService.getInstance().equals(event.getSource())) {
+ PapyrusPaletteService.getInstance().updatePalette(getPaletteViewer().getPaletteRoot(), this,
+ getDefaultPaletteContent());
}
}
@@ -288,10 +294,12 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
// remove palette service listener
// remove preference listener
PapyrusPaletteService.getInstance().removeProviderChangeListener(this);
- if(dirtyState != null) {
+
+ if (dirtyState != null) {
dirtyState.dispose();
dirtyState = null;
}
+
super.dispose();
}
@@ -326,10 +334,13 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
@Override
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
@@ -351,7 +362,9 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
* @return Palette Key Handler for the palette
*/
private KeyHandler getPaletteKeyHandler() {
- if(paletteKeyHandler == null) {
+
+ if (paletteKeyHandler == null) {
+
paletteKeyHandler = new KeyHandler() {
/**
@@ -366,18 +379,27 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
*/
@Override
public boolean keyReleased(KeyEvent event) {
- if(event.keyCode == SWT.Selection) {
+
+ if (event.keyCode == SWT.Selection) {
+
Tool tool = getPaletteViewer().getActiveTool().createTool();
- if(toolSupportsAccessibility(tool)) {
+
+ if (toolSupportsAccessibility(tool)) {
+
tool.keyUp(event, getDiagramGraphicalViewer());
+
// deactivate current selection
getPaletteViewer().setActiveTool(null);
+
return true;
}
+
}
return super.keyReleased(event);
}
+
};
+
}
return paletteKeyHandler;
}
@@ -386,7 +408,9 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
* @return Palette Mouse listener for the palette
*/
private MouseListener getPaletteMouseListener() {
- if(paletteMouseListener == null) {
+
+ if (paletteMouseListener == null) {
+
paletteMouseListener = new MouseListener() {
/**
@@ -404,10 +428,13 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
@Override
public void mouseDoubleClick(MouseEvent e) {
Tool tool = getPaletteViewer().getActiveTool().createTool();
- if(toolSupportsAccessibility(tool)) {
+
+ 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
@@ -425,15 +452,18 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
public void mouseUp(MouseEvent e) {
// Deactivate current active tool here if a
// double-click was handled.
- if(clearActiveTool) {
+ if (clearActiveTool) {
getPaletteViewer().setActiveTool(null);
clearActiveTool = false;
}
+
}
};
+
}
return paletteMouseListener;
}
+
};
}
@@ -451,20 +481,23 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
@Override
protected void initializeGraphicalViewer() {
super.initializeGraphicalViewer();
+
// Enable Drop
- getDiagramGraphicalViewer().addDropTargetListener(new DropTargetListener(getDiagramGraphicalViewer(), LocalSelectionTransfer.getTransfer()) {
+ getDiagramGraphicalViewer().addDropTargetListener(
+ new DropTargetListener(getDiagramGraphicalViewer(), LocalSelectionTransfer.getTransfer()) {
- @Override
- protected Object getJavaObject(TransferData data) {
- // It is usual for the transfer data not to be set because it is available locally
- return LocalSelectionTransfer.getTransfer().getSelection();
- }
+ @Override
+ protected Object getJavaObject(TransferData data) {
+ // It is usual for the transfer data not to be set because it is available locally
+ return LocalSelectionTransfer.getTransfer().getSelection();
+ }
+
+ @Override
+ protected TransactionalEditingDomain getTransactionalEditingDomain() {
+ return getEditingDomain();
+ }
+ });
- @Override
- protected TransactionalEditingDomain getTransactionalEditingDomain() {
- return getEditingDomain();
- }
- });
}
/**
@@ -472,10 +505,10 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
*/
@Override
public void selectionChanged(IWorkbenchPart part, ISelection selection) {
- if(getSite().getPage().getActiveEditor() instanceof IMultiDiagramEditor) {
- IMultiDiagramEditor editor = (IMultiDiagramEditor)getSite().getPage().getActiveEditor();
+ 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())) {
+ if (this.equals(editor.getActiveEditor())) {
updateActions(getSelectionActions());
super.selectionChanged(part, selection);
} else {
@@ -487,7 +520,7 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
// from
// org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor.selectionChanged(IWorkbenchPart,
// ISelection)
- if(part == this) {
+ if (part == this) {
rebuildStatusLine();
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLDiagramEditorPlugin.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLDiagramEditorPlugin.java
index 85e3758211e..6380d3c3e3c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLDiagramEditorPlugin.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLDiagramEditorPlugin.java
@@ -91,6 +91,7 @@ public class UMLDiagramEditorPlugin extends AbstractUIPlugin {
adapterFactory = Activator.getInstance().getItemProvidersAdapterFactory();
DiagramPreferenceInitializer diagramPreferenceInitializer = new DiagramPreferenceInitializer();
diagramPreferenceInitializer.initializeDefaultPreferences();
+
}
/**
@@ -130,9 +131,11 @@ public class UMLDiagramEditorPlugin extends AbstractUIPlugin {
* @generated
*/
public ImageDescriptor getItemImageDescriptor(Object item) {
- IItemLabelProvider labelProvider = (IItemLabelProvider)adapterFactory.adapt(item, IItemLabelProvider.class);
- if(labelProvider != null) {
- return ExtendedImageRegistry.getInstance().getImageDescriptor(labelProvider.getImage(item));
+ IItemLabelProvider labelProvider = (IItemLabelProvider) adapterFactory.adapt(
+ item, IItemLabelProvider.class);
+ if (labelProvider != null) {
+ return ExtendedImageRegistry.getInstance().getImageDescriptor(
+ labelProvider.getImage(item));
}
return null;
}
@@ -142,7 +145,8 @@ public class UMLDiagramEditorPlugin extends AbstractUIPlugin {
* plug-in relative path.
*
* @generated
- * @param path the path
+ * @param path
+ * the path
* @return the image descriptor
*/
public static ImageDescriptor getBundledImageDescriptor(String path) {
@@ -155,13 +159,15 @@ public class UMLDiagramEditorPlugin extends AbstractUIPlugin {
* 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
+ * @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());
+ if (p.isAbsolute() && p.segmentCount() > 1) {
+ return AbstractUIPlugin.imageDescriptorFromPlugin(
+ p.segment(0), p.removeFirstSegments(1).makeAbsolute().toString());
} else {
return getBundledImageDescriptor(p.makeAbsolute().toString());
}
@@ -172,12 +178,13 @@ public class UMLDiagramEditorPlugin extends AbstractUIPlugin {
* Client do not need to dispose this image. Images will be disposed automatically.
*
* @generated
- * @param path the path
+ * @param path
+ * the path
* @return image instance
*/
public Image getBundledImage(String path) {
Image image = getImageRegistry().get(path);
- if(image == null) {
+ if (image == null) {
getImageRegistry().put(path, getBundledImageDescriptor(path));
image = getImageRegistry().get(path);
}
@@ -190,14 +197,15 @@ public class UMLDiagramEditorPlugin extends AbstractUIPlugin {
* @generated
*/
public static String getString(String key) {
- return Platform.getResourceString(getInstance().getBundle(), "%" + key); //$NON-NLS-1$
+ return Platform.getResourceString(
+ getInstance().getBundle(), "%" + key); //$NON-NLS-1$
}
/**
* @generated
*/
public UMLDocumentProvider getDocumentProvider() {
- if(documentProvider == null) {
+ if (documentProvider == null) {
documentProvider = new UMLDocumentProvider();
}
return documentProvider;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLDiagramEditorUtil.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLDiagramEditorUtil.java
index a7e17ba0c92..96f62a533eb 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLDiagramEditorUtil.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLDiagramEditorUtil.java
@@ -85,9 +85,9 @@ public class UMLDiagramEditorUtil {
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) {
+ if (workspaceResource instanceof IFile) {
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- return null != page.openEditor(new FileEditorInput((IFile)workspaceResource), UMLDiagramEditor.ID);
+ return null != page.openEditor(new FileEditorInput((IFile) workspaceResource), UMLDiagramEditor.ID);
}
return false;
}
@@ -96,7 +96,7 @@ public class UMLDiagramEditorUtil {
* @generated
*/
public static void setCharset(IFile file) {
- if(file == null) {
+ if (file == null) {
return;
}
try {
@@ -110,7 +110,8 @@ public class UMLDiagramEditorUtil {
* @generated
*/
public static String getUniqueFileName(IPath containerFullPath, String fileName, String extension) {
- return DefaultDiagramEditorUtil.getUniqueFileName(containerFullPath, fileName, extension, DefaultDiagramEditorUtil.EXISTS_IN_WORKSPACE);
+ return DefaultDiagramEditorUtil.getUniqueFileName(containerFullPath, fileName, extension,
+ DefaultDiagramEditorUtil.EXISTS_IN_WORKSPACE);
}
/**
@@ -121,7 +122,7 @@ public class UMLDiagramEditorUtil {
public static void runWizard(Shell shell, Wizard wizard, String settingsKey) {
IDialogSettings pluginDialogSettings = UMLDiagramEditorPlugin.getInstance().getDialogSettings();
IDialogSettings wizardDialogSettings = pluginDialogSettings.getSection(settingsKey);
- if(wizardDialogSettings == null) {
+ if (wizardDialogSettings == null) {
wizardDialogSettings = pluginDialogSettings.addNewSection(settingsKey);
}
wizard.setDialogSettings(wizardDialogSettings);
@@ -133,6 +134,7 @@ public class UMLDiagramEditorUtil {
/**
* 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) {
@@ -142,21 +144,25 @@ public class UMLDiagramEditorUtil {
final Resource modelResource = editingDomain.getResourceSet().createResource(modelURI);
final String diagramName = diagramURI.lastSegment();
AbstractTransactionalCommand command = new AbstractTransactionalCommand(editingDomain, Messages.UMLDiagramEditorUtil_CreateDiagramCommandLabel, Collections.EMPTY_LIST) {
-
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
Package model = createInitialModel();
attachModelToResource(model, modelResource);
- Diagram diagram = ViewService.createDiagram(model, CompositeStructureDiagramEditPart.MODEL_ID, UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
- if(diagram != null) {
+
+ Diagram diagram = ViewService.createDiagram(
+ model,
+ CompositeStructureDiagramEditPart.MODEL_ID, UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
+ if (diagram != null) {
diagramResource.getContents().add(diagram);
diagram.setName(diagramName);
diagram.setElement(model);
}
+
try {
modelResource.save(org.eclipse.papyrus.uml.diagram.composite.part.UMLDiagramEditorUtil.getSaveOptions());
diagramResource.save(org.eclipse.papyrus.uml.diagram.composite.part.UMLDiagramEditorUtil.getSaveOptions());
} catch (IOException e) {
+
UMLDiagramEditorPlugin.getInstance().logError("Unable to store model and diagram resources", e); //$NON-NLS-1$
}
return CommandResult.newOKCommandResult();
@@ -176,6 +182,7 @@ public class UMLDiagramEditorUtil {
* Create a new instance of domain element associated with canvas.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
private static Package createInitialModel() {
@@ -186,6 +193,7 @@ public class UMLDiagramEditorUtil {
* Store model element in the resource.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
private static void attachModelToResource(Package model, Resource resource) {
@@ -197,15 +205,17 @@ public class UMLDiagramEditorUtil {
*/
public static void selectElementsInDiagram(IDiagramWorkbenchPart diagramPart, List<EditPart> editParts) {
diagramPart.getDiagramGraphicalViewer().deselectAll();
+
EditPart firstPrimary = null;
- for(EditPart nextPart : editParts) {
+ for (EditPart nextPart : editParts) {
diagramPart.getDiagramGraphicalViewer().appendSelection(nextPart);
- if(firstPrimary == null && nextPart instanceof IPrimaryEditPart) {
+ if (firstPrimary == null && nextPart instanceof IPrimaryEditPart) {
firstPrimary = nextPart;
}
}
- if(!editParts.isEmpty()) {
- diagramPart.getDiagramGraphicalViewer().reveal(firstPrimary != null ? firstPrimary : (EditPart)editParts.get(0));
+
+ if (!editParts.isEmpty()) {
+ diagramPart.getDiagramGraphicalViewer().reveal(firstPrimary != null ? firstPrimary : (EditPart) editParts.get(0));
}
}
@@ -213,33 +223,36 @@ public class UMLDiagramEditorUtil {
* @generated
*/
private static int findElementsInDiagramByID(DiagramEditPart diagramPart, EObject element, List<EditPart> editPartCollector) {
- IDiagramGraphicalViewer viewer = (IDiagramGraphicalViewer)diagramPart.getViewer();
+ 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) {
+
+ 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) {
+ for (EditPart nextPart : associatedParts) {
EditPart parentPart = nextPart.getParent();
- while(parentPart != null && !associatedParts.contains(parentPart)) {
+ while (parentPart != null && !associatedParts.contains(parentPart)) {
parentPart = parentPart.getParent();
}
- if(parentPart == null) {
+ if (parentPart == null) {
editPartCollector.add(nextPart);
}
}
- if(intialNumOfEditParts == editPartCollector.size()) {
- if(!associatedParts.isEmpty()) {
+
+ if (intialNumOfEditParts == editPartCollector.size()) {
+ if (!associatedParts.isEmpty()) {
editPartCollector.add(associatedParts.get(0));
} else {
- if(element.eContainer() != null) {
+ if (element.eContainer() != null) {
return findElementsInDiagramByID(diagramPart, element.eContainer(), editPartCollector);
}
}
@@ -252,22 +265,25 @@ public class UMLDiagramEditorUtil {
*/
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;
+ 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()) {
+ if (hasStructuralURI && !lazyElement2ViewMap.getElement2ViewMap().isEmpty()) {
view = lazyElement2ViewMap.getElement2ViewMap().get(targetElement);
- } else if(findElementsInDiagramByID(diagramEditPart, targetElement, editPartHolder) > 0) {
+ } else if (findElementsInDiagramByID(diagramEditPart, targetElement, editPartHolder) > 0) {
EditPart editPart = editPartHolder.get(0);
- view = editPart.getModel() instanceof View ? (View)editPart.getModel() : null;
+ view = editPart.getModel() instanceof View ? (View) editPart.getModel() : null;
}
+
return (view == null) ? diagramEditPart.getDiagramView() : view;
}
/**
* XXX This is quite suspicious code (especially editPartTmpHolder) and likely to be removed soon
+ *
* @generated
*/
public static class LazyElement2ViewMap {
@@ -299,17 +315,18 @@ public class UMLDiagramEditorUtil {
* @generated
*/
public final Map<EObject, View> getElement2ViewMap() {
- if(element2ViewMap == null) {
+ 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()) {
+ 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;
@@ -319,26 +336,27 @@ public class UMLDiagramEditorUtil {
* @generated
*/
private static boolean buildElement2ViewMap(View parentView, Map<EObject, View> element2ViewMap, Set<? extends EObject> elements) {
- if(elements.size() == element2ViewMap.size()) {
+ if (elements.size() == element2ViewMap.size()) {
return true;
}
- if(parentView.isSetElement() && !element2ViewMap.containsKey(parentView.getElement()) && elements.contains(parentView.getElement())) {
+
+ if (parentView.isSetElement() && !element2ViewMap.containsKey(parentView.getElement()) && elements.contains(parentView.getElement())) {
element2ViewMap.put(parentView.getElement(), parentView);
- if(elements.size() == element2ViewMap.size()) {
+ 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.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.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);
+ for (Iterator<?> it = parentView.getTargetEdges().iterator(); it.hasNext() && !complete;) {
+ complete = buildElement2ViewMap((View) it.next(), element2ViewMap, elements);
}
return complete;
}
- } //LazyElement2ViewMap
+ } // LazyElement2ViewMap
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLDiagramUpdater.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLDiagramUpdater.java
index fac5229247b..1ec541bfaf4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLDiagramUpdater.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLDiagramUpdater.java
@@ -117,14 +117,14 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
protected UMLDiagramUpdater() {
- //to prevent instantiation allowing the override
+ // to prevent instantiation allowing the override
}
/**
* @generated
*/
public List<UMLNodeDescriptor> getSemanticChildren(View view) {
- switch(UMLVisualIDRegistry.getVisualID(view)) {
+ switch (UMLVisualIDRegistry.getVisualID(view)) {
case CompositeStructureDiagramEditPart.VISUAL_ID:
return getPackage_1000SemanticChildren(view);
case ActivityCompositeEditPart.VISUAL_ID:
@@ -247,215 +247,218 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getPackage_1000SemanticChildren(View view) {
- if(!view.isSetElement()) {
+ if (!view.isSetElement()) {
return Collections.emptyList();
}
- Package modelElement = (Package)view.getElement();
+ Package modelElement = (Package) view.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getPackagedElements().iterator(); it.hasNext();) {
- PackageableElement childElement = (PackageableElement)it.next();
+ for (Iterator<?> it = modelElement.getPackagedElements()
+ .iterator(); it.hasNext();) {
+ PackageableElement childElement = (PackageableElement) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ActivityCompositeEditPart.VISUAL_ID) {
+ if (visualID == ActivityCompositeEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionCompositeEditPart.VISUAL_ID) {
+ if (visualID == InteractionCompositeEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ProtocolStateMachineCompositeEditPart.VISUAL_ID) {
+ if (visualID == ProtocolStateMachineCompositeEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == StateMachineCompositeEditPart.VISUAL_ID) {
+ if (visualID == StateMachineCompositeEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == FunctionBehaviorCompositeEditPart.VISUAL_ID) {
+ if (visualID == FunctionBehaviorCompositeEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == OpaqueBehaviorCompositeEditPart.VISUAL_ID) {
+ if (visualID == OpaqueBehaviorCompositeEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ComponentCompositeEditPart.VISUAL_ID) {
+ if (visualID == ComponentCompositeEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeviceCompositeEditPart.VISUAL_ID) {
+ if (visualID == DeviceCompositeEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ExecutionEnvironmentCompositeEditPart.VISUAL_ID) {
+ if (visualID == ExecutionEnvironmentCompositeEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == NodeCompositeEditPart.VISUAL_ID) {
+ if (visualID == NodeCompositeEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ClassCompositeEditPart.VISUAL_ID) {
+ if (visualID == ClassCompositeEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == CollaborationCompositeEditPart.VISUAL_ID) {
+ if (visualID == CollaborationCompositeEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InterfaceEditPart.VISUAL_ID) {
+ if (visualID == InterfaceEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == PrimitiveTypeEditPart.VISUAL_ID) {
+ if (visualID == PrimitiveTypeEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == EnumerationEditPart.VISUAL_ID) {
+ if (visualID == EnumerationEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DataTypeEditPart.VISUAL_ID) {
+ if (visualID == DataTypeEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ActorEditPart.VISUAL_ID) {
+ if (visualID == ActorEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeploymentSpecificationEditPart.VISUAL_ID) {
+ if (visualID == DeploymentSpecificationEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ArtifactEditPart.VISUAL_ID) {
+ if (visualID == ArtifactEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InformationItemEditPart.VISUAL_ID) {
+ if (visualID == InformationItemEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == SignalEditPart.VISUAL_ID) {
+ if (visualID == SignalEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == UseCaseEditPart.VISUAL_ID) {
+ if (visualID == UseCaseEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == SignalEventEditPart.VISUAL_ID) {
+ if (visualID == SignalEventEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == CallEventEditPart.VISUAL_ID) {
+ if (visualID == CallEventEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == AnyReceiveEventEditPart.VISUAL_ID) {
+ if (visualID == AnyReceiveEventEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ChangeEventEditPart.VISUAL_ID) {
+ if (visualID == ChangeEventEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == TimeEventEditPart.VISUAL_ID) {
+ if (visualID == TimeEventEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DurationObservationEditPart.VISUAL_ID) {
+ if (visualID == DurationObservationEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == TimeObservationEditPart.VISUAL_ID) {
+ if (visualID == TimeObservationEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == LiteralBooleanEditPart.VISUAL_ID) {
+ if (visualID == LiteralBooleanEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == LiteralIntegerEditPart.VISUAL_ID) {
+ if (visualID == LiteralIntegerEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == LiteralNullEditPart.VISUAL_ID) {
+ if (visualID == LiteralNullEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == LiteralStringEditPart.VISUAL_ID) {
+ if (visualID == LiteralStringEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == LiteralUnlimitedNaturalEditPart.VISUAL_ID) {
+ if (visualID == LiteralUnlimitedNaturalEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == StringExpressionEditPart.VISUAL_ID) {
+ if (visualID == StringExpressionEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == OpaqueExpressionEditPart.VISUAL_ID) {
+ if (visualID == OpaqueExpressionEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == TimeExpressionEditPart.VISUAL_ID) {
+ if (visualID == TimeExpressionEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ExpressionEditPart.VISUAL_ID) {
+ if (visualID == ExpressionEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DurationEditPart.VISUAL_ID) {
+ if (visualID == DurationEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == TimeIntervalEditPart.VISUAL_ID) {
+ if (visualID == TimeIntervalEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DurationIntervalEditPart.VISUAL_ID) {
+ if (visualID == DurationIntervalEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == IntervalEditPart.VISUAL_ID) {
+ if (visualID == IntervalEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InstanceValueEditPart.VISUAL_ID) {
+ if (visualID == InstanceValueEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedComments().iterator(); it.hasNext();) {
- Comment childElement = (Comment)it.next();
+ for (Iterator<?> it = modelElement.getOwnedComments()
+ .iterator(); it.hasNext();) {
+ Comment childElement = (Comment) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CommentEditPart.VISUAL_ID) {
+ if (visualID == CommentEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedRules().iterator(); it.hasNext();) {
- Constraint childElement = (Constraint)it.next();
+ for (Iterator<?> it = modelElement.getOwnedRules()
+ .iterator(); it.hasNext();) {
+ Constraint childElement = (Constraint) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == DurationConstraintEditPart.VISUAL_ID) {
+ if (visualID == DurationConstraintEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == TimeConstraintEditPart.VISUAL_ID) {
+ if (visualID == TimeConstraintEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == IntervalConstraintEditPart.VISUAL_ID) {
+ if (visualID == IntervalConstraintEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionConstraintEditPart.VISUAL_ID) {
+ if (visualID == InteractionConstraintEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ConstraintEditPart.VISUAL_ID) {
+ if (visualID == ConstraintEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -467,23 +470,25 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getActivity_2060SemanticChildren(View view) {
- if(!view.isSetElement()) {
+ if (!view.isSetElement()) {
return Collections.emptyList();
}
- Activity modelElement = (Activity)view.getElement();
+ Activity modelElement = (Activity) view.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PortEditPart.VISUAL_ID) {
+ if (visualID == PortEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedParameters().iterator(); it.hasNext();) {
- Parameter childElement = (Parameter)it.next();
+ for (Iterator<?> it = modelElement.getOwnedParameters()
+ .iterator(); it.hasNext();) {
+ Parameter childElement = (Parameter) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ParameterEditPart.VISUAL_ID) {
+ if (visualID == ParameterEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -495,23 +500,25 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getInteraction_2061SemanticChildren(View view) {
- if(!view.isSetElement()) {
+ if (!view.isSetElement()) {
return Collections.emptyList();
}
- Interaction modelElement = (Interaction)view.getElement();
+ Interaction modelElement = (Interaction) view.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PortEditPart.VISUAL_ID) {
+ if (visualID == PortEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedParameters().iterator(); it.hasNext();) {
- Parameter childElement = (Parameter)it.next();
+ for (Iterator<?> it = modelElement.getOwnedParameters()
+ .iterator(); it.hasNext();) {
+ Parameter childElement = (Parameter) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ParameterEditPart.VISUAL_ID) {
+ if (visualID == ParameterEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -523,23 +530,25 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getProtocolStateMachine_2062SemanticChildren(View view) {
- if(!view.isSetElement()) {
+ if (!view.isSetElement()) {
return Collections.emptyList();
}
- ProtocolStateMachine modelElement = (ProtocolStateMachine)view.getElement();
+ ProtocolStateMachine modelElement = (ProtocolStateMachine) view.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PortEditPart.VISUAL_ID) {
+ if (visualID == PortEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedParameters().iterator(); it.hasNext();) {
- Parameter childElement = (Parameter)it.next();
+ for (Iterator<?> it = modelElement.getOwnedParameters()
+ .iterator(); it.hasNext();) {
+ Parameter childElement = (Parameter) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ParameterEditPart.VISUAL_ID) {
+ if (visualID == ParameterEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -551,23 +560,25 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getStateMachine_2063SemanticChildren(View view) {
- if(!view.isSetElement()) {
+ if (!view.isSetElement()) {
return Collections.emptyList();
}
- StateMachine modelElement = (StateMachine)view.getElement();
+ StateMachine modelElement = (StateMachine) view.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PortEditPart.VISUAL_ID) {
+ if (visualID == PortEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedParameters().iterator(); it.hasNext();) {
- Parameter childElement = (Parameter)it.next();
+ for (Iterator<?> it = modelElement.getOwnedParameters()
+ .iterator(); it.hasNext();) {
+ Parameter childElement = (Parameter) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ParameterEditPart.VISUAL_ID) {
+ if (visualID == ParameterEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -579,23 +590,25 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getFunctionBehavior_2064SemanticChildren(View view) {
- if(!view.isSetElement()) {
+ if (!view.isSetElement()) {
return Collections.emptyList();
}
- FunctionBehavior modelElement = (FunctionBehavior)view.getElement();
+ FunctionBehavior modelElement = (FunctionBehavior) view.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PortEditPart.VISUAL_ID) {
+ if (visualID == PortEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedParameters().iterator(); it.hasNext();) {
- Parameter childElement = (Parameter)it.next();
+ for (Iterator<?> it = modelElement.getOwnedParameters()
+ .iterator(); it.hasNext();) {
+ Parameter childElement = (Parameter) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ParameterEditPart.VISUAL_ID) {
+ if (visualID == ParameterEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -607,23 +620,25 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getOpaqueBehavior_2065SemanticChildren(View view) {
- if(!view.isSetElement()) {
+ if (!view.isSetElement()) {
return Collections.emptyList();
}
- OpaqueBehavior modelElement = (OpaqueBehavior)view.getElement();
+ OpaqueBehavior modelElement = (OpaqueBehavior) view.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PortEditPart.VISUAL_ID) {
+ if (visualID == PortEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedParameters().iterator(); it.hasNext();) {
- Parameter childElement = (Parameter)it.next();
+ for (Iterator<?> it = modelElement.getOwnedParameters()
+ .iterator(); it.hasNext();) {
+ Parameter childElement = (Parameter) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ParameterEditPart.VISUAL_ID) {
+ if (visualID == ParameterEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -635,15 +650,16 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getComponent_2069SemanticChildren(View view) {
- if(!view.isSetElement()) {
+ if (!view.isSetElement()) {
return Collections.emptyList();
}
- Component modelElement = (Component)view.getElement();
+ Component modelElement = (Component) view.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PortEditPart.VISUAL_ID) {
+ if (visualID == PortEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -655,15 +671,16 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getDevice_2070SemanticChildren(View view) {
- if(!view.isSetElement()) {
+ if (!view.isSetElement()) {
return Collections.emptyList();
}
- Device modelElement = (Device)view.getElement();
+ Device modelElement = (Device) view.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PortEditPart.VISUAL_ID) {
+ if (visualID == PortEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -675,15 +692,16 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getExecutionEnvironment_2071SemanticChildren(View view) {
- if(!view.isSetElement()) {
+ if (!view.isSetElement()) {
return Collections.emptyList();
}
- ExecutionEnvironment modelElement = (ExecutionEnvironment)view.getElement();
+ ExecutionEnvironment modelElement = (ExecutionEnvironment) view.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PortEditPart.VISUAL_ID) {
+ if (visualID == PortEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -695,15 +713,16 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getNode_2072SemanticChildren(View view) {
- if(!view.isSetElement()) {
+ if (!view.isSetElement()) {
return Collections.emptyList();
}
- Node modelElement = (Node)view.getElement();
+ Node modelElement = (Node) view.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PortEditPart.VISUAL_ID) {
+ if (visualID == PortEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -715,15 +734,16 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getClass_2073SemanticChildren(View view) {
- if(!view.isSetElement()) {
+ if (!view.isSetElement()) {
return Collections.emptyList();
}
- Class modelElement = (Class)view.getElement();
+ Class modelElement = (Class) view.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PortEditPart.VISUAL_ID) {
+ if (visualID == PortEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -735,15 +755,16 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getEnumeration_2067SemanticChildren(View view) {
- if(!view.isSetElement()) {
+ if (!view.isSetElement()) {
return Collections.emptyList();
}
- Enumeration modelElement = (Enumeration)view.getElement();
+ Enumeration modelElement = (Enumeration) view.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedLiterals().iterator(); it.hasNext();) {
- EnumerationLiteral childElement = (EnumerationLiteral)it.next();
+ for (Iterator<?> it = modelElement.getOwnedLiterals()
+ .iterator(); it.hasNext();) {
+ EnumerationLiteral childElement = (EnumerationLiteral) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == EnumerationLiteralEditPartCLN.VISUAL_ID) {
+ if (visualID == EnumerationLiteralEditPartCLN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -763,23 +784,25 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getActivity_3072SemanticChildren(View view) {
- if(!view.isSetElement()) {
+ if (!view.isSetElement()) {
return Collections.emptyList();
}
- Activity modelElement = (Activity)view.getElement();
+ Activity modelElement = (Activity) view.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PortEditPart.VISUAL_ID) {
+ if (visualID == PortEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedParameters().iterator(); it.hasNext();) {
- Parameter childElement = (Parameter)it.next();
+ for (Iterator<?> it = modelElement.getOwnedParameters()
+ .iterator(); it.hasNext();) {
+ Parameter childElement = (Parameter) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ParameterEditPart.VISUAL_ID) {
+ if (visualID == ParameterEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -791,23 +814,25 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getInteraction_3073SemanticChildren(View view) {
- if(!view.isSetElement()) {
+ if (!view.isSetElement()) {
return Collections.emptyList();
}
- Interaction modelElement = (Interaction)view.getElement();
+ Interaction modelElement = (Interaction) view.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PortEditPart.VISUAL_ID) {
+ if (visualID == PortEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedParameters().iterator(); it.hasNext();) {
- Parameter childElement = (Parameter)it.next();
+ for (Iterator<?> it = modelElement.getOwnedParameters()
+ .iterator(); it.hasNext();) {
+ Parameter childElement = (Parameter) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ParameterEditPart.VISUAL_ID) {
+ if (visualID == ParameterEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -819,23 +844,25 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getProtocolStateMachine_3074SemanticChildren(View view) {
- if(!view.isSetElement()) {
+ if (!view.isSetElement()) {
return Collections.emptyList();
}
- ProtocolStateMachine modelElement = (ProtocolStateMachine)view.getElement();
+ ProtocolStateMachine modelElement = (ProtocolStateMachine) view.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PortEditPart.VISUAL_ID) {
+ if (visualID == PortEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedParameters().iterator(); it.hasNext();) {
- Parameter childElement = (Parameter)it.next();
+ for (Iterator<?> it = modelElement.getOwnedParameters()
+ .iterator(); it.hasNext();) {
+ Parameter childElement = (Parameter) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ParameterEditPart.VISUAL_ID) {
+ if (visualID == ParameterEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -847,23 +874,25 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getStateMachine_3075SemanticChildren(View view) {
- if(!view.isSetElement()) {
+ if (!view.isSetElement()) {
return Collections.emptyList();
}
- StateMachine modelElement = (StateMachine)view.getElement();
+ StateMachine modelElement = (StateMachine) view.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PortEditPart.VISUAL_ID) {
+ if (visualID == PortEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedParameters().iterator(); it.hasNext();) {
- Parameter childElement = (Parameter)it.next();
+ for (Iterator<?> it = modelElement.getOwnedParameters()
+ .iterator(); it.hasNext();) {
+ Parameter childElement = (Parameter) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ParameterEditPart.VISUAL_ID) {
+ if (visualID == ParameterEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -875,23 +904,25 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getFunctionBehavior_3076SemanticChildren(View view) {
- if(!view.isSetElement()) {
+ if (!view.isSetElement()) {
return Collections.emptyList();
}
- FunctionBehavior modelElement = (FunctionBehavior)view.getElement();
+ FunctionBehavior modelElement = (FunctionBehavior) view.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PortEditPart.VISUAL_ID) {
+ if (visualID == PortEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedParameters().iterator(); it.hasNext();) {
- Parameter childElement = (Parameter)it.next();
+ for (Iterator<?> it = modelElement.getOwnedParameters()
+ .iterator(); it.hasNext();) {
+ Parameter childElement = (Parameter) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ParameterEditPart.VISUAL_ID) {
+ if (visualID == ParameterEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -903,23 +934,25 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getOpaqueBehavior_3077SemanticChildren(View view) {
- if(!view.isSetElement()) {
+ if (!view.isSetElement()) {
return Collections.emptyList();
}
- OpaqueBehavior modelElement = (OpaqueBehavior)view.getElement();
+ OpaqueBehavior modelElement = (OpaqueBehavior) view.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PortEditPart.VISUAL_ID) {
+ if (visualID == PortEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedParameters().iterator(); it.hasNext();) {
- Parameter childElement = (Parameter)it.next();
+ for (Iterator<?> it = modelElement.getOwnedParameters()
+ .iterator(); it.hasNext();) {
+ Parameter childElement = (Parameter) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ParameterEditPart.VISUAL_ID) {
+ if (visualID == ParameterEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -931,15 +964,16 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getComponent_3081SemanticChildren(View view) {
- if(!view.isSetElement()) {
+ if (!view.isSetElement()) {
return Collections.emptyList();
}
- Component modelElement = (Component)view.getElement();
+ Component modelElement = (Component) view.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PortEditPart.VISUAL_ID) {
+ if (visualID == PortEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -951,15 +985,16 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getDevice_3082SemanticChildren(View view) {
- if(!view.isSetElement()) {
+ if (!view.isSetElement()) {
return Collections.emptyList();
}
- Device modelElement = (Device)view.getElement();
+ Device modelElement = (Device) view.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PortEditPart.VISUAL_ID) {
+ if (visualID == PortEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -971,15 +1006,16 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getExecutionEnvironment_3083SemanticChildren(View view) {
- if(!view.isSetElement()) {
+ if (!view.isSetElement()) {
return Collections.emptyList();
}
- ExecutionEnvironment modelElement = (ExecutionEnvironment)view.getElement();
+ ExecutionEnvironment modelElement = (ExecutionEnvironment) view.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PortEditPart.VISUAL_ID) {
+ if (visualID == PortEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -991,15 +1027,16 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getNode_3084SemanticChildren(View view) {
- if(!view.isSetElement()) {
+ if (!view.isSetElement()) {
return Collections.emptyList();
}
- Node modelElement = (Node)view.getElement();
+ Node modelElement = (Node) view.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PortEditPart.VISUAL_ID) {
+ if (visualID == PortEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -1011,15 +1048,16 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getClass_3085SemanticChildren(View view) {
- if(!view.isSetElement()) {
+ if (!view.isSetElement()) {
return Collections.emptyList();
}
- Class modelElement = (Class)view.getElement();
+ Class modelElement = (Class) view.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PortEditPart.VISUAL_ID) {
+ if (visualID == PortEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -1031,15 +1069,16 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getEnumeration_3079SemanticChildren(View view) {
- if(!view.isSetElement()) {
+ if (!view.isSetElement()) {
return Collections.emptyList();
}
- Enumeration modelElement = (Enumeration)view.getElement();
+ Enumeration modelElement = (Enumeration) view.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedLiterals().iterator(); it.hasNext();) {
- EnumerationLiteral childElement = (EnumerationLiteral)it.next();
+ for (Iterator<?> it = modelElement.getOwnedLiterals()
+ .iterator(); it.hasNext();) {
+ EnumerationLiteral childElement = (EnumerationLiteral) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == EnumerationLiteralEditPartCLN.VISUAL_ID) {
+ if (visualID == EnumerationLiteralEditPartCLN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -1051,19 +1090,20 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getDataTypeAttributes_7033SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
+ if (false == view.eContainer() instanceof View) {
return Collections.emptyList();
}
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
+ View containerView = (View) view.eContainer();
+ if (!containerView.isSetElement()) {
return Collections.emptyList();
}
- DataType modelElement = (DataType)containerView.getElement();
+ DataType modelElement = (DataType) containerView.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PropertyEditPartCLN.VISUAL_ID) {
+ if (visualID == PropertyEditPartCLN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -1075,19 +1115,20 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getDataTypeOperations_7034SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
+ if (false == view.eContainer() instanceof View) {
return Collections.emptyList();
}
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
+ View containerView = (View) view.eContainer();
+ if (!containerView.isSetElement()) {
return Collections.emptyList();
}
- DataType modelElement = (DataType)containerView.getElement();
+ DataType modelElement = (DataType) containerView.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedOperations().iterator(); it.hasNext();) {
- Operation childElement = (Operation)it.next();
+ for (Iterator<?> it = modelElement.getOwnedOperations()
+ .iterator(); it.hasNext();) {
+ Operation childElement = (Operation) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == OperationEditPartCLN.VISUAL_ID) {
+ if (visualID == OperationEditPartCLN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -1099,19 +1140,20 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getDataTypeAttributes_7036SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
+ if (false == view.eContainer() instanceof View) {
return Collections.emptyList();
}
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
+ View containerView = (View) view.eContainer();
+ if (!containerView.isSetElement()) {
return Collections.emptyList();
}
- DataType modelElement = (DataType)containerView.getElement();
+ DataType modelElement = (DataType) containerView.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PropertyEditPartCLN.VISUAL_ID) {
+ if (visualID == PropertyEditPartCLN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -1123,19 +1165,20 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getDataTypeOperations_7037SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
+ if (false == view.eContainer() instanceof View) {
return Collections.emptyList();
}
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
+ View containerView = (View) view.eContainer();
+ if (!containerView.isSetElement()) {
return Collections.emptyList();
}
- DataType modelElement = (DataType)containerView.getElement();
+ DataType modelElement = (DataType) containerView.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedOperations().iterator(); it.hasNext();) {
- Operation childElement = (Operation)it.next();
+ for (Iterator<?> it = modelElement.getOwnedOperations()
+ .iterator(); it.hasNext();) {
+ Operation childElement = (Operation) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == OperationEditPartCLN.VISUAL_ID) {
+ if (visualID == OperationEditPartCLN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -1147,19 +1190,20 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getEnumerationLiterals_7048SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
+ if (false == view.eContainer() instanceof View) {
return Collections.emptyList();
}
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
+ View containerView = (View) view.eContainer();
+ if (!containerView.isSetElement()) {
return Collections.emptyList();
}
- Enumeration modelElement = (Enumeration)containerView.getElement();
+ Enumeration modelElement = (Enumeration) containerView.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedLiterals().iterator(); it.hasNext();) {
- EnumerationLiteral childElement = (EnumerationLiteral)it.next();
+ for (Iterator<?> it = modelElement.getOwnedLiterals()
+ .iterator(); it.hasNext();) {
+ EnumerationLiteral childElement = (EnumerationLiteral) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == EnumerationLiteralEditPartCLN.VISUAL_ID) {
+ if (visualID == EnumerationLiteralEditPartCLN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -1171,19 +1215,20 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getEnumerationLiterals_7049SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
+ if (false == view.eContainer() instanceof View) {
return Collections.emptyList();
}
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
+ View containerView = (View) view.eContainer();
+ if (!containerView.isSetElement()) {
return Collections.emptyList();
}
- Enumeration modelElement = (Enumeration)containerView.getElement();
+ Enumeration modelElement = (Enumeration) containerView.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedLiterals().iterator(); it.hasNext();) {
- EnumerationLiteral childElement = (EnumerationLiteral)it.next();
+ for (Iterator<?> it = modelElement.getOwnedLiterals()
+ .iterator(); it.hasNext();) {
+ EnumerationLiteral childElement = (EnumerationLiteral) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == EnumerationLiteralEditPartCLN.VISUAL_ID) {
+ if (visualID == EnumerationLiteralEditPartCLN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -1195,159 +1240,165 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getActivityInternalstructure_7050SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
+ if (false == view.eContainer() instanceof View) {
return Collections.emptyList();
}
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
+ View containerView = (View) view.eContainer();
+ if (!containerView.isSetElement()) {
return Collections.emptyList();
}
- Activity modelElement = (Activity)containerView.getElement();
+ Activity modelElement = (Activity) containerView.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedParameters().iterator(); it.hasNext();) {
- Parameter childElement = (Parameter)it.next();
+ for (Iterator<?> it = modelElement.getOwnedParameters()
+ .iterator(); it.hasNext();) {
+ Parameter childElement = (Parameter) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ParameterEditPart.VISUAL_ID) {
+ if (visualID == ParameterEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PropertyPartEditPartCN.VISUAL_ID) {
+ if (visualID == PropertyPartEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getCollaborationUses().iterator(); it.hasNext();) {
- CollaborationUse childElement = (CollaborationUse)it.next();
+ for (Iterator<?> it = modelElement.getCollaborationUses()
+ .iterator(); it.hasNext();) {
+ CollaborationUse childElement = (CollaborationUse) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CollaborationUseEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationUseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getNestedClassifiers().iterator(); it.hasNext();) {
- Classifier childElement = (Classifier)it.next();
+ for (Iterator<?> it = modelElement.getNestedClassifiers()
+ .iterator(); it.hasNext();) {
+ Classifier childElement = (Classifier) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ActivityCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ActivityCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ProtocolStateMachineCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ProtocolStateMachineCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == StateMachineCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == StateMachineCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == FunctionBehaviorCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == FunctionBehaviorCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == OpaqueBehaviorCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == OpaqueBehaviorCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ComponentCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ComponentCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeviceCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == DeviceCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == NodeCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == NodeCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ClassCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ClassCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == CollaborationCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InterfaceEditPartCN.VISUAL_ID) {
+ if (visualID == InterfaceEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == PrimitiveTypeEditPartCN.VISUAL_ID) {
+ if (visualID == PrimitiveTypeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == EnumerationEditPartCN.VISUAL_ID) {
+ if (visualID == EnumerationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DataTypeEditPartCN.VISUAL_ID) {
+ if (visualID == DataTypeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ActorEditPartCN.VISUAL_ID) {
+ if (visualID == ActorEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeploymentSpecificationEditPartCN.VISUAL_ID) {
+ if (visualID == DeploymentSpecificationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ArtifactEditPartCN.VISUAL_ID) {
+ if (visualID == ArtifactEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InformationItemEditPartCN.VISUAL_ID) {
+ if (visualID == InformationItemEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == SignalEditPartCN.VISUAL_ID) {
+ if (visualID == SignalEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == UseCaseEditPartCN.VISUAL_ID) {
+ if (visualID == UseCaseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedComments().iterator(); it.hasNext();) {
- Comment childElement = (Comment)it.next();
+ for (Iterator<?> it = modelElement.getOwnedComments()
+ .iterator(); it.hasNext();) {
+ Comment childElement = (Comment) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CommentEditPartCN.VISUAL_ID) {
+ if (visualID == CommentEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedRules().iterator(); it.hasNext();) {
- Constraint childElement = (Constraint)it.next();
+ for (Iterator<?> it = modelElement.getOwnedRules()
+ .iterator(); it.hasNext();) {
+ Constraint childElement = (Constraint) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == DurationConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == DurationConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == TimeConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == TimeConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == ConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -1359,159 +1410,165 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getInteractionInternalstructure_7051SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
+ if (false == view.eContainer() instanceof View) {
return Collections.emptyList();
}
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
+ View containerView = (View) view.eContainer();
+ if (!containerView.isSetElement()) {
return Collections.emptyList();
}
- Interaction modelElement = (Interaction)containerView.getElement();
+ Interaction modelElement = (Interaction) containerView.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedParameters().iterator(); it.hasNext();) {
- Parameter childElement = (Parameter)it.next();
+ for (Iterator<?> it = modelElement.getOwnedParameters()
+ .iterator(); it.hasNext();) {
+ Parameter childElement = (Parameter) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ParameterEditPart.VISUAL_ID) {
+ if (visualID == ParameterEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PropertyPartEditPartCN.VISUAL_ID) {
+ if (visualID == PropertyPartEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getCollaborationUses().iterator(); it.hasNext();) {
- CollaborationUse childElement = (CollaborationUse)it.next();
+ for (Iterator<?> it = modelElement.getCollaborationUses()
+ .iterator(); it.hasNext();) {
+ CollaborationUse childElement = (CollaborationUse) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CollaborationUseEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationUseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getNestedClassifiers().iterator(); it.hasNext();) {
- Classifier childElement = (Classifier)it.next();
+ for (Iterator<?> it = modelElement.getNestedClassifiers()
+ .iterator(); it.hasNext();) {
+ Classifier childElement = (Classifier) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ActivityCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ActivityCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ProtocolStateMachineCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ProtocolStateMachineCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == StateMachineCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == StateMachineCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == FunctionBehaviorCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == FunctionBehaviorCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == OpaqueBehaviorCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == OpaqueBehaviorCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ComponentCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ComponentCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeviceCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == DeviceCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == NodeCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == NodeCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ClassCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ClassCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == CollaborationCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InterfaceEditPartCN.VISUAL_ID) {
+ if (visualID == InterfaceEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == PrimitiveTypeEditPartCN.VISUAL_ID) {
+ if (visualID == PrimitiveTypeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == EnumerationEditPartCN.VISUAL_ID) {
+ if (visualID == EnumerationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DataTypeEditPartCN.VISUAL_ID) {
+ if (visualID == DataTypeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ActorEditPartCN.VISUAL_ID) {
+ if (visualID == ActorEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeploymentSpecificationEditPartCN.VISUAL_ID) {
+ if (visualID == DeploymentSpecificationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ArtifactEditPartCN.VISUAL_ID) {
+ if (visualID == ArtifactEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InformationItemEditPartCN.VISUAL_ID) {
+ if (visualID == InformationItemEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == SignalEditPartCN.VISUAL_ID) {
+ if (visualID == SignalEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == UseCaseEditPartCN.VISUAL_ID) {
+ if (visualID == UseCaseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedComments().iterator(); it.hasNext();) {
- Comment childElement = (Comment)it.next();
+ for (Iterator<?> it = modelElement.getOwnedComments()
+ .iterator(); it.hasNext();) {
+ Comment childElement = (Comment) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CommentEditPartCN.VISUAL_ID) {
+ if (visualID == CommentEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedRules().iterator(); it.hasNext();) {
- Constraint childElement = (Constraint)it.next();
+ for (Iterator<?> it = modelElement.getOwnedRules()
+ .iterator(); it.hasNext();) {
+ Constraint childElement = (Constraint) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == DurationConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == DurationConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == TimeConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == TimeConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == ConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -1523,159 +1580,165 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getProtocolStateMachineInternalstructure_7052SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
+ if (false == view.eContainer() instanceof View) {
return Collections.emptyList();
}
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
+ View containerView = (View) view.eContainer();
+ if (!containerView.isSetElement()) {
return Collections.emptyList();
}
- ProtocolStateMachine modelElement = (ProtocolStateMachine)containerView.getElement();
+ ProtocolStateMachine modelElement = (ProtocolStateMachine) containerView.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedParameters().iterator(); it.hasNext();) {
- Parameter childElement = (Parameter)it.next();
+ for (Iterator<?> it = modelElement.getOwnedParameters()
+ .iterator(); it.hasNext();) {
+ Parameter childElement = (Parameter) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ParameterEditPart.VISUAL_ID) {
+ if (visualID == ParameterEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PropertyPartEditPartCN.VISUAL_ID) {
+ if (visualID == PropertyPartEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getCollaborationUses().iterator(); it.hasNext();) {
- CollaborationUse childElement = (CollaborationUse)it.next();
+ for (Iterator<?> it = modelElement.getCollaborationUses()
+ .iterator(); it.hasNext();) {
+ CollaborationUse childElement = (CollaborationUse) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CollaborationUseEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationUseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getNestedClassifiers().iterator(); it.hasNext();) {
- Classifier childElement = (Classifier)it.next();
+ for (Iterator<?> it = modelElement.getNestedClassifiers()
+ .iterator(); it.hasNext();) {
+ Classifier childElement = (Classifier) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ActivityCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ActivityCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ProtocolStateMachineCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ProtocolStateMachineCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == StateMachineCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == StateMachineCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == FunctionBehaviorCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == FunctionBehaviorCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == OpaqueBehaviorCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == OpaqueBehaviorCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ComponentCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ComponentCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeviceCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == DeviceCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == NodeCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == NodeCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ClassCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ClassCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == CollaborationCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InterfaceEditPartCN.VISUAL_ID) {
+ if (visualID == InterfaceEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == PrimitiveTypeEditPartCN.VISUAL_ID) {
+ if (visualID == PrimitiveTypeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == EnumerationEditPartCN.VISUAL_ID) {
+ if (visualID == EnumerationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DataTypeEditPartCN.VISUAL_ID) {
+ if (visualID == DataTypeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ActorEditPartCN.VISUAL_ID) {
+ if (visualID == ActorEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeploymentSpecificationEditPartCN.VISUAL_ID) {
+ if (visualID == DeploymentSpecificationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ArtifactEditPartCN.VISUAL_ID) {
+ if (visualID == ArtifactEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InformationItemEditPartCN.VISUAL_ID) {
+ if (visualID == InformationItemEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == SignalEditPartCN.VISUAL_ID) {
+ if (visualID == SignalEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == UseCaseEditPartCN.VISUAL_ID) {
+ if (visualID == UseCaseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedComments().iterator(); it.hasNext();) {
- Comment childElement = (Comment)it.next();
+ for (Iterator<?> it = modelElement.getOwnedComments()
+ .iterator(); it.hasNext();) {
+ Comment childElement = (Comment) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CommentEditPartCN.VISUAL_ID) {
+ if (visualID == CommentEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedRules().iterator(); it.hasNext();) {
- Constraint childElement = (Constraint)it.next();
+ for (Iterator<?> it = modelElement.getOwnedRules()
+ .iterator(); it.hasNext();) {
+ Constraint childElement = (Constraint) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == DurationConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == DurationConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == TimeConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == TimeConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == ConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -1687,159 +1750,165 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getStateMachineInternalstructure_7053SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
+ if (false == view.eContainer() instanceof View) {
return Collections.emptyList();
}
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
+ View containerView = (View) view.eContainer();
+ if (!containerView.isSetElement()) {
return Collections.emptyList();
}
- StateMachine modelElement = (StateMachine)containerView.getElement();
+ StateMachine modelElement = (StateMachine) containerView.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedParameters().iterator(); it.hasNext();) {
- Parameter childElement = (Parameter)it.next();
+ for (Iterator<?> it = modelElement.getOwnedParameters()
+ .iterator(); it.hasNext();) {
+ Parameter childElement = (Parameter) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ParameterEditPart.VISUAL_ID) {
+ if (visualID == ParameterEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PropertyPartEditPartCN.VISUAL_ID) {
+ if (visualID == PropertyPartEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getCollaborationUses().iterator(); it.hasNext();) {
- CollaborationUse childElement = (CollaborationUse)it.next();
+ for (Iterator<?> it = modelElement.getCollaborationUses()
+ .iterator(); it.hasNext();) {
+ CollaborationUse childElement = (CollaborationUse) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CollaborationUseEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationUseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getNestedClassifiers().iterator(); it.hasNext();) {
- Classifier childElement = (Classifier)it.next();
+ for (Iterator<?> it = modelElement.getNestedClassifiers()
+ .iterator(); it.hasNext();) {
+ Classifier childElement = (Classifier) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ActivityCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ActivityCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ProtocolStateMachineCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ProtocolStateMachineCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == StateMachineCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == StateMachineCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == FunctionBehaviorCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == FunctionBehaviorCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == OpaqueBehaviorCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == OpaqueBehaviorCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ComponentCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ComponentCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeviceCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == DeviceCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == NodeCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == NodeCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ClassCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ClassCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == CollaborationCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InterfaceEditPartCN.VISUAL_ID) {
+ if (visualID == InterfaceEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == PrimitiveTypeEditPartCN.VISUAL_ID) {
+ if (visualID == PrimitiveTypeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == EnumerationEditPartCN.VISUAL_ID) {
+ if (visualID == EnumerationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DataTypeEditPartCN.VISUAL_ID) {
+ if (visualID == DataTypeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ActorEditPartCN.VISUAL_ID) {
+ if (visualID == ActorEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeploymentSpecificationEditPartCN.VISUAL_ID) {
+ if (visualID == DeploymentSpecificationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ArtifactEditPartCN.VISUAL_ID) {
+ if (visualID == ArtifactEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InformationItemEditPartCN.VISUAL_ID) {
+ if (visualID == InformationItemEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == SignalEditPartCN.VISUAL_ID) {
+ if (visualID == SignalEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == UseCaseEditPartCN.VISUAL_ID) {
+ if (visualID == UseCaseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedComments().iterator(); it.hasNext();) {
- Comment childElement = (Comment)it.next();
+ for (Iterator<?> it = modelElement.getOwnedComments()
+ .iterator(); it.hasNext();) {
+ Comment childElement = (Comment) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CommentEditPartCN.VISUAL_ID) {
+ if (visualID == CommentEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedRules().iterator(); it.hasNext();) {
- Constraint childElement = (Constraint)it.next();
+ for (Iterator<?> it = modelElement.getOwnedRules()
+ .iterator(); it.hasNext();) {
+ Constraint childElement = (Constraint) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == DurationConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == DurationConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == TimeConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == TimeConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == ConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -1851,159 +1920,165 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getFunctionBehaviorInternalstructure_7054SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
+ if (false == view.eContainer() instanceof View) {
return Collections.emptyList();
}
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
+ View containerView = (View) view.eContainer();
+ if (!containerView.isSetElement()) {
return Collections.emptyList();
}
- FunctionBehavior modelElement = (FunctionBehavior)containerView.getElement();
+ FunctionBehavior modelElement = (FunctionBehavior) containerView.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedParameters().iterator(); it.hasNext();) {
- Parameter childElement = (Parameter)it.next();
+ for (Iterator<?> it = modelElement.getOwnedParameters()
+ .iterator(); it.hasNext();) {
+ Parameter childElement = (Parameter) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ParameterEditPart.VISUAL_ID) {
+ if (visualID == ParameterEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PropertyPartEditPartCN.VISUAL_ID) {
+ if (visualID == PropertyPartEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getCollaborationUses().iterator(); it.hasNext();) {
- CollaborationUse childElement = (CollaborationUse)it.next();
+ for (Iterator<?> it = modelElement.getCollaborationUses()
+ .iterator(); it.hasNext();) {
+ CollaborationUse childElement = (CollaborationUse) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CollaborationUseEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationUseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getNestedClassifiers().iterator(); it.hasNext();) {
- Classifier childElement = (Classifier)it.next();
+ for (Iterator<?> it = modelElement.getNestedClassifiers()
+ .iterator(); it.hasNext();) {
+ Classifier childElement = (Classifier) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ActivityCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ActivityCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ProtocolStateMachineCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ProtocolStateMachineCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == StateMachineCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == StateMachineCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == FunctionBehaviorCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == FunctionBehaviorCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == OpaqueBehaviorCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == OpaqueBehaviorCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ComponentCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ComponentCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeviceCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == DeviceCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == NodeCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == NodeCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ClassCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ClassCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == CollaborationCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InterfaceEditPartCN.VISUAL_ID) {
+ if (visualID == InterfaceEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == PrimitiveTypeEditPartCN.VISUAL_ID) {
+ if (visualID == PrimitiveTypeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == EnumerationEditPartCN.VISUAL_ID) {
+ if (visualID == EnumerationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DataTypeEditPartCN.VISUAL_ID) {
+ if (visualID == DataTypeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ActorEditPartCN.VISUAL_ID) {
+ if (visualID == ActorEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeploymentSpecificationEditPartCN.VISUAL_ID) {
+ if (visualID == DeploymentSpecificationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ArtifactEditPartCN.VISUAL_ID) {
+ if (visualID == ArtifactEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InformationItemEditPartCN.VISUAL_ID) {
+ if (visualID == InformationItemEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == SignalEditPartCN.VISUAL_ID) {
+ if (visualID == SignalEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == UseCaseEditPartCN.VISUAL_ID) {
+ if (visualID == UseCaseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedComments().iterator(); it.hasNext();) {
- Comment childElement = (Comment)it.next();
+ for (Iterator<?> it = modelElement.getOwnedComments()
+ .iterator(); it.hasNext();) {
+ Comment childElement = (Comment) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CommentEditPartCN.VISUAL_ID) {
+ if (visualID == CommentEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedRules().iterator(); it.hasNext();) {
- Constraint childElement = (Constraint)it.next();
+ for (Iterator<?> it = modelElement.getOwnedRules()
+ .iterator(); it.hasNext();) {
+ Constraint childElement = (Constraint) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == DurationConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == DurationConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == TimeConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == TimeConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == ConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -2015,159 +2090,165 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getOpaqueBehaviorInternalstructure_7055SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
+ if (false == view.eContainer() instanceof View) {
return Collections.emptyList();
}
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
+ View containerView = (View) view.eContainer();
+ if (!containerView.isSetElement()) {
return Collections.emptyList();
}
- OpaqueBehavior modelElement = (OpaqueBehavior)containerView.getElement();
+ OpaqueBehavior modelElement = (OpaqueBehavior) containerView.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedParameters().iterator(); it.hasNext();) {
- Parameter childElement = (Parameter)it.next();
+ for (Iterator<?> it = modelElement.getOwnedParameters()
+ .iterator(); it.hasNext();) {
+ Parameter childElement = (Parameter) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ParameterEditPart.VISUAL_ID) {
+ if (visualID == ParameterEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PropertyPartEditPartCN.VISUAL_ID) {
+ if (visualID == PropertyPartEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getCollaborationUses().iterator(); it.hasNext();) {
- CollaborationUse childElement = (CollaborationUse)it.next();
+ for (Iterator<?> it = modelElement.getCollaborationUses()
+ .iterator(); it.hasNext();) {
+ CollaborationUse childElement = (CollaborationUse) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CollaborationUseEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationUseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getNestedClassifiers().iterator(); it.hasNext();) {
- Classifier childElement = (Classifier)it.next();
+ for (Iterator<?> it = modelElement.getNestedClassifiers()
+ .iterator(); it.hasNext();) {
+ Classifier childElement = (Classifier) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ActivityCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ActivityCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ProtocolStateMachineCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ProtocolStateMachineCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == StateMachineCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == StateMachineCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == FunctionBehaviorCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == FunctionBehaviorCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == OpaqueBehaviorCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == OpaqueBehaviorCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ComponentCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ComponentCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeviceCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == DeviceCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == NodeCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == NodeCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ClassCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ClassCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == CollaborationCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InterfaceEditPartCN.VISUAL_ID) {
+ if (visualID == InterfaceEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == PrimitiveTypeEditPartCN.VISUAL_ID) {
+ if (visualID == PrimitiveTypeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == EnumerationEditPartCN.VISUAL_ID) {
+ if (visualID == EnumerationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DataTypeEditPartCN.VISUAL_ID) {
+ if (visualID == DataTypeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ActorEditPartCN.VISUAL_ID) {
+ if (visualID == ActorEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeploymentSpecificationEditPartCN.VISUAL_ID) {
+ if (visualID == DeploymentSpecificationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ArtifactEditPartCN.VISUAL_ID) {
+ if (visualID == ArtifactEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InformationItemEditPartCN.VISUAL_ID) {
+ if (visualID == InformationItemEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == SignalEditPartCN.VISUAL_ID) {
+ if (visualID == SignalEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == UseCaseEditPartCN.VISUAL_ID) {
+ if (visualID == UseCaseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedComments().iterator(); it.hasNext();) {
- Comment childElement = (Comment)it.next();
+ for (Iterator<?> it = modelElement.getOwnedComments()
+ .iterator(); it.hasNext();) {
+ Comment childElement = (Comment) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CommentEditPartCN.VISUAL_ID) {
+ if (visualID == CommentEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedRules().iterator(); it.hasNext();) {
- Constraint childElement = (Constraint)it.next();
+ for (Iterator<?> it = modelElement.getOwnedRules()
+ .iterator(); it.hasNext();) {
+ Constraint childElement = (Constraint) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == DurationConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == DurationConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == TimeConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == TimeConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == ConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -2179,151 +2260,156 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getComponentInternalstructure_7056SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
+ if (false == view.eContainer() instanceof View) {
return Collections.emptyList();
}
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
+ View containerView = (View) view.eContainer();
+ if (!containerView.isSetElement()) {
return Collections.emptyList();
}
- Component modelElement = (Component)containerView.getElement();
+ Component modelElement = (Component) containerView.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PropertyPartEditPartCN.VISUAL_ID) {
+ if (visualID == PropertyPartEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getCollaborationUses().iterator(); it.hasNext();) {
- CollaborationUse childElement = (CollaborationUse)it.next();
+ for (Iterator<?> it = modelElement.getCollaborationUses()
+ .iterator(); it.hasNext();) {
+ CollaborationUse childElement = (CollaborationUse) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CollaborationUseEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationUseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getNestedClassifiers().iterator(); it.hasNext();) {
- Classifier childElement = (Classifier)it.next();
+ for (Iterator<?> it = modelElement.getNestedClassifiers()
+ .iterator(); it.hasNext();) {
+ Classifier childElement = (Classifier) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ActivityCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ActivityCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ProtocolStateMachineCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ProtocolStateMachineCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == StateMachineCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == StateMachineCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == FunctionBehaviorCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == FunctionBehaviorCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == OpaqueBehaviorCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == OpaqueBehaviorCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ComponentCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ComponentCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeviceCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == DeviceCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == NodeCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == NodeCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ClassCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ClassCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == CollaborationCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InterfaceEditPartCN.VISUAL_ID) {
+ if (visualID == InterfaceEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == PrimitiveTypeEditPartCN.VISUAL_ID) {
+ if (visualID == PrimitiveTypeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == EnumerationEditPartCN.VISUAL_ID) {
+ if (visualID == EnumerationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DataTypeEditPartCN.VISUAL_ID) {
+ if (visualID == DataTypeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ActorEditPartCN.VISUAL_ID) {
+ if (visualID == ActorEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeploymentSpecificationEditPartCN.VISUAL_ID) {
+ if (visualID == DeploymentSpecificationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ArtifactEditPartCN.VISUAL_ID) {
+ if (visualID == ArtifactEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InformationItemEditPartCN.VISUAL_ID) {
+ if (visualID == InformationItemEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == SignalEditPartCN.VISUAL_ID) {
+ if (visualID == SignalEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == UseCaseEditPartCN.VISUAL_ID) {
+ if (visualID == UseCaseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedComments().iterator(); it.hasNext();) {
- Comment childElement = (Comment)it.next();
+ for (Iterator<?> it = modelElement.getOwnedComments()
+ .iterator(); it.hasNext();) {
+ Comment childElement = (Comment) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CommentEditPartCN.VISUAL_ID) {
+ if (visualID == CommentEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedRules().iterator(); it.hasNext();) {
- Constraint childElement = (Constraint)it.next();
+ for (Iterator<?> it = modelElement.getOwnedRules()
+ .iterator(); it.hasNext();) {
+ Constraint childElement = (Constraint) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == DurationConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == DurationConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == TimeConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == TimeConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == ConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -2335,151 +2421,156 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getDeviceInternalstructure_7057SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
+ if (false == view.eContainer() instanceof View) {
return Collections.emptyList();
}
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
+ View containerView = (View) view.eContainer();
+ if (!containerView.isSetElement()) {
return Collections.emptyList();
}
- Device modelElement = (Device)containerView.getElement();
+ Device modelElement = (Device) containerView.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PropertyPartEditPartCN.VISUAL_ID) {
+ if (visualID == PropertyPartEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getCollaborationUses().iterator(); it.hasNext();) {
- CollaborationUse childElement = (CollaborationUse)it.next();
+ for (Iterator<?> it = modelElement.getCollaborationUses()
+ .iterator(); it.hasNext();) {
+ CollaborationUse childElement = (CollaborationUse) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CollaborationUseEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationUseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getNestedClassifiers().iterator(); it.hasNext();) {
- Classifier childElement = (Classifier)it.next();
+ for (Iterator<?> it = modelElement.getNestedClassifiers()
+ .iterator(); it.hasNext();) {
+ Classifier childElement = (Classifier) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ActivityCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ActivityCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ProtocolStateMachineCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ProtocolStateMachineCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == StateMachineCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == StateMachineCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == FunctionBehaviorCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == FunctionBehaviorCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == OpaqueBehaviorCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == OpaqueBehaviorCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ComponentCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ComponentCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeviceCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == DeviceCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == NodeCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == NodeCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ClassCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ClassCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == CollaborationCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InterfaceEditPartCN.VISUAL_ID) {
+ if (visualID == InterfaceEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == PrimitiveTypeEditPartCN.VISUAL_ID) {
+ if (visualID == PrimitiveTypeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == EnumerationEditPartCN.VISUAL_ID) {
+ if (visualID == EnumerationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DataTypeEditPartCN.VISUAL_ID) {
+ if (visualID == DataTypeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ActorEditPartCN.VISUAL_ID) {
+ if (visualID == ActorEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeploymentSpecificationEditPartCN.VISUAL_ID) {
+ if (visualID == DeploymentSpecificationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ArtifactEditPartCN.VISUAL_ID) {
+ if (visualID == ArtifactEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InformationItemEditPartCN.VISUAL_ID) {
+ if (visualID == InformationItemEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == SignalEditPartCN.VISUAL_ID) {
+ if (visualID == SignalEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == UseCaseEditPartCN.VISUAL_ID) {
+ if (visualID == UseCaseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedComments().iterator(); it.hasNext();) {
- Comment childElement = (Comment)it.next();
+ for (Iterator<?> it = modelElement.getOwnedComments()
+ .iterator(); it.hasNext();) {
+ Comment childElement = (Comment) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CommentEditPartCN.VISUAL_ID) {
+ if (visualID == CommentEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedRules().iterator(); it.hasNext();) {
- Constraint childElement = (Constraint)it.next();
+ for (Iterator<?> it = modelElement.getOwnedRules()
+ .iterator(); it.hasNext();) {
+ Constraint childElement = (Constraint) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == DurationConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == DurationConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == TimeConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == TimeConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == ConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -2491,151 +2582,156 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getExecutionEnvironmentInternalstructure_7058SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
+ if (false == view.eContainer() instanceof View) {
return Collections.emptyList();
}
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
+ View containerView = (View) view.eContainer();
+ if (!containerView.isSetElement()) {
return Collections.emptyList();
}
- ExecutionEnvironment modelElement = (ExecutionEnvironment)containerView.getElement();
+ ExecutionEnvironment modelElement = (ExecutionEnvironment) containerView.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PropertyPartEditPartCN.VISUAL_ID) {
+ if (visualID == PropertyPartEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getCollaborationUses().iterator(); it.hasNext();) {
- CollaborationUse childElement = (CollaborationUse)it.next();
+ for (Iterator<?> it = modelElement.getCollaborationUses()
+ .iterator(); it.hasNext();) {
+ CollaborationUse childElement = (CollaborationUse) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CollaborationUseEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationUseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getNestedClassifiers().iterator(); it.hasNext();) {
- Classifier childElement = (Classifier)it.next();
+ for (Iterator<?> it = modelElement.getNestedClassifiers()
+ .iterator(); it.hasNext();) {
+ Classifier childElement = (Classifier) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ActivityCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ActivityCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ProtocolStateMachineCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ProtocolStateMachineCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == StateMachineCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == StateMachineCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == FunctionBehaviorCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == FunctionBehaviorCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == OpaqueBehaviorCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == OpaqueBehaviorCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ComponentCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ComponentCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeviceCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == DeviceCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == NodeCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == NodeCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ClassCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ClassCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == CollaborationCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InterfaceEditPartCN.VISUAL_ID) {
+ if (visualID == InterfaceEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == PrimitiveTypeEditPartCN.VISUAL_ID) {
+ if (visualID == PrimitiveTypeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == EnumerationEditPartCN.VISUAL_ID) {
+ if (visualID == EnumerationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DataTypeEditPartCN.VISUAL_ID) {
+ if (visualID == DataTypeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ActorEditPartCN.VISUAL_ID) {
+ if (visualID == ActorEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeploymentSpecificationEditPartCN.VISUAL_ID) {
+ if (visualID == DeploymentSpecificationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ArtifactEditPartCN.VISUAL_ID) {
+ if (visualID == ArtifactEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InformationItemEditPartCN.VISUAL_ID) {
+ if (visualID == InformationItemEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == SignalEditPartCN.VISUAL_ID) {
+ if (visualID == SignalEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == UseCaseEditPartCN.VISUAL_ID) {
+ if (visualID == UseCaseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedComments().iterator(); it.hasNext();) {
- Comment childElement = (Comment)it.next();
+ for (Iterator<?> it = modelElement.getOwnedComments()
+ .iterator(); it.hasNext();) {
+ Comment childElement = (Comment) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CommentEditPartCN.VISUAL_ID) {
+ if (visualID == CommentEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedRules().iterator(); it.hasNext();) {
- Constraint childElement = (Constraint)it.next();
+ for (Iterator<?> it = modelElement.getOwnedRules()
+ .iterator(); it.hasNext();) {
+ Constraint childElement = (Constraint) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == DurationConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == DurationConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == TimeConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == TimeConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == ConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -2647,151 +2743,156 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getNodeInternalstructure_7059SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
+ if (false == view.eContainer() instanceof View) {
return Collections.emptyList();
}
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
+ View containerView = (View) view.eContainer();
+ if (!containerView.isSetElement()) {
return Collections.emptyList();
}
- Node modelElement = (Node)containerView.getElement();
+ Node modelElement = (Node) containerView.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PropertyPartEditPartCN.VISUAL_ID) {
+ if (visualID == PropertyPartEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getCollaborationUses().iterator(); it.hasNext();) {
- CollaborationUse childElement = (CollaborationUse)it.next();
+ for (Iterator<?> it = modelElement.getCollaborationUses()
+ .iterator(); it.hasNext();) {
+ CollaborationUse childElement = (CollaborationUse) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CollaborationUseEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationUseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getNestedClassifiers().iterator(); it.hasNext();) {
- Classifier childElement = (Classifier)it.next();
+ for (Iterator<?> it = modelElement.getNestedClassifiers()
+ .iterator(); it.hasNext();) {
+ Classifier childElement = (Classifier) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ActivityCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ActivityCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ProtocolStateMachineCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ProtocolStateMachineCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == StateMachineCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == StateMachineCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == FunctionBehaviorCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == FunctionBehaviorCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == OpaqueBehaviorCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == OpaqueBehaviorCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ComponentCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ComponentCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeviceCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == DeviceCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == NodeCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == NodeCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ClassCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ClassCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == CollaborationCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InterfaceEditPartCN.VISUAL_ID) {
+ if (visualID == InterfaceEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == PrimitiveTypeEditPartCN.VISUAL_ID) {
+ if (visualID == PrimitiveTypeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == EnumerationEditPartCN.VISUAL_ID) {
+ if (visualID == EnumerationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DataTypeEditPartCN.VISUAL_ID) {
+ if (visualID == DataTypeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ActorEditPartCN.VISUAL_ID) {
+ if (visualID == ActorEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeploymentSpecificationEditPartCN.VISUAL_ID) {
+ if (visualID == DeploymentSpecificationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ArtifactEditPartCN.VISUAL_ID) {
+ if (visualID == ArtifactEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InformationItemEditPartCN.VISUAL_ID) {
+ if (visualID == InformationItemEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == SignalEditPartCN.VISUAL_ID) {
+ if (visualID == SignalEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == UseCaseEditPartCN.VISUAL_ID) {
+ if (visualID == UseCaseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedComments().iterator(); it.hasNext();) {
- Comment childElement = (Comment)it.next();
+ for (Iterator<?> it = modelElement.getOwnedComments()
+ .iterator(); it.hasNext();) {
+ Comment childElement = (Comment) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CommentEditPartCN.VISUAL_ID) {
+ if (visualID == CommentEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedRules().iterator(); it.hasNext();) {
- Constraint childElement = (Constraint)it.next();
+ for (Iterator<?> it = modelElement.getOwnedRules()
+ .iterator(); it.hasNext();) {
+ Constraint childElement = (Constraint) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == DurationConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == DurationConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == TimeConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == TimeConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == ConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -2803,151 +2904,156 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getClassInternalstructure_7060SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
+ if (false == view.eContainer() instanceof View) {
return Collections.emptyList();
}
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
+ View containerView = (View) view.eContainer();
+ if (!containerView.isSetElement()) {
return Collections.emptyList();
}
- Class modelElement = (Class)containerView.getElement();
+ Class modelElement = (Class) containerView.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PropertyPartEditPartCN.VISUAL_ID) {
+ if (visualID == PropertyPartEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getCollaborationUses().iterator(); it.hasNext();) {
- CollaborationUse childElement = (CollaborationUse)it.next();
+ for (Iterator<?> it = modelElement.getCollaborationUses()
+ .iterator(); it.hasNext();) {
+ CollaborationUse childElement = (CollaborationUse) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CollaborationUseEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationUseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getNestedClassifiers().iterator(); it.hasNext();) {
- Classifier childElement = (Classifier)it.next();
+ for (Iterator<?> it = modelElement.getNestedClassifiers()
+ .iterator(); it.hasNext();) {
+ Classifier childElement = (Classifier) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ActivityCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ActivityCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ProtocolStateMachineCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ProtocolStateMachineCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == StateMachineCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == StateMachineCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == FunctionBehaviorCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == FunctionBehaviorCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == OpaqueBehaviorCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == OpaqueBehaviorCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ComponentCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ComponentCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeviceCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == DeviceCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == NodeCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == NodeCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ClassCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ClassCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == CollaborationCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InterfaceEditPartCN.VISUAL_ID) {
+ if (visualID == InterfaceEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == PrimitiveTypeEditPartCN.VISUAL_ID) {
+ if (visualID == PrimitiveTypeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == EnumerationEditPartCN.VISUAL_ID) {
+ if (visualID == EnumerationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DataTypeEditPartCN.VISUAL_ID) {
+ if (visualID == DataTypeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ActorEditPartCN.VISUAL_ID) {
+ if (visualID == ActorEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeploymentSpecificationEditPartCN.VISUAL_ID) {
+ if (visualID == DeploymentSpecificationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ArtifactEditPartCN.VISUAL_ID) {
+ if (visualID == ArtifactEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InformationItemEditPartCN.VISUAL_ID) {
+ if (visualID == InformationItemEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == SignalEditPartCN.VISUAL_ID) {
+ if (visualID == SignalEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == UseCaseEditPartCN.VISUAL_ID) {
+ if (visualID == UseCaseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedComments().iterator(); it.hasNext();) {
- Comment childElement = (Comment)it.next();
+ for (Iterator<?> it = modelElement.getOwnedComments()
+ .iterator(); it.hasNext();) {
+ Comment childElement = (Comment) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CommentEditPartCN.VISUAL_ID) {
+ if (visualID == CommentEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedRules().iterator(); it.hasNext();) {
- Constraint childElement = (Constraint)it.next();
+ for (Iterator<?> it = modelElement.getOwnedRules()
+ .iterator(); it.hasNext();) {
+ Constraint childElement = (Constraint) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == DurationConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == DurationConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == TimeConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == TimeConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == ConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -2959,67 +3065,72 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getCollaborationInternalstructure_7061SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
+ if (false == view.eContainer() instanceof View) {
return Collections.emptyList();
}
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
+ View containerView = (View) view.eContainer();
+ if (!containerView.isSetElement()) {
return Collections.emptyList();
}
- Collaboration modelElement = (Collaboration)containerView.getElement();
+ Collaboration modelElement = (Collaboration) containerView.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PropertyPartEditPartCN.VISUAL_ID) {
+ if (visualID == PropertyPartEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getCollaborationUses().iterator(); it.hasNext();) {
- CollaborationUse childElement = (CollaborationUse)it.next();
+ for (Iterator<?> it = modelElement.getCollaborationUses()
+ .iterator(); it.hasNext();) {
+ CollaborationUse childElement = (CollaborationUse) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CollaborationUseEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationUseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedComments().iterator(); it.hasNext();) {
- Comment childElement = (Comment)it.next();
+ for (Iterator<?> it = modelElement.getOwnedComments()
+ .iterator(); it.hasNext();) {
+ Comment childElement = (Comment) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CommentEditPartCN.VISUAL_ID) {
+ if (visualID == CommentEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getRoles().iterator(); it.hasNext();) {
- ConnectableElement childElement = (ConnectableElement)it.next();
+ for (Iterator<?> it = modelElement.getRoles()
+ .iterator(); it.hasNext();) {
+ ConnectableElement childElement = (ConnectableElement) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CollaborationRoleEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationRoleEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedRules().iterator(); it.hasNext();) {
- Constraint childElement = (Constraint)it.next();
+ for (Iterator<?> it = modelElement.getOwnedRules()
+ .iterator(); it.hasNext();) {
+ Constraint childElement = (Constraint) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == DurationConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == DurationConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == TimeConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == TimeConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == ConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -3031,159 +3142,165 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getActivityInternalstructure_7063SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
+ if (false == view.eContainer() instanceof View) {
return Collections.emptyList();
}
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
+ View containerView = (View) view.eContainer();
+ if (!containerView.isSetElement()) {
return Collections.emptyList();
}
- Activity modelElement = (Activity)containerView.getElement();
+ Activity modelElement = (Activity) containerView.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedParameters().iterator(); it.hasNext();) {
- Parameter childElement = (Parameter)it.next();
+ for (Iterator<?> it = modelElement.getOwnedParameters()
+ .iterator(); it.hasNext();) {
+ Parameter childElement = (Parameter) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ParameterEditPart.VISUAL_ID) {
+ if (visualID == ParameterEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PropertyPartEditPartCN.VISUAL_ID) {
+ if (visualID == PropertyPartEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getCollaborationUses().iterator(); it.hasNext();) {
- CollaborationUse childElement = (CollaborationUse)it.next();
+ for (Iterator<?> it = modelElement.getCollaborationUses()
+ .iterator(); it.hasNext();) {
+ CollaborationUse childElement = (CollaborationUse) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CollaborationUseEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationUseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getNestedClassifiers().iterator(); it.hasNext();) {
- Classifier childElement = (Classifier)it.next();
+ for (Iterator<?> it = modelElement.getNestedClassifiers()
+ .iterator(); it.hasNext();) {
+ Classifier childElement = (Classifier) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ActivityCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ActivityCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ProtocolStateMachineCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ProtocolStateMachineCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == StateMachineCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == StateMachineCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == FunctionBehaviorCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == FunctionBehaviorCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == OpaqueBehaviorCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == OpaqueBehaviorCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ComponentCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ComponentCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeviceCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == DeviceCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == NodeCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == NodeCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ClassCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ClassCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == CollaborationCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InterfaceEditPartCN.VISUAL_ID) {
+ if (visualID == InterfaceEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == PrimitiveTypeEditPartCN.VISUAL_ID) {
+ if (visualID == PrimitiveTypeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == EnumerationEditPartCN.VISUAL_ID) {
+ if (visualID == EnumerationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DataTypeEditPartCN.VISUAL_ID) {
+ if (visualID == DataTypeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ActorEditPartCN.VISUAL_ID) {
+ if (visualID == ActorEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeploymentSpecificationEditPartCN.VISUAL_ID) {
+ if (visualID == DeploymentSpecificationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ArtifactEditPartCN.VISUAL_ID) {
+ if (visualID == ArtifactEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InformationItemEditPartCN.VISUAL_ID) {
+ if (visualID == InformationItemEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == SignalEditPartCN.VISUAL_ID) {
+ if (visualID == SignalEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == UseCaseEditPartCN.VISUAL_ID) {
+ if (visualID == UseCaseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedComments().iterator(); it.hasNext();) {
- Comment childElement = (Comment)it.next();
+ for (Iterator<?> it = modelElement.getOwnedComments()
+ .iterator(); it.hasNext();) {
+ Comment childElement = (Comment) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CommentEditPartCN.VISUAL_ID) {
+ if (visualID == CommentEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedRules().iterator(); it.hasNext();) {
- Constraint childElement = (Constraint)it.next();
+ for (Iterator<?> it = modelElement.getOwnedRules()
+ .iterator(); it.hasNext();) {
+ Constraint childElement = (Constraint) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == DurationConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == DurationConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == TimeConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == TimeConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == ConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -3195,159 +3312,165 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getInteractionInternalstructure_7064SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
+ if (false == view.eContainer() instanceof View) {
return Collections.emptyList();
}
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
+ View containerView = (View) view.eContainer();
+ if (!containerView.isSetElement()) {
return Collections.emptyList();
}
- Interaction modelElement = (Interaction)containerView.getElement();
+ Interaction modelElement = (Interaction) containerView.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedParameters().iterator(); it.hasNext();) {
- Parameter childElement = (Parameter)it.next();
+ for (Iterator<?> it = modelElement.getOwnedParameters()
+ .iterator(); it.hasNext();) {
+ Parameter childElement = (Parameter) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ParameterEditPart.VISUAL_ID) {
+ if (visualID == ParameterEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PropertyPartEditPartCN.VISUAL_ID) {
+ if (visualID == PropertyPartEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getCollaborationUses().iterator(); it.hasNext();) {
- CollaborationUse childElement = (CollaborationUse)it.next();
+ for (Iterator<?> it = modelElement.getCollaborationUses()
+ .iterator(); it.hasNext();) {
+ CollaborationUse childElement = (CollaborationUse) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CollaborationUseEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationUseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getNestedClassifiers().iterator(); it.hasNext();) {
- Classifier childElement = (Classifier)it.next();
+ for (Iterator<?> it = modelElement.getNestedClassifiers()
+ .iterator(); it.hasNext();) {
+ Classifier childElement = (Classifier) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ActivityCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ActivityCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ProtocolStateMachineCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ProtocolStateMachineCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == StateMachineCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == StateMachineCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == FunctionBehaviorCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == FunctionBehaviorCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == OpaqueBehaviorCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == OpaqueBehaviorCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ComponentCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ComponentCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeviceCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == DeviceCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == NodeCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == NodeCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ClassCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ClassCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == CollaborationCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InterfaceEditPartCN.VISUAL_ID) {
+ if (visualID == InterfaceEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == PrimitiveTypeEditPartCN.VISUAL_ID) {
+ if (visualID == PrimitiveTypeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == EnumerationEditPartCN.VISUAL_ID) {
+ if (visualID == EnumerationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DataTypeEditPartCN.VISUAL_ID) {
+ if (visualID == DataTypeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ActorEditPartCN.VISUAL_ID) {
+ if (visualID == ActorEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeploymentSpecificationEditPartCN.VISUAL_ID) {
+ if (visualID == DeploymentSpecificationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ArtifactEditPartCN.VISUAL_ID) {
+ if (visualID == ArtifactEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InformationItemEditPartCN.VISUAL_ID) {
+ if (visualID == InformationItemEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == SignalEditPartCN.VISUAL_ID) {
+ if (visualID == SignalEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == UseCaseEditPartCN.VISUAL_ID) {
+ if (visualID == UseCaseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedComments().iterator(); it.hasNext();) {
- Comment childElement = (Comment)it.next();
+ for (Iterator<?> it = modelElement.getOwnedComments()
+ .iterator(); it.hasNext();) {
+ Comment childElement = (Comment) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CommentEditPartCN.VISUAL_ID) {
+ if (visualID == CommentEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedRules().iterator(); it.hasNext();) {
- Constraint childElement = (Constraint)it.next();
+ for (Iterator<?> it = modelElement.getOwnedRules()
+ .iterator(); it.hasNext();) {
+ Constraint childElement = (Constraint) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == DurationConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == DurationConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == TimeConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == TimeConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == ConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -3359,159 +3482,165 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getProtocolStateMachineInternalstructure_7065SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
+ if (false == view.eContainer() instanceof View) {
return Collections.emptyList();
}
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
+ View containerView = (View) view.eContainer();
+ if (!containerView.isSetElement()) {
return Collections.emptyList();
}
- ProtocolStateMachine modelElement = (ProtocolStateMachine)containerView.getElement();
+ ProtocolStateMachine modelElement = (ProtocolStateMachine) containerView.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedParameters().iterator(); it.hasNext();) {
- Parameter childElement = (Parameter)it.next();
+ for (Iterator<?> it = modelElement.getOwnedParameters()
+ .iterator(); it.hasNext();) {
+ Parameter childElement = (Parameter) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ParameterEditPart.VISUAL_ID) {
+ if (visualID == ParameterEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PropertyPartEditPartCN.VISUAL_ID) {
+ if (visualID == PropertyPartEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getCollaborationUses().iterator(); it.hasNext();) {
- CollaborationUse childElement = (CollaborationUse)it.next();
+ for (Iterator<?> it = modelElement.getCollaborationUses()
+ .iterator(); it.hasNext();) {
+ CollaborationUse childElement = (CollaborationUse) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CollaborationUseEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationUseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getNestedClassifiers().iterator(); it.hasNext();) {
- Classifier childElement = (Classifier)it.next();
+ for (Iterator<?> it = modelElement.getNestedClassifiers()
+ .iterator(); it.hasNext();) {
+ Classifier childElement = (Classifier) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ActivityCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ActivityCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ProtocolStateMachineCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ProtocolStateMachineCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == StateMachineCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == StateMachineCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == FunctionBehaviorCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == FunctionBehaviorCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == OpaqueBehaviorCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == OpaqueBehaviorCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ComponentCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ComponentCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeviceCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == DeviceCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == NodeCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == NodeCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ClassCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ClassCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == CollaborationCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InterfaceEditPartCN.VISUAL_ID) {
+ if (visualID == InterfaceEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == PrimitiveTypeEditPartCN.VISUAL_ID) {
+ if (visualID == PrimitiveTypeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == EnumerationEditPartCN.VISUAL_ID) {
+ if (visualID == EnumerationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DataTypeEditPartCN.VISUAL_ID) {
+ if (visualID == DataTypeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ActorEditPartCN.VISUAL_ID) {
+ if (visualID == ActorEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeploymentSpecificationEditPartCN.VISUAL_ID) {
+ if (visualID == DeploymentSpecificationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ArtifactEditPartCN.VISUAL_ID) {
+ if (visualID == ArtifactEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InformationItemEditPartCN.VISUAL_ID) {
+ if (visualID == InformationItemEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == SignalEditPartCN.VISUAL_ID) {
+ if (visualID == SignalEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == UseCaseEditPartCN.VISUAL_ID) {
+ if (visualID == UseCaseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedComments().iterator(); it.hasNext();) {
- Comment childElement = (Comment)it.next();
+ for (Iterator<?> it = modelElement.getOwnedComments()
+ .iterator(); it.hasNext();) {
+ Comment childElement = (Comment) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CommentEditPartCN.VISUAL_ID) {
+ if (visualID == CommentEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedRules().iterator(); it.hasNext();) {
- Constraint childElement = (Constraint)it.next();
+ for (Iterator<?> it = modelElement.getOwnedRules()
+ .iterator(); it.hasNext();) {
+ Constraint childElement = (Constraint) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == DurationConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == DurationConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == TimeConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == TimeConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == ConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -3523,159 +3652,165 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getStateMachineInternalstructure_7066SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
+ if (false == view.eContainer() instanceof View) {
return Collections.emptyList();
}
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
+ View containerView = (View) view.eContainer();
+ if (!containerView.isSetElement()) {
return Collections.emptyList();
}
- StateMachine modelElement = (StateMachine)containerView.getElement();
+ StateMachine modelElement = (StateMachine) containerView.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedParameters().iterator(); it.hasNext();) {
- Parameter childElement = (Parameter)it.next();
+ for (Iterator<?> it = modelElement.getOwnedParameters()
+ .iterator(); it.hasNext();) {
+ Parameter childElement = (Parameter) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ParameterEditPart.VISUAL_ID) {
+ if (visualID == ParameterEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PropertyPartEditPartCN.VISUAL_ID) {
+ if (visualID == PropertyPartEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getCollaborationUses().iterator(); it.hasNext();) {
- CollaborationUse childElement = (CollaborationUse)it.next();
+ for (Iterator<?> it = modelElement.getCollaborationUses()
+ .iterator(); it.hasNext();) {
+ CollaborationUse childElement = (CollaborationUse) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CollaborationUseEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationUseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getNestedClassifiers().iterator(); it.hasNext();) {
- Classifier childElement = (Classifier)it.next();
+ for (Iterator<?> it = modelElement.getNestedClassifiers()
+ .iterator(); it.hasNext();) {
+ Classifier childElement = (Classifier) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ActivityCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ActivityCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ProtocolStateMachineCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ProtocolStateMachineCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == StateMachineCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == StateMachineCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == FunctionBehaviorCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == FunctionBehaviorCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == OpaqueBehaviorCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == OpaqueBehaviorCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ComponentCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ComponentCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeviceCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == DeviceCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == NodeCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == NodeCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ClassCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ClassCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == CollaborationCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InterfaceEditPartCN.VISUAL_ID) {
+ if (visualID == InterfaceEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == PrimitiveTypeEditPartCN.VISUAL_ID) {
+ if (visualID == PrimitiveTypeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == EnumerationEditPartCN.VISUAL_ID) {
+ if (visualID == EnumerationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DataTypeEditPartCN.VISUAL_ID) {
+ if (visualID == DataTypeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ActorEditPartCN.VISUAL_ID) {
+ if (visualID == ActorEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeploymentSpecificationEditPartCN.VISUAL_ID) {
+ if (visualID == DeploymentSpecificationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ArtifactEditPartCN.VISUAL_ID) {
+ if (visualID == ArtifactEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InformationItemEditPartCN.VISUAL_ID) {
+ if (visualID == InformationItemEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == SignalEditPartCN.VISUAL_ID) {
+ if (visualID == SignalEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == UseCaseEditPartCN.VISUAL_ID) {
+ if (visualID == UseCaseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedComments().iterator(); it.hasNext();) {
- Comment childElement = (Comment)it.next();
+ for (Iterator<?> it = modelElement.getOwnedComments()
+ .iterator(); it.hasNext();) {
+ Comment childElement = (Comment) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CommentEditPartCN.VISUAL_ID) {
+ if (visualID == CommentEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedRules().iterator(); it.hasNext();) {
- Constraint childElement = (Constraint)it.next();
+ for (Iterator<?> it = modelElement.getOwnedRules()
+ .iterator(); it.hasNext();) {
+ Constraint childElement = (Constraint) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == DurationConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == DurationConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == TimeConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == TimeConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == ConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -3687,159 +3822,165 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getFunctionBehaviorInternalstructure_7067SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
+ if (false == view.eContainer() instanceof View) {
return Collections.emptyList();
}
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
+ View containerView = (View) view.eContainer();
+ if (!containerView.isSetElement()) {
return Collections.emptyList();
}
- FunctionBehavior modelElement = (FunctionBehavior)containerView.getElement();
+ FunctionBehavior modelElement = (FunctionBehavior) containerView.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedParameters().iterator(); it.hasNext();) {
- Parameter childElement = (Parameter)it.next();
+ for (Iterator<?> it = modelElement.getOwnedParameters()
+ .iterator(); it.hasNext();) {
+ Parameter childElement = (Parameter) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ParameterEditPart.VISUAL_ID) {
+ if (visualID == ParameterEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PropertyPartEditPartCN.VISUAL_ID) {
+ if (visualID == PropertyPartEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getCollaborationUses().iterator(); it.hasNext();) {
- CollaborationUse childElement = (CollaborationUse)it.next();
+ for (Iterator<?> it = modelElement.getCollaborationUses()
+ .iterator(); it.hasNext();) {
+ CollaborationUse childElement = (CollaborationUse) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CollaborationUseEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationUseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getNestedClassifiers().iterator(); it.hasNext();) {
- Classifier childElement = (Classifier)it.next();
+ for (Iterator<?> it = modelElement.getNestedClassifiers()
+ .iterator(); it.hasNext();) {
+ Classifier childElement = (Classifier) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ActivityCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ActivityCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ProtocolStateMachineCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ProtocolStateMachineCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == StateMachineCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == StateMachineCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == FunctionBehaviorCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == FunctionBehaviorCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == OpaqueBehaviorCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == OpaqueBehaviorCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ComponentCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ComponentCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeviceCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == DeviceCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == NodeCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == NodeCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ClassCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ClassCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == CollaborationCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InterfaceEditPartCN.VISUAL_ID) {
+ if (visualID == InterfaceEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == PrimitiveTypeEditPartCN.VISUAL_ID) {
+ if (visualID == PrimitiveTypeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == EnumerationEditPartCN.VISUAL_ID) {
+ if (visualID == EnumerationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DataTypeEditPartCN.VISUAL_ID) {
+ if (visualID == DataTypeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ActorEditPartCN.VISUAL_ID) {
+ if (visualID == ActorEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeploymentSpecificationEditPartCN.VISUAL_ID) {
+ if (visualID == DeploymentSpecificationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ArtifactEditPartCN.VISUAL_ID) {
+ if (visualID == ArtifactEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InformationItemEditPartCN.VISUAL_ID) {
+ if (visualID == InformationItemEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == SignalEditPartCN.VISUAL_ID) {
+ if (visualID == SignalEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == UseCaseEditPartCN.VISUAL_ID) {
+ if (visualID == UseCaseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedComments().iterator(); it.hasNext();) {
- Comment childElement = (Comment)it.next();
+ for (Iterator<?> it = modelElement.getOwnedComments()
+ .iterator(); it.hasNext();) {
+ Comment childElement = (Comment) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CommentEditPartCN.VISUAL_ID) {
+ if (visualID == CommentEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedRules().iterator(); it.hasNext();) {
- Constraint childElement = (Constraint)it.next();
+ for (Iterator<?> it = modelElement.getOwnedRules()
+ .iterator(); it.hasNext();) {
+ Constraint childElement = (Constraint) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == DurationConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == DurationConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == TimeConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == TimeConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == ConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -3851,159 +3992,165 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getOpaqueBehaviorInternalstructure_7068SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
+ if (false == view.eContainer() instanceof View) {
return Collections.emptyList();
}
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
+ View containerView = (View) view.eContainer();
+ if (!containerView.isSetElement()) {
return Collections.emptyList();
}
- OpaqueBehavior modelElement = (OpaqueBehavior)containerView.getElement();
+ OpaqueBehavior modelElement = (OpaqueBehavior) containerView.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedParameters().iterator(); it.hasNext();) {
- Parameter childElement = (Parameter)it.next();
+ for (Iterator<?> it = modelElement.getOwnedParameters()
+ .iterator(); it.hasNext();) {
+ Parameter childElement = (Parameter) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ParameterEditPart.VISUAL_ID) {
+ if (visualID == ParameterEditPart.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PropertyPartEditPartCN.VISUAL_ID) {
+ if (visualID == PropertyPartEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getCollaborationUses().iterator(); it.hasNext();) {
- CollaborationUse childElement = (CollaborationUse)it.next();
+ for (Iterator<?> it = modelElement.getCollaborationUses()
+ .iterator(); it.hasNext();) {
+ CollaborationUse childElement = (CollaborationUse) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CollaborationUseEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationUseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getNestedClassifiers().iterator(); it.hasNext();) {
- Classifier childElement = (Classifier)it.next();
+ for (Iterator<?> it = modelElement.getNestedClassifiers()
+ .iterator(); it.hasNext();) {
+ Classifier childElement = (Classifier) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ActivityCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ActivityCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ProtocolStateMachineCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ProtocolStateMachineCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == StateMachineCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == StateMachineCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == FunctionBehaviorCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == FunctionBehaviorCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == OpaqueBehaviorCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == OpaqueBehaviorCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ComponentCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ComponentCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeviceCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == DeviceCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == NodeCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == NodeCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ClassCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ClassCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == CollaborationCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InterfaceEditPartCN.VISUAL_ID) {
+ if (visualID == InterfaceEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == PrimitiveTypeEditPartCN.VISUAL_ID) {
+ if (visualID == PrimitiveTypeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == EnumerationEditPartCN.VISUAL_ID) {
+ if (visualID == EnumerationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DataTypeEditPartCN.VISUAL_ID) {
+ if (visualID == DataTypeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ActorEditPartCN.VISUAL_ID) {
+ if (visualID == ActorEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeploymentSpecificationEditPartCN.VISUAL_ID) {
+ if (visualID == DeploymentSpecificationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ArtifactEditPartCN.VISUAL_ID) {
+ if (visualID == ArtifactEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InformationItemEditPartCN.VISUAL_ID) {
+ if (visualID == InformationItemEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == SignalEditPartCN.VISUAL_ID) {
+ if (visualID == SignalEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == UseCaseEditPartCN.VISUAL_ID) {
+ if (visualID == UseCaseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedComments().iterator(); it.hasNext();) {
- Comment childElement = (Comment)it.next();
+ for (Iterator<?> it = modelElement.getOwnedComments()
+ .iterator(); it.hasNext();) {
+ Comment childElement = (Comment) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CommentEditPartCN.VISUAL_ID) {
+ if (visualID == CommentEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedRules().iterator(); it.hasNext();) {
- Constraint childElement = (Constraint)it.next();
+ for (Iterator<?> it = modelElement.getOwnedRules()
+ .iterator(); it.hasNext();) {
+ Constraint childElement = (Constraint) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == DurationConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == DurationConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == TimeConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == TimeConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == ConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -4015,151 +4162,156 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getComponentInternalstructure_7069SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
+ if (false == view.eContainer() instanceof View) {
return Collections.emptyList();
}
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
+ View containerView = (View) view.eContainer();
+ if (!containerView.isSetElement()) {
return Collections.emptyList();
}
- Component modelElement = (Component)containerView.getElement();
+ Component modelElement = (Component) containerView.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PropertyPartEditPartCN.VISUAL_ID) {
+ if (visualID == PropertyPartEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getCollaborationUses().iterator(); it.hasNext();) {
- CollaborationUse childElement = (CollaborationUse)it.next();
+ for (Iterator<?> it = modelElement.getCollaborationUses()
+ .iterator(); it.hasNext();) {
+ CollaborationUse childElement = (CollaborationUse) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CollaborationUseEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationUseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getNestedClassifiers().iterator(); it.hasNext();) {
- Classifier childElement = (Classifier)it.next();
+ for (Iterator<?> it = modelElement.getNestedClassifiers()
+ .iterator(); it.hasNext();) {
+ Classifier childElement = (Classifier) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ActivityCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ActivityCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ProtocolStateMachineCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ProtocolStateMachineCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == StateMachineCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == StateMachineCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == FunctionBehaviorCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == FunctionBehaviorCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == OpaqueBehaviorCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == OpaqueBehaviorCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ComponentCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ComponentCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeviceCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == DeviceCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == NodeCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == NodeCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ClassCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ClassCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == CollaborationCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InterfaceEditPartCN.VISUAL_ID) {
+ if (visualID == InterfaceEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == PrimitiveTypeEditPartCN.VISUAL_ID) {
+ if (visualID == PrimitiveTypeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == EnumerationEditPartCN.VISUAL_ID) {
+ if (visualID == EnumerationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DataTypeEditPartCN.VISUAL_ID) {
+ if (visualID == DataTypeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ActorEditPartCN.VISUAL_ID) {
+ if (visualID == ActorEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeploymentSpecificationEditPartCN.VISUAL_ID) {
+ if (visualID == DeploymentSpecificationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ArtifactEditPartCN.VISUAL_ID) {
+ if (visualID == ArtifactEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InformationItemEditPartCN.VISUAL_ID) {
+ if (visualID == InformationItemEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == SignalEditPartCN.VISUAL_ID) {
+ if (visualID == SignalEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == UseCaseEditPartCN.VISUAL_ID) {
+ if (visualID == UseCaseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedComments().iterator(); it.hasNext();) {
- Comment childElement = (Comment)it.next();
+ for (Iterator<?> it = modelElement.getOwnedComments()
+ .iterator(); it.hasNext();) {
+ Comment childElement = (Comment) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CommentEditPartCN.VISUAL_ID) {
+ if (visualID == CommentEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedRules().iterator(); it.hasNext();) {
- Constraint childElement = (Constraint)it.next();
+ for (Iterator<?> it = modelElement.getOwnedRules()
+ .iterator(); it.hasNext();) {
+ Constraint childElement = (Constraint) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == DurationConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == DurationConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == TimeConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == TimeConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == ConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -4171,151 +4323,156 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getDeviceInternalstructure_7070SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
+ if (false == view.eContainer() instanceof View) {
return Collections.emptyList();
}
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
+ View containerView = (View) view.eContainer();
+ if (!containerView.isSetElement()) {
return Collections.emptyList();
}
- Device modelElement = (Device)containerView.getElement();
+ Device modelElement = (Device) containerView.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PropertyPartEditPartCN.VISUAL_ID) {
+ if (visualID == PropertyPartEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getCollaborationUses().iterator(); it.hasNext();) {
- CollaborationUse childElement = (CollaborationUse)it.next();
+ for (Iterator<?> it = modelElement.getCollaborationUses()
+ .iterator(); it.hasNext();) {
+ CollaborationUse childElement = (CollaborationUse) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CollaborationUseEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationUseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getNestedClassifiers().iterator(); it.hasNext();) {
- Classifier childElement = (Classifier)it.next();
+ for (Iterator<?> it = modelElement.getNestedClassifiers()
+ .iterator(); it.hasNext();) {
+ Classifier childElement = (Classifier) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ActivityCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ActivityCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ProtocolStateMachineCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ProtocolStateMachineCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == StateMachineCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == StateMachineCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == FunctionBehaviorCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == FunctionBehaviorCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == OpaqueBehaviorCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == OpaqueBehaviorCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ComponentCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ComponentCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeviceCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == DeviceCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == NodeCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == NodeCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ClassCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ClassCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == CollaborationCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InterfaceEditPartCN.VISUAL_ID) {
+ if (visualID == InterfaceEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == PrimitiveTypeEditPartCN.VISUAL_ID) {
+ if (visualID == PrimitiveTypeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == EnumerationEditPartCN.VISUAL_ID) {
+ if (visualID == EnumerationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DataTypeEditPartCN.VISUAL_ID) {
+ if (visualID == DataTypeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ActorEditPartCN.VISUAL_ID) {
+ if (visualID == ActorEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeploymentSpecificationEditPartCN.VISUAL_ID) {
+ if (visualID == DeploymentSpecificationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ArtifactEditPartCN.VISUAL_ID) {
+ if (visualID == ArtifactEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InformationItemEditPartCN.VISUAL_ID) {
+ if (visualID == InformationItemEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == SignalEditPartCN.VISUAL_ID) {
+ if (visualID == SignalEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == UseCaseEditPartCN.VISUAL_ID) {
+ if (visualID == UseCaseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedComments().iterator(); it.hasNext();) {
- Comment childElement = (Comment)it.next();
+ for (Iterator<?> it = modelElement.getOwnedComments()
+ .iterator(); it.hasNext();) {
+ Comment childElement = (Comment) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CommentEditPartCN.VISUAL_ID) {
+ if (visualID == CommentEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedRules().iterator(); it.hasNext();) {
- Constraint childElement = (Constraint)it.next();
+ for (Iterator<?> it = modelElement.getOwnedRules()
+ .iterator(); it.hasNext();) {
+ Constraint childElement = (Constraint) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == DurationConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == DurationConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == TimeConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == TimeConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == ConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -4327,151 +4484,156 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getExecutionEnvironmentInternalstructure_7071SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
+ if (false == view.eContainer() instanceof View) {
return Collections.emptyList();
}
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
+ View containerView = (View) view.eContainer();
+ if (!containerView.isSetElement()) {
return Collections.emptyList();
}
- ExecutionEnvironment modelElement = (ExecutionEnvironment)containerView.getElement();
+ ExecutionEnvironment modelElement = (ExecutionEnvironment) containerView.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PropertyPartEditPartCN.VISUAL_ID) {
+ if (visualID == PropertyPartEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getCollaborationUses().iterator(); it.hasNext();) {
- CollaborationUse childElement = (CollaborationUse)it.next();
+ for (Iterator<?> it = modelElement.getCollaborationUses()
+ .iterator(); it.hasNext();) {
+ CollaborationUse childElement = (CollaborationUse) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CollaborationUseEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationUseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getNestedClassifiers().iterator(); it.hasNext();) {
- Classifier childElement = (Classifier)it.next();
+ for (Iterator<?> it = modelElement.getNestedClassifiers()
+ .iterator(); it.hasNext();) {
+ Classifier childElement = (Classifier) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ActivityCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ActivityCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ProtocolStateMachineCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ProtocolStateMachineCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == StateMachineCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == StateMachineCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == FunctionBehaviorCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == FunctionBehaviorCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == OpaqueBehaviorCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == OpaqueBehaviorCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ComponentCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ComponentCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeviceCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == DeviceCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == NodeCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == NodeCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ClassCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ClassCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == CollaborationCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InterfaceEditPartCN.VISUAL_ID) {
+ if (visualID == InterfaceEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == PrimitiveTypeEditPartCN.VISUAL_ID) {
+ if (visualID == PrimitiveTypeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == EnumerationEditPartCN.VISUAL_ID) {
+ if (visualID == EnumerationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DataTypeEditPartCN.VISUAL_ID) {
+ if (visualID == DataTypeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ActorEditPartCN.VISUAL_ID) {
+ if (visualID == ActorEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeploymentSpecificationEditPartCN.VISUAL_ID) {
+ if (visualID == DeploymentSpecificationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ArtifactEditPartCN.VISUAL_ID) {
+ if (visualID == ArtifactEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InformationItemEditPartCN.VISUAL_ID) {
+ if (visualID == InformationItemEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == SignalEditPartCN.VISUAL_ID) {
+ if (visualID == SignalEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == UseCaseEditPartCN.VISUAL_ID) {
+ if (visualID == UseCaseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedComments().iterator(); it.hasNext();) {
- Comment childElement = (Comment)it.next();
+ for (Iterator<?> it = modelElement.getOwnedComments()
+ .iterator(); it.hasNext();) {
+ Comment childElement = (Comment) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CommentEditPartCN.VISUAL_ID) {
+ if (visualID == CommentEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedRules().iterator(); it.hasNext();) {
- Constraint childElement = (Constraint)it.next();
+ for (Iterator<?> it = modelElement.getOwnedRules()
+ .iterator(); it.hasNext();) {
+ Constraint childElement = (Constraint) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == DurationConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == DurationConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == TimeConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == TimeConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == ConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -4483,151 +4645,156 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getNodeInternalstructure_7072SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
+ if (false == view.eContainer() instanceof View) {
return Collections.emptyList();
}
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
+ View containerView = (View) view.eContainer();
+ if (!containerView.isSetElement()) {
return Collections.emptyList();
}
- Node modelElement = (Node)containerView.getElement();
+ Node modelElement = (Node) containerView.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PropertyPartEditPartCN.VISUAL_ID) {
+ if (visualID == PropertyPartEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getCollaborationUses().iterator(); it.hasNext();) {
- CollaborationUse childElement = (CollaborationUse)it.next();
+ for (Iterator<?> it = modelElement.getCollaborationUses()
+ .iterator(); it.hasNext();) {
+ CollaborationUse childElement = (CollaborationUse) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CollaborationUseEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationUseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getNestedClassifiers().iterator(); it.hasNext();) {
- Classifier childElement = (Classifier)it.next();
+ for (Iterator<?> it = modelElement.getNestedClassifiers()
+ .iterator(); it.hasNext();) {
+ Classifier childElement = (Classifier) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ActivityCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ActivityCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ProtocolStateMachineCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ProtocolStateMachineCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == StateMachineCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == StateMachineCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == FunctionBehaviorCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == FunctionBehaviorCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == OpaqueBehaviorCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == OpaqueBehaviorCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ComponentCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ComponentCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeviceCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == DeviceCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == NodeCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == NodeCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ClassCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ClassCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == CollaborationCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InterfaceEditPartCN.VISUAL_ID) {
+ if (visualID == InterfaceEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == PrimitiveTypeEditPartCN.VISUAL_ID) {
+ if (visualID == PrimitiveTypeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == EnumerationEditPartCN.VISUAL_ID) {
+ if (visualID == EnumerationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DataTypeEditPartCN.VISUAL_ID) {
+ if (visualID == DataTypeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ActorEditPartCN.VISUAL_ID) {
+ if (visualID == ActorEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeploymentSpecificationEditPartCN.VISUAL_ID) {
+ if (visualID == DeploymentSpecificationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ArtifactEditPartCN.VISUAL_ID) {
+ if (visualID == ArtifactEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InformationItemEditPartCN.VISUAL_ID) {
+ if (visualID == InformationItemEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == SignalEditPartCN.VISUAL_ID) {
+ if (visualID == SignalEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == UseCaseEditPartCN.VISUAL_ID) {
+ if (visualID == UseCaseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedComments().iterator(); it.hasNext();) {
- Comment childElement = (Comment)it.next();
+ for (Iterator<?> it = modelElement.getOwnedComments()
+ .iterator(); it.hasNext();) {
+ Comment childElement = (Comment) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CommentEditPartCN.VISUAL_ID) {
+ if (visualID == CommentEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedRules().iterator(); it.hasNext();) {
- Constraint childElement = (Constraint)it.next();
+ for (Iterator<?> it = modelElement.getOwnedRules()
+ .iterator(); it.hasNext();) {
+ Constraint childElement = (Constraint) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == DurationConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == DurationConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == TimeConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == TimeConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == ConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -4639,151 +4806,156 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getClassInternalstructure_7073SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
+ if (false == view.eContainer() instanceof View) {
return Collections.emptyList();
}
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
+ View containerView = (View) view.eContainer();
+ if (!containerView.isSetElement()) {
return Collections.emptyList();
}
- Class modelElement = (Class)containerView.getElement();
+ Class modelElement = (Class) containerView.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PropertyPartEditPartCN.VISUAL_ID) {
+ if (visualID == PropertyPartEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getCollaborationUses().iterator(); it.hasNext();) {
- CollaborationUse childElement = (CollaborationUse)it.next();
+ for (Iterator<?> it = modelElement.getCollaborationUses()
+ .iterator(); it.hasNext();) {
+ CollaborationUse childElement = (CollaborationUse) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CollaborationUseEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationUseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getNestedClassifiers().iterator(); it.hasNext();) {
- Classifier childElement = (Classifier)it.next();
+ for (Iterator<?> it = modelElement.getNestedClassifiers()
+ .iterator(); it.hasNext();) {
+ Classifier childElement = (Classifier) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ActivityCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ActivityCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ProtocolStateMachineCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ProtocolStateMachineCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == StateMachineCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == StateMachineCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == FunctionBehaviorCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == FunctionBehaviorCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == OpaqueBehaviorCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == OpaqueBehaviorCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ComponentCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ComponentCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeviceCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == DeviceCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == NodeCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == NodeCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ClassCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == ClassCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == CollaborationCompositeEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationCompositeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InterfaceEditPartCN.VISUAL_ID) {
+ if (visualID == InterfaceEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == PrimitiveTypeEditPartCN.VISUAL_ID) {
+ if (visualID == PrimitiveTypeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == EnumerationEditPartCN.VISUAL_ID) {
+ if (visualID == EnumerationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DataTypeEditPartCN.VISUAL_ID) {
+ if (visualID == DataTypeEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ActorEditPartCN.VISUAL_ID) {
+ if (visualID == ActorEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DeploymentSpecificationEditPartCN.VISUAL_ID) {
+ if (visualID == DeploymentSpecificationEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ArtifactEditPartCN.VISUAL_ID) {
+ if (visualID == ArtifactEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InformationItemEditPartCN.VISUAL_ID) {
+ if (visualID == InformationItemEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == SignalEditPartCN.VISUAL_ID) {
+ if (visualID == SignalEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == UseCaseEditPartCN.VISUAL_ID) {
+ if (visualID == UseCaseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedComments().iterator(); it.hasNext();) {
- Comment childElement = (Comment)it.next();
+ for (Iterator<?> it = modelElement.getOwnedComments()
+ .iterator(); it.hasNext();) {
+ Comment childElement = (Comment) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CommentEditPartCN.VISUAL_ID) {
+ if (visualID == CommentEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedRules().iterator(); it.hasNext();) {
- Constraint childElement = (Constraint)it.next();
+ for (Iterator<?> it = modelElement.getOwnedRules()
+ .iterator(); it.hasNext();) {
+ Constraint childElement = (Constraint) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == ConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == ConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == DurationConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == DurationConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == TimeConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == TimeConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -4795,67 +4967,72 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLNodeDescriptor> getCollaborationInternalstructure_7075SemanticChildren(View view) {
- if(false == view.eContainer() instanceof View) {
+ if (false == view.eContainer() instanceof View) {
return Collections.emptyList();
}
- View containerView = (View)view.eContainer();
- if(!containerView.isSetElement()) {
+ View containerView = (View) view.eContainer();
+ if (!containerView.isSetElement()) {
return Collections.emptyList();
}
- Collaboration modelElement = (Collaboration)containerView.getElement();
+ Collaboration modelElement = (Collaboration) containerView.getElement();
LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for(Iterator<?> it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property)it.next();
+ for (Iterator<?> it = modelElement.getOwnedAttributes()
+ .iterator(); it.hasNext();) {
+ Property childElement = (Property) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == PropertyPartEditPartCN.VISUAL_ID) {
+ if (visualID == PropertyPartEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getCollaborationUses().iterator(); it.hasNext();) {
- CollaborationUse childElement = (CollaborationUse)it.next();
+ for (Iterator<?> it = modelElement.getCollaborationUses()
+ .iterator(); it.hasNext();) {
+ CollaborationUse childElement = (CollaborationUse) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CollaborationUseEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationUseEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedComments().iterator(); it.hasNext();) {
- Comment childElement = (Comment)it.next();
+ for (Iterator<?> it = modelElement.getOwnedComments()
+ .iterator(); it.hasNext();) {
+ Comment childElement = (Comment) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CommentEditPartCN.VISUAL_ID) {
+ if (visualID == CommentEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getRoles().iterator(); it.hasNext();) {
- ConnectableElement childElement = (ConnectableElement)it.next();
+ for (Iterator<?> it = modelElement.getRoles()
+ .iterator(); it.hasNext();) {
+ ConnectableElement childElement = (ConnectableElement) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == CollaborationRoleEditPartCN.VISUAL_ID) {
+ if (visualID == CollaborationRoleEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
}
- for(Iterator<?> it = modelElement.getOwnedRules().iterator(); it.hasNext();) {
- Constraint childElement = (Constraint)it.next();
+ for (Iterator<?> it = modelElement.getOwnedRules()
+ .iterator(); it.hasNext();) {
+ Constraint childElement = (Constraint) it.next();
int visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == DurationConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == DurationConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == TimeConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == TimeConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == IntervalConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == InteractionConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
- if(visualID == ConstraintEditPartCN.VISUAL_ID) {
+ if (visualID == ConstraintEditPartCN.VISUAL_ID) {
result.add(new UMLNodeDescriptor(childElement, visualID));
continue;
}
@@ -4875,7 +5052,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getContainedLinks(View view) {
- switch(UMLVisualIDRegistry.getVisualID(view)) {
+ switch (UMLVisualIDRegistry.getVisualID(view)) {
case CompositeStructureDiagramEditPart.VISUAL_ID:
return getPackage_1000ContainedLinks(view);
case ActivityCompositeEditPart.VISUAL_ID:
@@ -5082,7 +5259,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getIncomingLinks(View view) {
- switch(UMLVisualIDRegistry.getVisualID(view)) {
+ switch (UMLVisualIDRegistry.getVisualID(view)) {
case ActivityCompositeEditPart.VISUAL_ID:
return getActivity_2060IncomingLinks(view);
case InteractionCompositeEditPart.VISUAL_ID:
@@ -5287,7 +5464,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getOutgoingLinks(View view) {
- switch(UMLVisualIDRegistry.getVisualID(view)) {
+ switch (UMLVisualIDRegistry.getVisualID(view)) {
case ActivityCompositeEditPart.VISUAL_ID:
return getActivity_2060OutgoingLinks(view);
case InteractionCompositeEditPart.VISUAL_ID:
@@ -5492,7 +5669,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getPackage_1000ContainedLinks(View view) {
- Package modelElement = (Package)view.getElement();
+ Package modelElement = (Package) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getContainedTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -5512,7 +5689,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getActivity_2060ContainedLinks(View view) {
- Activity modelElement = (Activity)view.getElement();
+ Activity modelElement = (Activity) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Connector_4013(modelElement));
result.addAll(getContainedTypeModelFacetLinks_Generalization_4015(modelElement));
@@ -5523,7 +5700,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getInteraction_2061ContainedLinks(View view) {
- Interaction modelElement = (Interaction)view.getElement();
+ Interaction modelElement = (Interaction) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Connector_4013(modelElement));
result.addAll(getContainedTypeModelFacetLinks_Generalization_4015(modelElement));
@@ -5534,7 +5711,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getProtocolStateMachine_2062ContainedLinks(View view) {
- ProtocolStateMachine modelElement = (ProtocolStateMachine)view.getElement();
+ ProtocolStateMachine modelElement = (ProtocolStateMachine) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Connector_4013(modelElement));
result.addAll(getContainedTypeModelFacetLinks_Generalization_4015(modelElement));
@@ -5545,7 +5722,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getStateMachine_2063ContainedLinks(View view) {
- StateMachine modelElement = (StateMachine)view.getElement();
+ StateMachine modelElement = (StateMachine) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Connector_4013(modelElement));
result.addAll(getContainedTypeModelFacetLinks_Generalization_4015(modelElement));
@@ -5556,7 +5733,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getFunctionBehavior_2064ContainedLinks(View view) {
- FunctionBehavior modelElement = (FunctionBehavior)view.getElement();
+ FunctionBehavior modelElement = (FunctionBehavior) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Connector_4013(modelElement));
result.addAll(getContainedTypeModelFacetLinks_Generalization_4015(modelElement));
@@ -5567,7 +5744,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getOpaqueBehavior_2065ContainedLinks(View view) {
- OpaqueBehavior modelElement = (OpaqueBehavior)view.getElement();
+ OpaqueBehavior modelElement = (OpaqueBehavior) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Connector_4013(modelElement));
result.addAll(getContainedTypeModelFacetLinks_Generalization_4015(modelElement));
@@ -5578,7 +5755,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getComponent_2069ContainedLinks(View view) {
- Component modelElement = (Component)view.getElement();
+ Component modelElement = (Component) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Connector_4013(modelElement));
result.addAll(getContainedTypeModelFacetLinks_Generalization_4015(modelElement));
@@ -5589,7 +5766,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getDevice_2070ContainedLinks(View view) {
- Device modelElement = (Device)view.getElement();
+ Device modelElement = (Device) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Connector_4013(modelElement));
result.addAll(getContainedTypeModelFacetLinks_Generalization_4015(modelElement));
@@ -5600,7 +5777,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getExecutionEnvironment_2071ContainedLinks(View view) {
- ExecutionEnvironment modelElement = (ExecutionEnvironment)view.getElement();
+ ExecutionEnvironment modelElement = (ExecutionEnvironment) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Connector_4013(modelElement));
result.addAll(getContainedTypeModelFacetLinks_Generalization_4015(modelElement));
@@ -5611,7 +5788,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getNode_2072ContainedLinks(View view) {
- Node modelElement = (Node)view.getElement();
+ Node modelElement = (Node) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Connector_4013(modelElement));
result.addAll(getContainedTypeModelFacetLinks_Generalization_4015(modelElement));
@@ -5622,7 +5799,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getClass_2073ContainedLinks(View view) {
- Class modelElement = (Class)view.getElement();
+ Class modelElement = (Class) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Connector_4013(modelElement));
result.addAll(getContainedTypeModelFacetLinks_Generalization_4015(modelElement));
@@ -5633,7 +5810,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getCollaboration_2075ContainedLinks(View view) {
- Collaboration modelElement = (Collaboration)view.getElement();
+ Collaboration modelElement = (Collaboration) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Connector_4013(modelElement));
result.addAll(getContainedTypeModelFacetLinks_Generalization_4015(modelElement));
@@ -5644,7 +5821,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getInterface_2076ContainedLinks(View view) {
- Interface modelElement = (Interface)view.getElement();
+ Interface modelElement = (Interface) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Generalization_4015(modelElement));
return result;
@@ -5654,7 +5831,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getPrimitiveType_2066ContainedLinks(View view) {
- PrimitiveType modelElement = (PrimitiveType)view.getElement();
+ PrimitiveType modelElement = (PrimitiveType) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Generalization_4015(modelElement));
return result;
@@ -5664,7 +5841,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getEnumeration_2067ContainedLinks(View view) {
- Enumeration modelElement = (Enumeration)view.getElement();
+ Enumeration modelElement = (Enumeration) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Generalization_4015(modelElement));
return result;
@@ -5674,7 +5851,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getDataType_2068ContainedLinks(View view) {
- DataType modelElement = (DataType)view.getElement();
+ DataType modelElement = (DataType) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Generalization_4015(modelElement));
return result;
@@ -5684,7 +5861,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getActor_2077ContainedLinks(View view) {
- Actor modelElement = (Actor)view.getElement();
+ Actor modelElement = (Actor) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Generalization_4015(modelElement));
return result;
@@ -5694,7 +5871,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getDeploymentSpecification_2078ContainedLinks(View view) {
- DeploymentSpecification modelElement = (DeploymentSpecification)view.getElement();
+ DeploymentSpecification modelElement = (DeploymentSpecification) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Generalization_4015(modelElement));
return result;
@@ -5704,7 +5881,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getArtifact_2079ContainedLinks(View view) {
- Artifact modelElement = (Artifact)view.getElement();
+ Artifact modelElement = (Artifact) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Generalization_4015(modelElement));
return result;
@@ -5714,7 +5891,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getInformationItem_2080ContainedLinks(View view) {
- InformationItem modelElement = (InformationItem)view.getElement();
+ InformationItem modelElement = (InformationItem) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Generalization_4015(modelElement));
result.addAll(getOutgoingFeatureModelFacetLinks_InformationItem_Represented_4020(modelElement));
@@ -5725,7 +5902,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getSignal_2081ContainedLinks(View view) {
- Signal modelElement = (Signal)view.getElement();
+ Signal modelElement = (Signal) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Generalization_4015(modelElement));
return result;
@@ -5735,7 +5912,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getUseCase_2082ContainedLinks(View view) {
- UseCase modelElement = (UseCase)view.getElement();
+ UseCase modelElement = (UseCase) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Generalization_4015(modelElement));
return result;
@@ -5780,7 +5957,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getDurationObservation_2093ContainedLinks(View view) {
- DurationObservation modelElement = (DurationObservation)view.getElement();
+ DurationObservation modelElement = (DurationObservation) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingFeatureModelFacetLinks_DurationObservation_Event_4019(modelElement));
return result;
@@ -5790,7 +5967,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getTimeObservation_2094ContainedLinks(View view) {
- TimeObservation modelElement = (TimeObservation)view.getElement();
+ TimeObservation modelElement = (TimeObservation) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingFeatureModelFacetLinks_TimeObservation_Event_4018(modelElement));
return result;
@@ -5898,7 +6075,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getComment_2109ContainedLinks(View view) {
- Comment modelElement = (Comment)view.getElement();
+ Comment modelElement = (Comment) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement));
return result;
@@ -5908,7 +6085,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getDurationConstraint_2110ContainedLinks(View view) {
- DurationConstraint modelElement = (DurationConstraint)view.getElement();
+ DurationConstraint modelElement = (DurationConstraint) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElement_4003(modelElement));
return result;
@@ -5918,7 +6095,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getTimeConstraint_2111ContainedLinks(View view) {
- TimeConstraint modelElement = (TimeConstraint)view.getElement();
+ TimeConstraint modelElement = (TimeConstraint) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElement_4003(modelElement));
return result;
@@ -5928,7 +6105,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getIntervalConstraint_2112ContainedLinks(View view) {
- IntervalConstraint modelElement = (IntervalConstraint)view.getElement();
+ IntervalConstraint modelElement = (IntervalConstraint) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElement_4003(modelElement));
return result;
@@ -5938,7 +6115,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getInteractionConstraint_2113ContainedLinks(View view) {
- InteractionConstraint modelElement = (InteractionConstraint)view.getElement();
+ InteractionConstraint modelElement = (InteractionConstraint) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElement_4003(modelElement));
return result;
@@ -5948,7 +6125,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getConstraint_2114ContainedLinks(View view) {
- Constraint modelElement = (Constraint)view.getElement();
+ Constraint modelElement = (Constraint) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElement_4003(modelElement));
return result;
@@ -5993,7 +6170,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getActivity_3072ContainedLinks(View view) {
- Activity modelElement = (Activity)view.getElement();
+ Activity modelElement = (Activity) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Connector_4013(modelElement));
result.addAll(getContainedTypeModelFacetLinks_Generalization_4015(modelElement));
@@ -6004,7 +6181,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getInteraction_3073ContainedLinks(View view) {
- Interaction modelElement = (Interaction)view.getElement();
+ Interaction modelElement = (Interaction) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Connector_4013(modelElement));
result.addAll(getContainedTypeModelFacetLinks_Generalization_4015(modelElement));
@@ -6015,7 +6192,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getProtocolStateMachine_3074ContainedLinks(View view) {
- ProtocolStateMachine modelElement = (ProtocolStateMachine)view.getElement();
+ ProtocolStateMachine modelElement = (ProtocolStateMachine) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Connector_4013(modelElement));
result.addAll(getContainedTypeModelFacetLinks_Generalization_4015(modelElement));
@@ -6026,7 +6203,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getStateMachine_3075ContainedLinks(View view) {
- StateMachine modelElement = (StateMachine)view.getElement();
+ StateMachine modelElement = (StateMachine) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Connector_4013(modelElement));
result.addAll(getContainedTypeModelFacetLinks_Generalization_4015(modelElement));
@@ -6037,7 +6214,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getFunctionBehavior_3076ContainedLinks(View view) {
- FunctionBehavior modelElement = (FunctionBehavior)view.getElement();
+ FunctionBehavior modelElement = (FunctionBehavior) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Connector_4013(modelElement));
result.addAll(getContainedTypeModelFacetLinks_Generalization_4015(modelElement));
@@ -6048,7 +6225,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getOpaqueBehavior_3077ContainedLinks(View view) {
- OpaqueBehavior modelElement = (OpaqueBehavior)view.getElement();
+ OpaqueBehavior modelElement = (OpaqueBehavior) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Connector_4013(modelElement));
result.addAll(getContainedTypeModelFacetLinks_Generalization_4015(modelElement));
@@ -6059,7 +6236,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getComponent_3081ContainedLinks(View view) {
- Component modelElement = (Component)view.getElement();
+ Component modelElement = (Component) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Connector_4013(modelElement));
result.addAll(getContainedTypeModelFacetLinks_Generalization_4015(modelElement));
@@ -6070,7 +6247,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getDevice_3082ContainedLinks(View view) {
- Device modelElement = (Device)view.getElement();
+ Device modelElement = (Device) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Connector_4013(modelElement));
result.addAll(getContainedTypeModelFacetLinks_Generalization_4015(modelElement));
@@ -6081,7 +6258,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getExecutionEnvironment_3083ContainedLinks(View view) {
- ExecutionEnvironment modelElement = (ExecutionEnvironment)view.getElement();
+ ExecutionEnvironment modelElement = (ExecutionEnvironment) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Connector_4013(modelElement));
result.addAll(getContainedTypeModelFacetLinks_Generalization_4015(modelElement));
@@ -6092,7 +6269,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getNode_3084ContainedLinks(View view) {
- Node modelElement = (Node)view.getElement();
+ Node modelElement = (Node) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Connector_4013(modelElement));
result.addAll(getContainedTypeModelFacetLinks_Generalization_4015(modelElement));
@@ -6103,7 +6280,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getClass_3085ContainedLinks(View view) {
- Class modelElement = (Class)view.getElement();
+ Class modelElement = (Class) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Connector_4013(modelElement));
result.addAll(getContainedTypeModelFacetLinks_Generalization_4015(modelElement));
@@ -6114,7 +6291,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getCollaboration_3086ContainedLinks(View view) {
- Collaboration modelElement = (Collaboration)view.getElement();
+ Collaboration modelElement = (Collaboration) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Connector_4013(modelElement));
result.addAll(getContainedTypeModelFacetLinks_Generalization_4015(modelElement));
@@ -6125,7 +6302,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getInterface_3087ContainedLinks(View view) {
- Interface modelElement = (Interface)view.getElement();
+ Interface modelElement = (Interface) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Generalization_4015(modelElement));
return result;
@@ -6135,7 +6312,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getPrimitiveType_3078ContainedLinks(View view) {
- PrimitiveType modelElement = (PrimitiveType)view.getElement();
+ PrimitiveType modelElement = (PrimitiveType) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Generalization_4015(modelElement));
return result;
@@ -6145,7 +6322,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getEnumeration_3079ContainedLinks(View view) {
- Enumeration modelElement = (Enumeration)view.getElement();
+ Enumeration modelElement = (Enumeration) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Generalization_4015(modelElement));
return result;
@@ -6155,7 +6332,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getDataType_3080ContainedLinks(View view) {
- DataType modelElement = (DataType)view.getElement();
+ DataType modelElement = (DataType) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Generalization_4015(modelElement));
return result;
@@ -6165,7 +6342,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getActor_3091ContainedLinks(View view) {
- Actor modelElement = (Actor)view.getElement();
+ Actor modelElement = (Actor) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Generalization_4015(modelElement));
return result;
@@ -6175,7 +6352,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getDeploymentSpecification_3092ContainedLinks(View view) {
- DeploymentSpecification modelElement = (DeploymentSpecification)view.getElement();
+ DeploymentSpecification modelElement = (DeploymentSpecification) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Generalization_4015(modelElement));
return result;
@@ -6185,7 +6362,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getArtifact_3093ContainedLinks(View view) {
- Artifact modelElement = (Artifact)view.getElement();
+ Artifact modelElement = (Artifact) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Generalization_4015(modelElement));
return result;
@@ -6195,7 +6372,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getInformationItem_3094ContainedLinks(View view) {
- InformationItem modelElement = (InformationItem)view.getElement();
+ InformationItem modelElement = (InformationItem) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Generalization_4015(modelElement));
result.addAll(getOutgoingFeatureModelFacetLinks_InformationItem_Represented_4020(modelElement));
@@ -6206,7 +6383,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getSignal_3095ContainedLinks(View view) {
- Signal modelElement = (Signal)view.getElement();
+ Signal modelElement = (Signal) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Generalization_4015(modelElement));
return result;
@@ -6216,7 +6393,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getUseCase_3096ContainedLinks(View view) {
- UseCase modelElement = (UseCase)view.getElement();
+ UseCase modelElement = (UseCase) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getContainedTypeModelFacetLinks_Generalization_4015(modelElement));
return result;
@@ -6226,7 +6403,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getComment_3097ContainedLinks(View view) {
- Comment modelElement = (Comment)view.getElement();
+ Comment modelElement = (Comment) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement));
return result;
@@ -6236,7 +6413,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getDurationConstraint_3116ContainedLinks(View view) {
- DurationConstraint modelElement = (DurationConstraint)view.getElement();
+ DurationConstraint modelElement = (DurationConstraint) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElement_4003(modelElement));
return result;
@@ -6246,7 +6423,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getTimeConstraint_3117ContainedLinks(View view) {
- TimeConstraint modelElement = (TimeConstraint)view.getElement();
+ TimeConstraint modelElement = (TimeConstraint) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElement_4003(modelElement));
return result;
@@ -6256,7 +6433,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getIntervalConstraint_3118ContainedLinks(View view) {
- IntervalConstraint modelElement = (IntervalConstraint)view.getElement();
+ IntervalConstraint modelElement = (IntervalConstraint) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElement_4003(modelElement));
return result;
@@ -6266,7 +6443,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getInteractionConstraint_3119ContainedLinks(View view) {
- InteractionConstraint modelElement = (InteractionConstraint)view.getElement();
+ InteractionConstraint modelElement = (InteractionConstraint) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElement_4003(modelElement));
return result;
@@ -6276,7 +6453,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getConstraint_3120ContainedLinks(View view) {
- Constraint modelElement = (Constraint)view.getElement();
+ Constraint modelElement = (Constraint) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElement_4003(modelElement));
return result;
@@ -6398,7 +6575,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getActivity_2060IncomingLinks(View view) {
- Activity modelElement = (Activity)view.getElement();
+ Activity modelElement = (Activity) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -6425,7 +6602,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getInteraction_2061IncomingLinks(View view) {
- Interaction modelElement = (Interaction)view.getElement();
+ Interaction modelElement = (Interaction) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -6452,7 +6629,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getProtocolStateMachine_2062IncomingLinks(View view) {
- ProtocolStateMachine modelElement = (ProtocolStateMachine)view.getElement();
+ ProtocolStateMachine modelElement = (ProtocolStateMachine) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -6479,7 +6656,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getStateMachine_2063IncomingLinks(View view) {
- StateMachine modelElement = (StateMachine)view.getElement();
+ StateMachine modelElement = (StateMachine) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -6506,7 +6683,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getFunctionBehavior_2064IncomingLinks(View view) {
- FunctionBehavior modelElement = (FunctionBehavior)view.getElement();
+ FunctionBehavior modelElement = (FunctionBehavior) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -6533,7 +6710,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getOpaqueBehavior_2065IncomingLinks(View view) {
- OpaqueBehavior modelElement = (OpaqueBehavior)view.getElement();
+ OpaqueBehavior modelElement = (OpaqueBehavior) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -6560,7 +6737,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getComponent_2069IncomingLinks(View view) {
- Component modelElement = (Component)view.getElement();
+ Component modelElement = (Component) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -6587,7 +6764,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getDevice_2070IncomingLinks(View view) {
- Device modelElement = (Device)view.getElement();
+ Device modelElement = (Device) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -6614,7 +6791,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getExecutionEnvironment_2071IncomingLinks(View view) {
- ExecutionEnvironment modelElement = (ExecutionEnvironment)view.getElement();
+ ExecutionEnvironment modelElement = (ExecutionEnvironment) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -6641,7 +6818,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getNode_2072IncomingLinks(View view) {
- Node modelElement = (Node)view.getElement();
+ Node modelElement = (Node) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -6668,7 +6845,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getClass_2073IncomingLinks(View view) {
- Class modelElement = (Class)view.getElement();
+ Class modelElement = (Class) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -6695,7 +6872,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getCollaboration_2075IncomingLinks(View view) {
- Collaboration modelElement = (Collaboration)view.getElement();
+ Collaboration modelElement = (Collaboration) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -6722,7 +6899,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getInterface_2076IncomingLinks(View view) {
- Interface modelElement = (Interface)view.getElement();
+ Interface modelElement = (Interface) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -6749,7 +6926,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getPrimitiveType_2066IncomingLinks(View view) {
- PrimitiveType modelElement = (PrimitiveType)view.getElement();
+ PrimitiveType modelElement = (PrimitiveType) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -6776,7 +6953,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getEnumeration_2067IncomingLinks(View view) {
- Enumeration modelElement = (Enumeration)view.getElement();
+ Enumeration modelElement = (Enumeration) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -6803,7 +6980,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getDataType_2068IncomingLinks(View view) {
- DataType modelElement = (DataType)view.getElement();
+ DataType modelElement = (DataType) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -6830,7 +7007,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getActor_2077IncomingLinks(View view) {
- Actor modelElement = (Actor)view.getElement();
+ Actor modelElement = (Actor) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -6857,7 +7034,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getDeploymentSpecification_2078IncomingLinks(View view) {
- DeploymentSpecification modelElement = (DeploymentSpecification)view.getElement();
+ DeploymentSpecification modelElement = (DeploymentSpecification) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -6884,7 +7061,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getArtifact_2079IncomingLinks(View view) {
- Artifact modelElement = (Artifact)view.getElement();
+ Artifact modelElement = (Artifact) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -6911,7 +7088,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getInformationItem_2080IncomingLinks(View view) {
- InformationItem modelElement = (InformationItem)view.getElement();
+ InformationItem modelElement = (InformationItem) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -6938,7 +7115,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getSignal_2081IncomingLinks(View view) {
- Signal modelElement = (Signal)view.getElement();
+ Signal modelElement = (Signal) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -6965,7 +7142,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getUseCase_2082IncomingLinks(View view) {
- UseCase modelElement = (UseCase)view.getElement();
+ UseCase modelElement = (UseCase) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -6992,7 +7169,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getSignalEvent_2083IncomingLinks(View view) {
- SignalEvent modelElement = (SignalEvent)view.getElement();
+ SignalEvent modelElement = (SignalEvent) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -7017,7 +7194,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getCallEvent_2084IncomingLinks(View view) {
- CallEvent modelElement = (CallEvent)view.getElement();
+ CallEvent modelElement = (CallEvent) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -7042,7 +7219,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getAnyReceiveEvent_2085IncomingLinks(View view) {
- AnyReceiveEvent modelElement = (AnyReceiveEvent)view.getElement();
+ AnyReceiveEvent modelElement = (AnyReceiveEvent) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -7067,7 +7244,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getChangeEvent_2088IncomingLinks(View view) {
- ChangeEvent modelElement = (ChangeEvent)view.getElement();
+ ChangeEvent modelElement = (ChangeEvent) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -7092,7 +7269,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getTimeEvent_2089IncomingLinks(View view) {
- TimeEvent modelElement = (TimeEvent)view.getElement();
+ TimeEvent modelElement = (TimeEvent) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -7117,7 +7294,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getDurationObservation_2093IncomingLinks(View view) {
- DurationObservation modelElement = (DurationObservation)view.getElement();
+ DurationObservation modelElement = (DurationObservation) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -7142,7 +7319,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getTimeObservation_2094IncomingLinks(View view) {
- TimeObservation modelElement = (TimeObservation)view.getElement();
+ TimeObservation modelElement = (TimeObservation) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -7167,7 +7344,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getLiteralBoolean_2095IncomingLinks(View view) {
- LiteralBoolean modelElement = (LiteralBoolean)view.getElement();
+ LiteralBoolean modelElement = (LiteralBoolean) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -7192,7 +7369,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getLiteralInteger_2096IncomingLinks(View view) {
- LiteralInteger modelElement = (LiteralInteger)view.getElement();
+ LiteralInteger modelElement = (LiteralInteger) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -7217,7 +7394,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getLiteralNull_2097IncomingLinks(View view) {
- LiteralNull modelElement = (LiteralNull)view.getElement();
+ LiteralNull modelElement = (LiteralNull) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -7242,7 +7419,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getLiteralString_2098IncomingLinks(View view) {
- LiteralString modelElement = (LiteralString)view.getElement();
+ LiteralString modelElement = (LiteralString) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -7267,7 +7444,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getLiteralUnlimitedNatural_2099IncomingLinks(View view) {
- LiteralUnlimitedNatural modelElement = (LiteralUnlimitedNatural)view.getElement();
+ LiteralUnlimitedNatural modelElement = (LiteralUnlimitedNatural) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -7292,7 +7469,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getStringExpression_2100IncomingLinks(View view) {
- StringExpression modelElement = (StringExpression)view.getElement();
+ StringExpression modelElement = (StringExpression) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -7317,7 +7494,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getOpaqueExpression_2101IncomingLinks(View view) {
- OpaqueExpression modelElement = (OpaqueExpression)view.getElement();
+ OpaqueExpression modelElement = (OpaqueExpression) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -7342,7 +7519,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getTimeExpression_2102IncomingLinks(View view) {
- TimeExpression modelElement = (TimeExpression)view.getElement();
+ TimeExpression modelElement = (TimeExpression) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -7367,7 +7544,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getExpression_2103IncomingLinks(View view) {
- Expression modelElement = (Expression)view.getElement();
+ Expression modelElement = (Expression) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -7392,7 +7569,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getDuration_2104IncomingLinks(View view) {
- Duration modelElement = (Duration)view.getElement();
+ Duration modelElement = (Duration) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -7417,7 +7594,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getTimeInterval_2105IncomingLinks(View view) {
- TimeInterval modelElement = (TimeInterval)view.getElement();
+ TimeInterval modelElement = (TimeInterval) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -7442,7 +7619,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getDurationInterval_2106IncomingLinks(View view) {
- DurationInterval modelElement = (DurationInterval)view.getElement();
+ DurationInterval modelElement = (DurationInterval) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -7467,7 +7644,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getInterval_2107IncomingLinks(View view) {
- Interval modelElement = (Interval)view.getElement();
+ Interval modelElement = (Interval) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -7492,7 +7669,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getInstanceValue_2108IncomingLinks(View view) {
- InstanceValue modelElement = (InstanceValue)view.getElement();
+ InstanceValue modelElement = (InstanceValue) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -7517,7 +7694,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getComment_2109IncomingLinks(View view) {
- Comment modelElement = (Comment)view.getElement();
+ Comment modelElement = (Comment) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -7529,7 +7706,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getDurationConstraint_2110IncomingLinks(View view) {
- DurationConstraint modelElement = (DurationConstraint)view.getElement();
+ DurationConstraint modelElement = (DurationConstraint) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -7554,7 +7731,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getTimeConstraint_2111IncomingLinks(View view) {
- TimeConstraint modelElement = (TimeConstraint)view.getElement();
+ TimeConstraint modelElement = (TimeConstraint) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -7579,7 +7756,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getIntervalConstraint_2112IncomingLinks(View view) {
- IntervalConstraint modelElement = (IntervalConstraint)view.getElement();
+ IntervalConstraint modelElement = (IntervalConstraint) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -7604,7 +7781,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getInteractionConstraint_2113IncomingLinks(View view) {
- InteractionConstraint modelElement = (InteractionConstraint)view.getElement();
+ InteractionConstraint modelElement = (InteractionConstraint) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -7629,7 +7806,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getConstraint_2114IncomingLinks(View view) {
- Constraint modelElement = (Constraint)view.getElement();
+ Constraint modelElement = (Constraint) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -7654,7 +7831,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getPort_3069IncomingLinks(View view) {
- Port modelElement = (Port)view.getElement();
+ Port modelElement = (Port) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -7679,7 +7856,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getParameter_3088IncomingLinks(View view) {
- Parameter modelElement = (Parameter)view.getElement();
+ Parameter modelElement = (Parameter) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -7704,7 +7881,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getProperty_3070IncomingLinks(View view) {
- Property modelElement = (Property)view.getElement();
+ Property modelElement = (Property) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -7729,7 +7906,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getConnectableElement_3115IncomingLinks(View view) {
- ConnectableElement modelElement = (ConnectableElement)view.getElement();
+ ConnectableElement modelElement = (ConnectableElement) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -7754,7 +7931,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getCollaborationUse_3071IncomingLinks(View view) {
- CollaborationUse modelElement = (CollaborationUse)view.getElement();
+ CollaborationUse modelElement = (CollaborationUse) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -7779,7 +7956,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getActivity_3072IncomingLinks(View view) {
- Activity modelElement = (Activity)view.getElement();
+ Activity modelElement = (Activity) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -7806,7 +7983,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getInteraction_3073IncomingLinks(View view) {
- Interaction modelElement = (Interaction)view.getElement();
+ Interaction modelElement = (Interaction) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -7833,7 +8010,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getProtocolStateMachine_3074IncomingLinks(View view) {
- ProtocolStateMachine modelElement = (ProtocolStateMachine)view.getElement();
+ ProtocolStateMachine modelElement = (ProtocolStateMachine) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -7860,7 +8037,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getStateMachine_3075IncomingLinks(View view) {
- StateMachine modelElement = (StateMachine)view.getElement();
+ StateMachine modelElement = (StateMachine) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -7887,7 +8064,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getFunctionBehavior_3076IncomingLinks(View view) {
- FunctionBehavior modelElement = (FunctionBehavior)view.getElement();
+ FunctionBehavior modelElement = (FunctionBehavior) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -7914,7 +8091,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getOpaqueBehavior_3077IncomingLinks(View view) {
- OpaqueBehavior modelElement = (OpaqueBehavior)view.getElement();
+ OpaqueBehavior modelElement = (OpaqueBehavior) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -7941,7 +8118,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getComponent_3081IncomingLinks(View view) {
- Component modelElement = (Component)view.getElement();
+ Component modelElement = (Component) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -7968,7 +8145,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getDevice_3082IncomingLinks(View view) {
- Device modelElement = (Device)view.getElement();
+ Device modelElement = (Device) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -7995,7 +8172,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getExecutionEnvironment_3083IncomingLinks(View view) {
- ExecutionEnvironment modelElement = (ExecutionEnvironment)view.getElement();
+ ExecutionEnvironment modelElement = (ExecutionEnvironment) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -8022,7 +8199,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getNode_3084IncomingLinks(View view) {
- Node modelElement = (Node)view.getElement();
+ Node modelElement = (Node) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -8049,7 +8226,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getClass_3085IncomingLinks(View view) {
- Class modelElement = (Class)view.getElement();
+ Class modelElement = (Class) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -8076,7 +8253,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getCollaboration_3086IncomingLinks(View view) {
- Collaboration modelElement = (Collaboration)view.getElement();
+ Collaboration modelElement = (Collaboration) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -8103,7 +8280,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getInterface_3087IncomingLinks(View view) {
- Interface modelElement = (Interface)view.getElement();
+ Interface modelElement = (Interface) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -8130,7 +8307,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getPrimitiveType_3078IncomingLinks(View view) {
- PrimitiveType modelElement = (PrimitiveType)view.getElement();
+ PrimitiveType modelElement = (PrimitiveType) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -8157,7 +8334,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getEnumeration_3079IncomingLinks(View view) {
- Enumeration modelElement = (Enumeration)view.getElement();
+ Enumeration modelElement = (Enumeration) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -8184,7 +8361,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getDataType_3080IncomingLinks(View view) {
- DataType modelElement = (DataType)view.getElement();
+ DataType modelElement = (DataType) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -8211,7 +8388,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getActor_3091IncomingLinks(View view) {
- Actor modelElement = (Actor)view.getElement();
+ Actor modelElement = (Actor) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -8238,7 +8415,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getDeploymentSpecification_3092IncomingLinks(View view) {
- DeploymentSpecification modelElement = (DeploymentSpecification)view.getElement();
+ DeploymentSpecification modelElement = (DeploymentSpecification) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -8265,7 +8442,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getArtifact_3093IncomingLinks(View view) {
- Artifact modelElement = (Artifact)view.getElement();
+ Artifact modelElement = (Artifact) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -8292,7 +8469,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getInformationItem_3094IncomingLinks(View view) {
- InformationItem modelElement = (InformationItem)view.getElement();
+ InformationItem modelElement = (InformationItem) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -8319,7 +8496,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getSignal_3095IncomingLinks(View view) {
- Signal modelElement = (Signal)view.getElement();
+ Signal modelElement = (Signal) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -8346,7 +8523,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getUseCase_3096IncomingLinks(View view) {
- UseCase modelElement = (UseCase)view.getElement();
+ UseCase modelElement = (UseCase) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -8373,7 +8550,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getComment_3097IncomingLinks(View view) {
- Comment modelElement = (Comment)view.getElement();
+ Comment modelElement = (Comment) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -8385,7 +8562,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getDurationConstraint_3116IncomingLinks(View view) {
- DurationConstraint modelElement = (DurationConstraint)view.getElement();
+ DurationConstraint modelElement = (DurationConstraint) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -8410,7 +8587,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getTimeConstraint_3117IncomingLinks(View view) {
- TimeConstraint modelElement = (TimeConstraint)view.getElement();
+ TimeConstraint modelElement = (TimeConstraint) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -8435,7 +8612,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getIntervalConstraint_3118IncomingLinks(View view) {
- IntervalConstraint modelElement = (IntervalConstraint)view.getElement();
+ IntervalConstraint modelElement = (IntervalConstraint) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -8460,7 +8637,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getInteractionConstraint_3119IncomingLinks(View view) {
- InteractionConstraint modelElement = (InteractionConstraint)view.getElement();
+ InteractionConstraint modelElement = (InteractionConstraint) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -8485,7 +8662,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getConstraint_3120IncomingLinks(View view) {
- Constraint modelElement = (Constraint)view.getElement();
+ Constraint modelElement = (Constraint) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -8531,7 +8708,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getComponentRealization_4004IncomingLinks(View view) {
- ComponentRealization modelElement = (ComponentRealization)view.getElement();
+ ComponentRealization modelElement = (ComponentRealization) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -8556,7 +8733,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getInterfaceRealization_4005IncomingLinks(View view) {
- InterfaceRealization modelElement = (InterfaceRealization)view.getElement();
+ InterfaceRealization modelElement = (InterfaceRealization) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -8581,7 +8758,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getSubstitution_4011IncomingLinks(View view) {
- Substitution modelElement = (Substitution)view.getElement();
+ Substitution modelElement = (Substitution) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -8606,7 +8783,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getRealization_4006IncomingLinks(View view) {
- Realization modelElement = (Realization)view.getElement();
+ Realization modelElement = (Realization) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -8631,7 +8808,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getManifestation_4012IncomingLinks(View view) {
- Manifestation modelElement = (Manifestation)view.getElement();
+ Manifestation modelElement = (Manifestation) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -8656,7 +8833,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getAbstraction_4007IncomingLinks(View view) {
- Abstraction modelElement = (Abstraction)view.getElement();
+ Abstraction modelElement = (Abstraction) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -8681,7 +8858,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getUsage_4008IncomingLinks(View view) {
- Usage modelElement = (Usage)view.getElement();
+ Usage modelElement = (Usage) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -8706,7 +8883,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getDeployment_4009IncomingLinks(View view) {
- Deployment modelElement = (Deployment)view.getElement();
+ Deployment modelElement = (Deployment) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -8731,7 +8908,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getDependency_4017IncomingLinks(View view) {
- Dependency modelElement = (Dependency)view.getElement();
+ Dependency modelElement = (Dependency) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -8756,7 +8933,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getDependency_4010IncomingLinks(View view) {
- Dependency modelElement = (Dependency)view.getElement();
+ Dependency modelElement = (Dependency) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -8781,7 +8958,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getConnector_4013IncomingLinks(View view) {
- Connector modelElement = (Connector)view.getElement();
+ Connector modelElement = (Connector) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -8806,7 +8983,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getGeneralization_4015IncomingLinks(View view) {
- Generalization modelElement = (Generalization)view.getElement();
+ Generalization modelElement = (Generalization) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -8818,7 +8995,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getInformationFlow_4021IncomingLinks(View view) {
- InformationFlow modelElement = (InformationFlow)view.getElement();
+ InformationFlow modelElement = (InformationFlow) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement, crossReferencer));
@@ -8843,7 +9020,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getActivity_2060OutgoingLinks(View view) {
- Activity modelElement = (Activity)view.getElement();
+ Activity modelElement = (Activity) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -8864,7 +9041,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getInteraction_2061OutgoingLinks(View view) {
- Interaction modelElement = (Interaction)view.getElement();
+ Interaction modelElement = (Interaction) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -8885,7 +9062,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getProtocolStateMachine_2062OutgoingLinks(View view) {
- ProtocolStateMachine modelElement = (ProtocolStateMachine)view.getElement();
+ ProtocolStateMachine modelElement = (ProtocolStateMachine) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -8906,7 +9083,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getStateMachine_2063OutgoingLinks(View view) {
- StateMachine modelElement = (StateMachine)view.getElement();
+ StateMachine modelElement = (StateMachine) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -8927,7 +9104,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getFunctionBehavior_2064OutgoingLinks(View view) {
- FunctionBehavior modelElement = (FunctionBehavior)view.getElement();
+ FunctionBehavior modelElement = (FunctionBehavior) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -8948,7 +9125,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getOpaqueBehavior_2065OutgoingLinks(View view) {
- OpaqueBehavior modelElement = (OpaqueBehavior)view.getElement();
+ OpaqueBehavior modelElement = (OpaqueBehavior) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -8969,7 +9146,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getComponent_2069OutgoingLinks(View view) {
- Component modelElement = (Component)view.getElement();
+ Component modelElement = (Component) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -8990,7 +9167,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getDevice_2070OutgoingLinks(View view) {
- Device modelElement = (Device)view.getElement();
+ Device modelElement = (Device) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -9011,7 +9188,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getExecutionEnvironment_2071OutgoingLinks(View view) {
- ExecutionEnvironment modelElement = (ExecutionEnvironment)view.getElement();
+ ExecutionEnvironment modelElement = (ExecutionEnvironment) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -9032,7 +9209,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getNode_2072OutgoingLinks(View view) {
- Node modelElement = (Node)view.getElement();
+ Node modelElement = (Node) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -9053,7 +9230,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getClass_2073OutgoingLinks(View view) {
- Class modelElement = (Class)view.getElement();
+ Class modelElement = (Class) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -9074,7 +9251,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getCollaboration_2075OutgoingLinks(View view) {
- Collaboration modelElement = (Collaboration)view.getElement();
+ Collaboration modelElement = (Collaboration) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -9095,7 +9272,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getInterface_2076OutgoingLinks(View view) {
- Interface modelElement = (Interface)view.getElement();
+ Interface modelElement = (Interface) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -9116,7 +9293,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getPrimitiveType_2066OutgoingLinks(View view) {
- PrimitiveType modelElement = (PrimitiveType)view.getElement();
+ PrimitiveType modelElement = (PrimitiveType) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -9137,7 +9314,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getEnumeration_2067OutgoingLinks(View view) {
- Enumeration modelElement = (Enumeration)view.getElement();
+ Enumeration modelElement = (Enumeration) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -9158,7 +9335,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getDataType_2068OutgoingLinks(View view) {
- DataType modelElement = (DataType)view.getElement();
+ DataType modelElement = (DataType) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -9179,7 +9356,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getActor_2077OutgoingLinks(View view) {
- Actor modelElement = (Actor)view.getElement();
+ Actor modelElement = (Actor) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -9200,7 +9377,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getDeploymentSpecification_2078OutgoingLinks(View view) {
- DeploymentSpecification modelElement = (DeploymentSpecification)view.getElement();
+ DeploymentSpecification modelElement = (DeploymentSpecification) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -9221,7 +9398,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getArtifact_2079OutgoingLinks(View view) {
- Artifact modelElement = (Artifact)view.getElement();
+ Artifact modelElement = (Artifact) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -9242,7 +9419,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getInformationItem_2080OutgoingLinks(View view) {
- InformationItem modelElement = (InformationItem)view.getElement();
+ InformationItem modelElement = (InformationItem) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -9264,7 +9441,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getSignal_2081OutgoingLinks(View view) {
- Signal modelElement = (Signal)view.getElement();
+ Signal modelElement = (Signal) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -9285,7 +9462,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getUseCase_2082OutgoingLinks(View view) {
- UseCase modelElement = (UseCase)view.getElement();
+ UseCase modelElement = (UseCase) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -9306,7 +9483,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getSignalEvent_2083OutgoingLinks(View view) {
- SignalEvent modelElement = (SignalEvent)view.getElement();
+ SignalEvent modelElement = (SignalEvent) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -9326,7 +9503,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getCallEvent_2084OutgoingLinks(View view) {
- CallEvent modelElement = (CallEvent)view.getElement();
+ CallEvent modelElement = (CallEvent) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -9346,7 +9523,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getAnyReceiveEvent_2085OutgoingLinks(View view) {
- AnyReceiveEvent modelElement = (AnyReceiveEvent)view.getElement();
+ AnyReceiveEvent modelElement = (AnyReceiveEvent) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -9366,7 +9543,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getChangeEvent_2088OutgoingLinks(View view) {
- ChangeEvent modelElement = (ChangeEvent)view.getElement();
+ ChangeEvent modelElement = (ChangeEvent) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -9386,7 +9563,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getTimeEvent_2089OutgoingLinks(View view) {
- TimeEvent modelElement = (TimeEvent)view.getElement();
+ TimeEvent modelElement = (TimeEvent) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -9406,7 +9583,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getDurationObservation_2093OutgoingLinks(View view) {
- DurationObservation modelElement = (DurationObservation)view.getElement();
+ DurationObservation modelElement = (DurationObservation) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -9427,7 +9604,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getTimeObservation_2094OutgoingLinks(View view) {
- TimeObservation modelElement = (TimeObservation)view.getElement();
+ TimeObservation modelElement = (TimeObservation) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -9448,7 +9625,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getLiteralBoolean_2095OutgoingLinks(View view) {
- LiteralBoolean modelElement = (LiteralBoolean)view.getElement();
+ LiteralBoolean modelElement = (LiteralBoolean) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -9468,7 +9645,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getLiteralInteger_2096OutgoingLinks(View view) {
- LiteralInteger modelElement = (LiteralInteger)view.getElement();
+ LiteralInteger modelElement = (LiteralInteger) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -9488,7 +9665,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getLiteralNull_2097OutgoingLinks(View view) {
- LiteralNull modelElement = (LiteralNull)view.getElement();
+ LiteralNull modelElement = (LiteralNull) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -9508,7 +9685,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getLiteralString_2098OutgoingLinks(View view) {
- LiteralString modelElement = (LiteralString)view.getElement();
+ LiteralString modelElement = (LiteralString) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -9528,7 +9705,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getLiteralUnlimitedNatural_2099OutgoingLinks(View view) {
- LiteralUnlimitedNatural modelElement = (LiteralUnlimitedNatural)view.getElement();
+ LiteralUnlimitedNatural modelElement = (LiteralUnlimitedNatural) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -9548,7 +9725,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getStringExpression_2100OutgoingLinks(View view) {
- StringExpression modelElement = (StringExpression)view.getElement();
+ StringExpression modelElement = (StringExpression) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -9568,7 +9745,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getOpaqueExpression_2101OutgoingLinks(View view) {
- OpaqueExpression modelElement = (OpaqueExpression)view.getElement();
+ OpaqueExpression modelElement = (OpaqueExpression) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -9588,7 +9765,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getTimeExpression_2102OutgoingLinks(View view) {
- TimeExpression modelElement = (TimeExpression)view.getElement();
+ TimeExpression modelElement = (TimeExpression) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -9608,7 +9785,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getExpression_2103OutgoingLinks(View view) {
- Expression modelElement = (Expression)view.getElement();
+ Expression modelElement = (Expression) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -9628,7 +9805,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getDuration_2104OutgoingLinks(View view) {
- Duration modelElement = (Duration)view.getElement();
+ Duration modelElement = (Duration) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -9648,7 +9825,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getTimeInterval_2105OutgoingLinks(View view) {
- TimeInterval modelElement = (TimeInterval)view.getElement();
+ TimeInterval modelElement = (TimeInterval) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -9668,7 +9845,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getDurationInterval_2106OutgoingLinks(View view) {
- DurationInterval modelElement = (DurationInterval)view.getElement();
+ DurationInterval modelElement = (DurationInterval) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -9688,7 +9865,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getInterval_2107OutgoingLinks(View view) {
- Interval modelElement = (Interval)view.getElement();
+ Interval modelElement = (Interval) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -9708,7 +9885,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getInstanceValue_2108OutgoingLinks(View view) {
- InstanceValue modelElement = (InstanceValue)view.getElement();
+ InstanceValue modelElement = (InstanceValue) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -9728,7 +9905,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getComment_2109OutgoingLinks(View view) {
- Comment modelElement = (Comment)view.getElement();
+ Comment modelElement = (Comment) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement));
return result;
@@ -9738,7 +9915,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getDurationConstraint_2110OutgoingLinks(View view) {
- DurationConstraint modelElement = (DurationConstraint)view.getElement();
+ DurationConstraint modelElement = (DurationConstraint) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElement_4003(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
@@ -9759,7 +9936,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getTimeConstraint_2111OutgoingLinks(View view) {
- TimeConstraint modelElement = (TimeConstraint)view.getElement();
+ TimeConstraint modelElement = (TimeConstraint) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElement_4003(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
@@ -9780,7 +9957,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getIntervalConstraint_2112OutgoingLinks(View view) {
- IntervalConstraint modelElement = (IntervalConstraint)view.getElement();
+ IntervalConstraint modelElement = (IntervalConstraint) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElement_4003(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
@@ -9801,7 +9978,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getInteractionConstraint_2113OutgoingLinks(View view) {
- InteractionConstraint modelElement = (InteractionConstraint)view.getElement();
+ InteractionConstraint modelElement = (InteractionConstraint) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElement_4003(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
@@ -9822,7 +9999,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getConstraint_2114OutgoingLinks(View view) {
- Constraint modelElement = (Constraint)view.getElement();
+ Constraint modelElement = (Constraint) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElement_4003(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
@@ -9843,7 +10020,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getPort_3069OutgoingLinks(View view) {
- Port modelElement = (Port)view.getElement();
+ Port modelElement = (Port) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -9863,7 +10040,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getParameter_3088OutgoingLinks(View view) {
- Parameter modelElement = (Parameter)view.getElement();
+ Parameter modelElement = (Parameter) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -9883,7 +10060,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getProperty_3070OutgoingLinks(View view) {
- Property modelElement = (Property)view.getElement();
+ Property modelElement = (Property) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -9903,7 +10080,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getConnectableElement_3115OutgoingLinks(View view) {
- ConnectableElement modelElement = (ConnectableElement)view.getElement();
+ ConnectableElement modelElement = (ConnectableElement) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -9923,7 +10100,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getCollaborationUse_3071OutgoingLinks(View view) {
- CollaborationUse modelElement = (CollaborationUse)view.getElement();
+ CollaborationUse modelElement = (CollaborationUse) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -9943,7 +10120,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getActivity_3072OutgoingLinks(View view) {
- Activity modelElement = (Activity)view.getElement();
+ Activity modelElement = (Activity) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -9964,7 +10141,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getInteraction_3073OutgoingLinks(View view) {
- Interaction modelElement = (Interaction)view.getElement();
+ Interaction modelElement = (Interaction) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -9985,7 +10162,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getProtocolStateMachine_3074OutgoingLinks(View view) {
- ProtocolStateMachine modelElement = (ProtocolStateMachine)view.getElement();
+ ProtocolStateMachine modelElement = (ProtocolStateMachine) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -10006,7 +10183,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getStateMachine_3075OutgoingLinks(View view) {
- StateMachine modelElement = (StateMachine)view.getElement();
+ StateMachine modelElement = (StateMachine) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -10027,7 +10204,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getFunctionBehavior_3076OutgoingLinks(View view) {
- FunctionBehavior modelElement = (FunctionBehavior)view.getElement();
+ FunctionBehavior modelElement = (FunctionBehavior) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -10048,7 +10225,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getOpaqueBehavior_3077OutgoingLinks(View view) {
- OpaqueBehavior modelElement = (OpaqueBehavior)view.getElement();
+ OpaqueBehavior modelElement = (OpaqueBehavior) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -10069,7 +10246,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getComponent_3081OutgoingLinks(View view) {
- Component modelElement = (Component)view.getElement();
+ Component modelElement = (Component) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -10090,7 +10267,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getDevice_3082OutgoingLinks(View view) {
- Device modelElement = (Device)view.getElement();
+ Device modelElement = (Device) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -10111,7 +10288,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getExecutionEnvironment_3083OutgoingLinks(View view) {
- ExecutionEnvironment modelElement = (ExecutionEnvironment)view.getElement();
+ ExecutionEnvironment modelElement = (ExecutionEnvironment) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -10132,7 +10309,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getNode_3084OutgoingLinks(View view) {
- Node modelElement = (Node)view.getElement();
+ Node modelElement = (Node) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -10153,7 +10330,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getClass_3085OutgoingLinks(View view) {
- Class modelElement = (Class)view.getElement();
+ Class modelElement = (Class) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -10174,7 +10351,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getCollaboration_3086OutgoingLinks(View view) {
- Collaboration modelElement = (Collaboration)view.getElement();
+ Collaboration modelElement = (Collaboration) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -10195,7 +10372,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getInterface_3087OutgoingLinks(View view) {
- Interface modelElement = (Interface)view.getElement();
+ Interface modelElement = (Interface) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -10216,7 +10393,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getPrimitiveType_3078OutgoingLinks(View view) {
- PrimitiveType modelElement = (PrimitiveType)view.getElement();
+ PrimitiveType modelElement = (PrimitiveType) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -10237,7 +10414,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getEnumeration_3079OutgoingLinks(View view) {
- Enumeration modelElement = (Enumeration)view.getElement();
+ Enumeration modelElement = (Enumeration) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -10258,7 +10435,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getDataType_3080OutgoingLinks(View view) {
- DataType modelElement = (DataType)view.getElement();
+ DataType modelElement = (DataType) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -10279,7 +10456,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getActor_3091OutgoingLinks(View view) {
- Actor modelElement = (Actor)view.getElement();
+ Actor modelElement = (Actor) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -10300,7 +10477,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getDeploymentSpecification_3092OutgoingLinks(View view) {
- DeploymentSpecification modelElement = (DeploymentSpecification)view.getElement();
+ DeploymentSpecification modelElement = (DeploymentSpecification) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -10321,7 +10498,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getArtifact_3093OutgoingLinks(View view) {
- Artifact modelElement = (Artifact)view.getElement();
+ Artifact modelElement = (Artifact) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -10342,7 +10519,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getInformationItem_3094OutgoingLinks(View view) {
- InformationItem modelElement = (InformationItem)view.getElement();
+ InformationItem modelElement = (InformationItem) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -10364,7 +10541,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getSignal_3095OutgoingLinks(View view) {
- Signal modelElement = (Signal)view.getElement();
+ Signal modelElement = (Signal) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -10385,7 +10562,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getUseCase_3096OutgoingLinks(View view) {
- UseCase modelElement = (UseCase)view.getElement();
+ UseCase modelElement = (UseCase) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -10406,7 +10583,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getComment_3097OutgoingLinks(View view) {
- Comment modelElement = (Comment)view.getElement();
+ Comment modelElement = (Comment) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(modelElement));
return result;
@@ -10416,7 +10593,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getDurationConstraint_3116OutgoingLinks(View view) {
- DurationConstraint modelElement = (DurationConstraint)view.getElement();
+ DurationConstraint modelElement = (DurationConstraint) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElement_4003(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
@@ -10437,7 +10614,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getTimeConstraint_3117OutgoingLinks(View view) {
- TimeConstraint modelElement = (TimeConstraint)view.getElement();
+ TimeConstraint modelElement = (TimeConstraint) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElement_4003(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
@@ -10458,7 +10635,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getIntervalConstraint_3118OutgoingLinks(View view) {
- IntervalConstraint modelElement = (IntervalConstraint)view.getElement();
+ IntervalConstraint modelElement = (IntervalConstraint) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElement_4003(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
@@ -10479,7 +10656,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getInteractionConstraint_3119OutgoingLinks(View view) {
- InteractionConstraint modelElement = (InteractionConstraint)view.getElement();
+ InteractionConstraint modelElement = (InteractionConstraint) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElement_4003(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
@@ -10500,7 +10677,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getConstraint_3120OutgoingLinks(View view) {
- Constraint modelElement = (Constraint)view.getElement();
+ Constraint modelElement = (Constraint) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElement_4003(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
@@ -10542,7 +10719,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getComponentRealization_4004OutgoingLinks(View view) {
- ComponentRealization modelElement = (ComponentRealization)view.getElement();
+ ComponentRealization modelElement = (ComponentRealization) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -10562,7 +10739,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getInterfaceRealization_4005OutgoingLinks(View view) {
- InterfaceRealization modelElement = (InterfaceRealization)view.getElement();
+ InterfaceRealization modelElement = (InterfaceRealization) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -10582,7 +10759,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getSubstitution_4011OutgoingLinks(View view) {
- Substitution modelElement = (Substitution)view.getElement();
+ Substitution modelElement = (Substitution) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -10602,7 +10779,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getRealization_4006OutgoingLinks(View view) {
- Realization modelElement = (Realization)view.getElement();
+ Realization modelElement = (Realization) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -10622,7 +10799,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getManifestation_4012OutgoingLinks(View view) {
- Manifestation modelElement = (Manifestation)view.getElement();
+ Manifestation modelElement = (Manifestation) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -10642,7 +10819,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getAbstraction_4007OutgoingLinks(View view) {
- Abstraction modelElement = (Abstraction)view.getElement();
+ Abstraction modelElement = (Abstraction) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -10662,7 +10839,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getUsage_4008OutgoingLinks(View view) {
- Usage modelElement = (Usage)view.getElement();
+ Usage modelElement = (Usage) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -10682,7 +10859,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getDeployment_4009OutgoingLinks(View view) {
- Deployment modelElement = (Deployment)view.getElement();
+ Deployment modelElement = (Deployment) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -10702,7 +10879,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getDependency_4017OutgoingLinks(View view) {
- Dependency modelElement = (Dependency)view.getElement();
+ Dependency modelElement = (Dependency) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -10722,7 +10899,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getDependency_4010OutgoingLinks(View view) {
- Dependency modelElement = (Dependency)view.getElement();
+ Dependency modelElement = (Dependency) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -10742,7 +10919,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getConnector_4013OutgoingLinks(View view) {
- Connector modelElement = (Connector)view.getElement();
+ Connector modelElement = (Connector) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -10769,7 +10946,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
* @generated
*/
public List<UMLLinkDescriptor> getInformationFlow_4021OutgoingLinks(View view) {
- InformationFlow modelElement = (InformationFlow)view.getElement();
+ InformationFlow modelElement = (InformationFlow) view.getElement();
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
result.addAll(getOutgoingTypeModelFacetLinks_ComponentRealization_4004(modelElement));
result.addAll(getOutgoingTypeModelFacetLinks_InterfaceRealization_4005(modelElement));
@@ -10790,27 +10967,28 @@ public class UMLDiagramUpdater implements DiagramUpdater {
*/
protected Collection<UMLLinkDescriptor> getContainedTypeModelFacetLinks_ComponentRealization_4004(Package container) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- for(Iterator<?> links = container.getPackagedElements().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof ComponentRealization) {
+ for (Iterator<?> links = container.getPackagedElements()
+ .iterator(); links.hasNext();) {
+ EObject linkObject = (EObject) links.next();
+ if (false == linkObject instanceof ComponentRealization) {
continue;
}
- ComponentRealization link = (ComponentRealization)linkObject;
- if(ComponentRealizationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ ComponentRealization link = (ComponentRealization) linkObject;
+ if (ComponentRealizationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List<?> targets = link.getSuppliers();
Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof NamedElement) {
+ if (false == theTarget instanceof NamedElement) {
continue;
}
- NamedElement dst = (NamedElement)theTarget;
+ NamedElement dst = (NamedElement) theTarget;
List<?> sources = link.getClients();
Object theSource = sources.size() == 1 ? sources.get(0) : null;
- if(false == theSource instanceof NamedElement) {
+ if (false == theSource instanceof NamedElement) {
continue;
}
- NamedElement src = (NamedElement)theSource;
+ NamedElement src = (NamedElement) theSource;
result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.ComponentRealization_4004, ComponentRealizationEditPart.VISUAL_ID));
}
return result;
@@ -10821,27 +10999,28 @@ public class UMLDiagramUpdater implements DiagramUpdater {
*/
protected Collection<UMLLinkDescriptor> getContainedTypeModelFacetLinks_InterfaceRealization_4005(Package container) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- for(Iterator<?> links = container.getPackagedElements().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof InterfaceRealization) {
+ for (Iterator<?> links = container.getPackagedElements()
+ .iterator(); links.hasNext();) {
+ EObject linkObject = (EObject) links.next();
+ if (false == linkObject instanceof InterfaceRealization) {
continue;
}
- InterfaceRealization link = (InterfaceRealization)linkObject;
- if(InterfaceRealizationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ InterfaceRealization link = (InterfaceRealization) linkObject;
+ if (InterfaceRealizationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List<?> targets = link.getSuppliers();
Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof NamedElement) {
+ if (false == theTarget instanceof NamedElement) {
continue;
}
- NamedElement dst = (NamedElement)theTarget;
+ NamedElement dst = (NamedElement) theTarget;
List<?> sources = link.getClients();
Object theSource = sources.size() == 1 ? sources.get(0) : null;
- if(false == theSource instanceof NamedElement) {
+ if (false == theSource instanceof NamedElement) {
continue;
}
- NamedElement src = (NamedElement)theSource;
+ NamedElement src = (NamedElement) theSource;
result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.InterfaceRealization_4005, InterfaceRealizationEditPart.VISUAL_ID));
}
return result;
@@ -10852,27 +11031,28 @@ public class UMLDiagramUpdater implements DiagramUpdater {
*/
protected Collection<UMLLinkDescriptor> getContainedTypeModelFacetLinks_Substitution_4011(Package container) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- for(Iterator<?> links = container.getPackagedElements().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Substitution) {
+ for (Iterator<?> links = container.getPackagedElements()
+ .iterator(); links.hasNext();) {
+ EObject linkObject = (EObject) links.next();
+ if (false == linkObject instanceof Substitution) {
continue;
}
- Substitution link = (Substitution)linkObject;
- if(SubstitutionEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Substitution link = (Substitution) linkObject;
+ if (SubstitutionEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List<?> targets = link.getSuppliers();
Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof NamedElement) {
+ if (false == theTarget instanceof NamedElement) {
continue;
}
- NamedElement dst = (NamedElement)theTarget;
+ NamedElement dst = (NamedElement) theTarget;
List<?> sources = link.getClients();
Object theSource = sources.size() == 1 ? sources.get(0) : null;
- if(false == theSource instanceof NamedElement) {
+ if (false == theSource instanceof NamedElement) {
continue;
}
- NamedElement src = (NamedElement)theSource;
+ NamedElement src = (NamedElement) theSource;
result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Substitution_4011, SubstitutionEditPart.VISUAL_ID));
}
return result;
@@ -10883,27 +11063,28 @@ public class UMLDiagramUpdater implements DiagramUpdater {
*/
protected Collection<UMLLinkDescriptor> getContainedTypeModelFacetLinks_Realization_4006(Package container) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- for(Iterator<?> links = container.getPackagedElements().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Realization) {
+ for (Iterator<?> links = container.getPackagedElements()
+ .iterator(); links.hasNext();) {
+ EObject linkObject = (EObject) links.next();
+ if (false == linkObject instanceof Realization) {
continue;
}
- Realization link = (Realization)linkObject;
- if(RealizationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Realization link = (Realization) linkObject;
+ if (RealizationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List<?> targets = link.getSuppliers();
Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof NamedElement) {
+ if (false == theTarget instanceof NamedElement) {
continue;
}
- NamedElement dst = (NamedElement)theTarget;
+ NamedElement dst = (NamedElement) theTarget;
List<?> sources = link.getClients();
Object theSource = sources.size() == 1 ? sources.get(0) : null;
- if(false == theSource instanceof NamedElement) {
+ if (false == theSource instanceof NamedElement) {
continue;
}
- NamedElement src = (NamedElement)theSource;
+ NamedElement src = (NamedElement) theSource;
result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Realization_4006, RealizationEditPart.VISUAL_ID));
}
return result;
@@ -10914,27 +11095,28 @@ public class UMLDiagramUpdater implements DiagramUpdater {
*/
protected Collection<UMLLinkDescriptor> getContainedTypeModelFacetLinks_Manifestation_4012(Package container) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- for(Iterator<?> links = container.getPackagedElements().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Manifestation) {
+ for (Iterator<?> links = container.getPackagedElements()
+ .iterator(); links.hasNext();) {
+ EObject linkObject = (EObject) links.next();
+ if (false == linkObject instanceof Manifestation) {
continue;
}
- Manifestation link = (Manifestation)linkObject;
- if(ManifestationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Manifestation link = (Manifestation) linkObject;
+ if (ManifestationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List<?> targets = link.getSuppliers();
Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof NamedElement) {
+ if (false == theTarget instanceof NamedElement) {
continue;
}
- NamedElement dst = (NamedElement)theTarget;
+ NamedElement dst = (NamedElement) theTarget;
List<?> sources = link.getClients();
Object theSource = sources.size() == 1 ? sources.get(0) : null;
- if(false == theSource instanceof NamedElement) {
+ if (false == theSource instanceof NamedElement) {
continue;
}
- NamedElement src = (NamedElement)theSource;
+ NamedElement src = (NamedElement) theSource;
result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Manifestation_4012, ManifestationEditPart.VISUAL_ID));
}
return result;
@@ -10945,27 +11127,28 @@ public class UMLDiagramUpdater implements DiagramUpdater {
*/
protected Collection<UMLLinkDescriptor> getContainedTypeModelFacetLinks_Abstraction_4007(Package container) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- for(Iterator<?> links = container.getPackagedElements().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Abstraction) {
+ for (Iterator<?> links = container.getPackagedElements()
+ .iterator(); links.hasNext();) {
+ EObject linkObject = (EObject) links.next();
+ if (false == linkObject instanceof Abstraction) {
continue;
}
- Abstraction link = (Abstraction)linkObject;
- if(AbstractionEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Abstraction link = (Abstraction) linkObject;
+ if (AbstractionEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List<?> targets = link.getSuppliers();
Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof NamedElement) {
+ if (false == theTarget instanceof NamedElement) {
continue;
}
- NamedElement dst = (NamedElement)theTarget;
+ NamedElement dst = (NamedElement) theTarget;
List<?> sources = link.getClients();
Object theSource = sources.size() == 1 ? sources.get(0) : null;
- if(false == theSource instanceof NamedElement) {
+ if (false == theSource instanceof NamedElement) {
continue;
}
- NamedElement src = (NamedElement)theSource;
+ NamedElement src = (NamedElement) theSource;
result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Abstraction_4007, AbstractionEditPart.VISUAL_ID));
}
return result;
@@ -10976,27 +11159,28 @@ public class UMLDiagramUpdater implements DiagramUpdater {
*/
protected Collection<UMLLinkDescriptor> getContainedTypeModelFacetLinks_Usage_4008(Package container) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- for(Iterator<?> links = container.getPackagedElements().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Usage) {
+ for (Iterator<?> links = container.getPackagedElements()
+ .iterator(); links.hasNext();) {
+ EObject linkObject = (EObject) links.next();
+ if (false == linkObject instanceof Usage) {
continue;
}
- Usage link = (Usage)linkObject;
- if(UsageEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Usage link = (Usage) linkObject;
+ if (UsageEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List<?> targets = link.getSuppliers();
Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof NamedElement) {
+ if (false == theTarget instanceof NamedElement) {
continue;
}
- NamedElement dst = (NamedElement)theTarget;
+ NamedElement dst = (NamedElement) theTarget;
List<?> sources = link.getClients();
Object theSource = sources.size() == 1 ? sources.get(0) : null;
- if(false == theSource instanceof NamedElement) {
+ if (false == theSource instanceof NamedElement) {
continue;
}
- NamedElement src = (NamedElement)theSource;
+ NamedElement src = (NamedElement) theSource;
result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Usage_4008, UsageEditPart.VISUAL_ID));
}
return result;
@@ -11007,27 +11191,28 @@ public class UMLDiagramUpdater implements DiagramUpdater {
*/
protected Collection<UMLLinkDescriptor> getContainedTypeModelFacetLinks_Deployment_4009(Package container) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- for(Iterator<?> links = container.getPackagedElements().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Deployment) {
+ for (Iterator<?> links = container.getPackagedElements()
+ .iterator(); links.hasNext();) {
+ EObject linkObject = (EObject) links.next();
+ if (false == linkObject instanceof Deployment) {
continue;
}
- Deployment link = (Deployment)linkObject;
- if(DeploymentEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Deployment link = (Deployment) linkObject;
+ if (DeploymentEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List<?> targets = link.getSuppliers();
Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof NamedElement) {
+ if (false == theTarget instanceof NamedElement) {
continue;
}
- NamedElement dst = (NamedElement)theTarget;
+ NamedElement dst = (NamedElement) theTarget;
List<?> sources = link.getClients();
Object theSource = sources.size() == 1 ? sources.get(0) : null;
- if(false == theSource instanceof NamedElement) {
+ if (false == theSource instanceof NamedElement) {
continue;
}
- NamedElement src = (NamedElement)theSource;
+ NamedElement src = (NamedElement) theSource;
result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Deployment_4009, DeploymentEditPart.VISUAL_ID));
}
return result;
@@ -11038,27 +11223,28 @@ public class UMLDiagramUpdater implements DiagramUpdater {
*/
protected Collection<UMLLinkDescriptor> getContainedTypeModelFacetLinks_Dependency_4017(Package container) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- for(Iterator<?> links = container.getPackagedElements().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Dependency) {
+ for (Iterator<?> links = container.getPackagedElements()
+ .iterator(); links.hasNext();) {
+ EObject linkObject = (EObject) links.next();
+ if (false == linkObject instanceof Dependency) {
continue;
}
- Dependency link = (Dependency)linkObject;
- if(RoleBindingEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Dependency link = (Dependency) linkObject;
+ if (RoleBindingEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List<?> targets = link.getSuppliers();
Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof NamedElement) {
+ if (false == theTarget instanceof NamedElement) {
continue;
}
- NamedElement dst = (NamedElement)theTarget;
+ NamedElement dst = (NamedElement) theTarget;
List<?> sources = link.getClients();
Object theSource = sources.size() == 1 ? sources.get(0) : null;
- if(false == theSource instanceof NamedElement) {
+ if (false == theSource instanceof NamedElement) {
continue;
}
- NamedElement src = (NamedElement)theSource;
+ NamedElement src = (NamedElement) theSource;
result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Dependency_4017, RoleBindingEditPart.VISUAL_ID));
}
return result;
@@ -11069,27 +11255,28 @@ public class UMLDiagramUpdater implements DiagramUpdater {
*/
protected Collection<UMLLinkDescriptor> getContainedTypeModelFacetLinks_Dependency_4010(Package container) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- for(Iterator<?> links = container.getPackagedElements().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Dependency) {
+ for (Iterator<?> links = container.getPackagedElements()
+ .iterator(); links.hasNext();) {
+ EObject linkObject = (EObject) links.next();
+ if (false == linkObject instanceof Dependency) {
continue;
}
- Dependency link = (Dependency)linkObject;
- if(DependencyEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Dependency link = (Dependency) linkObject;
+ if (DependencyEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List<?> targets = link.getSuppliers();
Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof NamedElement) {
+ if (false == theTarget instanceof NamedElement) {
continue;
}
- NamedElement dst = (NamedElement)theTarget;
+ NamedElement dst = (NamedElement) theTarget;
List<?> sources = link.getClients();
Object theSource = sources.size() == 1 ? sources.get(0) : null;
- if(false == theSource instanceof NamedElement) {
+ if (false == theSource instanceof NamedElement) {
continue;
}
- NamedElement src = (NamedElement)theSource;
+ NamedElement src = (NamedElement) theSource;
result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Dependency_4010, DependencyEditPart.VISUAL_ID));
}
return result;
@@ -11100,27 +11287,28 @@ public class UMLDiagramUpdater implements DiagramUpdater {
*/
protected Collection<UMLLinkDescriptor> getContainedTypeModelFacetLinks_Connector_4013(StructuredClassifier container) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- for(Iterator<?> links = container.getOwnedConnectors().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Connector) {
+ 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 != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Connector link = (Connector) linkObject;
+ if (ConnectorEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List<?> targets = link.getEnds();
Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof ConnectorEnd) {
+ if (false == theTarget instanceof ConnectorEnd) {
continue;
}
- ConnectorEnd dst = (ConnectorEnd)theTarget;
+ ConnectorEnd dst = (ConnectorEnd) theTarget;
List<?> sources = link.getEnds();
Object theSource = sources.size() == 1 ? sources.get(0) : null;
- if(false == theSource instanceof ConnectorEnd) {
+ if (false == theSource instanceof ConnectorEnd) {
continue;
}
- ConnectorEnd src = (ConnectorEnd)theSource;
+ ConnectorEnd src = (ConnectorEnd) theSource;
result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Connector_4013, ConnectorEditPart.VISUAL_ID));
}
return result;
@@ -11131,13 +11319,14 @@ public class UMLDiagramUpdater implements DiagramUpdater {
*/
protected Collection<UMLLinkDescriptor> getContainedTypeModelFacetLinks_Generalization_4015(Classifier container) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- for(Iterator<?> links = container.getGeneralizations().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Generalization) {
+ for (Iterator<?> links = container.getGeneralizations()
+ .iterator(); links.hasNext();) {
+ EObject linkObject = (EObject) links.next();
+ if (false == linkObject instanceof Generalization) {
continue;
}
- Generalization link = (Generalization)linkObject;
- if(GeneralizationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Generalization link = (Generalization) linkObject;
+ if (GeneralizationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
Classifier dst = link.getGeneral();
@@ -11152,27 +11341,28 @@ public class UMLDiagramUpdater implements DiagramUpdater {
*/
protected Collection<UMLLinkDescriptor> getContainedTypeModelFacetLinks_InformationFlow_4021(Package container) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- for(Iterator<?> links = container.getPackagedElements().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof InformationFlow) {
+ for (Iterator<?> links = container.getPackagedElements()
+ .iterator(); links.hasNext();) {
+ EObject linkObject = (EObject) links.next();
+ if (false == linkObject instanceof InformationFlow) {
continue;
}
- InformationFlow link = (InformationFlow)linkObject;
- if(InformationFlowEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ InformationFlow link = (InformationFlow) linkObject;
+ if (InformationFlowEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List<?> targets = link.getInformationTargets();
Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof NamedElement) {
+ if (false == theTarget instanceof NamedElement) {
continue;
}
- NamedElement dst = (NamedElement)theTarget;
+ NamedElement dst = (NamedElement) theTarget;
List<?> sources = link.getInformationSources();
Object theSource = sources.size() == 1 ? sources.get(0) : null;
- if(false == theSource instanceof NamedElement) {
+ if (false == theSource instanceof NamedElement) {
continue;
}
- NamedElement src = (NamedElement)theSource;
+ NamedElement src = (NamedElement) theSource;
result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.InformationFlow_4021, InformationFlowEditPart.VISUAL_ID));
}
return result;
@@ -11184,8 +11374,8 @@ public class UMLDiagramUpdater implements DiagramUpdater {
protected Collection<UMLLinkDescriptor> getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(Element target, CrossReferenceAdapter crossReferencer) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
Collection<EStructuralFeature.Setting> settings = crossReferencer.getInverseReferences(target);
- for(EStructuralFeature.Setting setting : settings) {
- if(setting.getEStructuralFeature() == UMLPackage.eINSTANCE.getComment_AnnotatedElement()) {
+ for (EStructuralFeature.Setting setting : settings) {
+ if (setting.getEStructuralFeature() == UMLPackage.eINSTANCE.getComment_AnnotatedElement()) {
result.add(new UMLLinkDescriptor(setting.getEObject(), target, UMLElementTypes.CommentAnnotatedElement_4002, CommentAnnotatedElementEditPart.VISUAL_ID));
}
}
@@ -11198,8 +11388,8 @@ public class UMLDiagramUpdater implements DiagramUpdater {
protected Collection<UMLLinkDescriptor> getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElement_4003(Element target, CrossReferenceAdapter crossReferencer) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
Collection<EStructuralFeature.Setting> settings = crossReferencer.getInverseReferences(target);
- for(EStructuralFeature.Setting setting : settings) {
- if(setting.getEStructuralFeature() == UMLPackage.eINSTANCE.getConstraint_ConstrainedElement()) {
+ for (EStructuralFeature.Setting setting : settings) {
+ if (setting.getEStructuralFeature() == UMLPackage.eINSTANCE.getConstraint_ConstrainedElement()) {
result.add(new UMLLinkDescriptor(setting.getEObject(), target, UMLElementTypes.ConstraintConstrainedElement_4003, ConstraintConstrainedElementEditPart.VISUAL_ID));
}
}
@@ -11212,20 +11402,20 @@ public class UMLDiagramUpdater implements DiagramUpdater {
protected Collection<UMLLinkDescriptor> getIncomingTypeModelFacetLinks_ComponentRealization_4004(NamedElement target, CrossReferenceAdapter crossReferencer) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
Collection<EStructuralFeature.Setting> settings = crossReferencer.getInverseReferences(target);
- for(EStructuralFeature.Setting setting : settings) {
- if(setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getDependency_Supplier() || false == setting.getEObject() instanceof ComponentRealization) {
+ for (EStructuralFeature.Setting setting : settings) {
+ if (setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getDependency_Supplier() || false == setting.getEObject() instanceof ComponentRealization) {
continue;
}
- ComponentRealization link = (ComponentRealization)setting.getEObject();
- if(ComponentRealizationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ ComponentRealization link = (ComponentRealization) setting.getEObject();
+ if (ComponentRealizationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List<?> sources = link.getClients();
Object theSource = sources.size() == 1 ? sources.get(0) : null;
- if(false == theSource instanceof NamedElement) {
+ if (false == theSource instanceof NamedElement) {
continue;
}
- NamedElement src = (NamedElement)theSource;
+ NamedElement src = (NamedElement) theSource;
result.add(new UMLLinkDescriptor(src, target, link, UMLElementTypes.ComponentRealization_4004, ComponentRealizationEditPart.VISUAL_ID));
}
return result;
@@ -11237,20 +11427,20 @@ public class UMLDiagramUpdater implements DiagramUpdater {
protected Collection<UMLLinkDescriptor> getIncomingTypeModelFacetLinks_InterfaceRealization_4005(NamedElement target, CrossReferenceAdapter crossReferencer) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
Collection<EStructuralFeature.Setting> settings = crossReferencer.getInverseReferences(target);
- for(EStructuralFeature.Setting setting : settings) {
- if(setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getDependency_Supplier() || false == setting.getEObject() instanceof InterfaceRealization) {
+ for (EStructuralFeature.Setting setting : settings) {
+ if (setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getDependency_Supplier() || false == setting.getEObject() instanceof InterfaceRealization) {
continue;
}
- InterfaceRealization link = (InterfaceRealization)setting.getEObject();
- if(InterfaceRealizationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ InterfaceRealization link = (InterfaceRealization) setting.getEObject();
+ if (InterfaceRealizationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List<?> sources = link.getClients();
Object theSource = sources.size() == 1 ? sources.get(0) : null;
- if(false == theSource instanceof NamedElement) {
+ if (false == theSource instanceof NamedElement) {
continue;
}
- NamedElement src = (NamedElement)theSource;
+ NamedElement src = (NamedElement) theSource;
result.add(new UMLLinkDescriptor(src, target, link, UMLElementTypes.InterfaceRealization_4005, InterfaceRealizationEditPart.VISUAL_ID));
}
return result;
@@ -11262,20 +11452,20 @@ public class UMLDiagramUpdater implements DiagramUpdater {
protected Collection<UMLLinkDescriptor> getIncomingTypeModelFacetLinks_Substitution_4011(NamedElement target, CrossReferenceAdapter crossReferencer) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
Collection<EStructuralFeature.Setting> settings = crossReferencer.getInverseReferences(target);
- for(EStructuralFeature.Setting setting : settings) {
- if(setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getDependency_Supplier() || false == setting.getEObject() instanceof Substitution) {
+ for (EStructuralFeature.Setting setting : settings) {
+ if (setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getDependency_Supplier() || false == setting.getEObject() instanceof Substitution) {
continue;
}
- Substitution link = (Substitution)setting.getEObject();
- if(SubstitutionEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Substitution link = (Substitution) setting.getEObject();
+ if (SubstitutionEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List<?> sources = link.getClients();
Object theSource = sources.size() == 1 ? sources.get(0) : null;
- if(false == theSource instanceof NamedElement) {
+ if (false == theSource instanceof NamedElement) {
continue;
}
- NamedElement src = (NamedElement)theSource;
+ NamedElement src = (NamedElement) theSource;
result.add(new UMLLinkDescriptor(src, target, link, UMLElementTypes.Substitution_4011, SubstitutionEditPart.VISUAL_ID));
}
return result;
@@ -11287,20 +11477,20 @@ public class UMLDiagramUpdater implements DiagramUpdater {
protected Collection<UMLLinkDescriptor> getIncomingTypeModelFacetLinks_Realization_4006(NamedElement target, CrossReferenceAdapter crossReferencer) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
Collection<EStructuralFeature.Setting> settings = crossReferencer.getInverseReferences(target);
- for(EStructuralFeature.Setting setting : settings) {
- if(setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getDependency_Supplier() || false == setting.getEObject() instanceof Realization) {
+ for (EStructuralFeature.Setting setting : settings) {
+ if (setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getDependency_Supplier() || false == setting.getEObject() instanceof Realization) {
continue;
}
- Realization link = (Realization)setting.getEObject();
- if(RealizationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Realization link = (Realization) setting.getEObject();
+ if (RealizationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List<?> sources = link.getClients();
Object theSource = sources.size() == 1 ? sources.get(0) : null;
- if(false == theSource instanceof NamedElement) {
+ if (false == theSource instanceof NamedElement) {
continue;
}
- NamedElement src = (NamedElement)theSource;
+ NamedElement src = (NamedElement) theSource;
result.add(new UMLLinkDescriptor(src, target, link, UMLElementTypes.Realization_4006, RealizationEditPart.VISUAL_ID));
}
return result;
@@ -11312,20 +11502,20 @@ public class UMLDiagramUpdater implements DiagramUpdater {
protected Collection<UMLLinkDescriptor> getIncomingTypeModelFacetLinks_Manifestation_4012(NamedElement target, CrossReferenceAdapter crossReferencer) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
Collection<EStructuralFeature.Setting> settings = crossReferencer.getInverseReferences(target);
- for(EStructuralFeature.Setting setting : settings) {
- if(setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getDependency_Supplier() || false == setting.getEObject() instanceof Manifestation) {
+ for (EStructuralFeature.Setting setting : settings) {
+ if (setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getDependency_Supplier() || false == setting.getEObject() instanceof Manifestation) {
continue;
}
- Manifestation link = (Manifestation)setting.getEObject();
- if(ManifestationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Manifestation link = (Manifestation) setting.getEObject();
+ if (ManifestationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List<?> sources = link.getClients();
Object theSource = sources.size() == 1 ? sources.get(0) : null;
- if(false == theSource instanceof NamedElement) {
+ if (false == theSource instanceof NamedElement) {
continue;
}
- NamedElement src = (NamedElement)theSource;
+ NamedElement src = (NamedElement) theSource;
result.add(new UMLLinkDescriptor(src, target, link, UMLElementTypes.Manifestation_4012, ManifestationEditPart.VISUAL_ID));
}
return result;
@@ -11337,20 +11527,20 @@ public class UMLDiagramUpdater implements DiagramUpdater {
protected Collection<UMLLinkDescriptor> getIncomingTypeModelFacetLinks_Abstraction_4007(NamedElement target, CrossReferenceAdapter crossReferencer) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
Collection<EStructuralFeature.Setting> settings = crossReferencer.getInverseReferences(target);
- for(EStructuralFeature.Setting setting : settings) {
- if(setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getDependency_Supplier() || false == setting.getEObject() instanceof Abstraction) {
+ for (EStructuralFeature.Setting setting : settings) {
+ if (setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getDependency_Supplier() || false == setting.getEObject() instanceof Abstraction) {
continue;
}
- Abstraction link = (Abstraction)setting.getEObject();
- if(AbstractionEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Abstraction link = (Abstraction) setting.getEObject();
+ if (AbstractionEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List<?> sources = link.getClients();
Object theSource = sources.size() == 1 ? sources.get(0) : null;
- if(false == theSource instanceof NamedElement) {
+ if (false == theSource instanceof NamedElement) {
continue;
}
- NamedElement src = (NamedElement)theSource;
+ NamedElement src = (NamedElement) theSource;
result.add(new UMLLinkDescriptor(src, target, link, UMLElementTypes.Abstraction_4007, AbstractionEditPart.VISUAL_ID));
}
return result;
@@ -11362,20 +11552,20 @@ public class UMLDiagramUpdater implements DiagramUpdater {
protected Collection<UMLLinkDescriptor> getIncomingTypeModelFacetLinks_Usage_4008(NamedElement target, CrossReferenceAdapter crossReferencer) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
Collection<EStructuralFeature.Setting> settings = crossReferencer.getInverseReferences(target);
- for(EStructuralFeature.Setting setting : settings) {
- if(setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getDependency_Supplier() || false == setting.getEObject() instanceof Usage) {
+ for (EStructuralFeature.Setting setting : settings) {
+ if (setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getDependency_Supplier() || false == setting.getEObject() instanceof Usage) {
continue;
}
- Usage link = (Usage)setting.getEObject();
- if(UsageEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Usage link = (Usage) setting.getEObject();
+ if (UsageEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List<?> sources = link.getClients();
Object theSource = sources.size() == 1 ? sources.get(0) : null;
- if(false == theSource instanceof NamedElement) {
+ if (false == theSource instanceof NamedElement) {
continue;
}
- NamedElement src = (NamedElement)theSource;
+ NamedElement src = (NamedElement) theSource;
result.add(new UMLLinkDescriptor(src, target, link, UMLElementTypes.Usage_4008, UsageEditPart.VISUAL_ID));
}
return result;
@@ -11387,20 +11577,20 @@ public class UMLDiagramUpdater implements DiagramUpdater {
protected Collection<UMLLinkDescriptor> getIncomingTypeModelFacetLinks_Deployment_4009(NamedElement target, CrossReferenceAdapter crossReferencer) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
Collection<EStructuralFeature.Setting> settings = crossReferencer.getInverseReferences(target);
- for(EStructuralFeature.Setting setting : settings) {
- if(setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getDependency_Supplier() || false == setting.getEObject() instanceof Deployment) {
+ for (EStructuralFeature.Setting setting : settings) {
+ if (setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getDependency_Supplier() || false == setting.getEObject() instanceof Deployment) {
continue;
}
- Deployment link = (Deployment)setting.getEObject();
- if(DeploymentEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Deployment link = (Deployment) setting.getEObject();
+ if (DeploymentEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List<?> sources = link.getClients();
Object theSource = sources.size() == 1 ? sources.get(0) : null;
- if(false == theSource instanceof NamedElement) {
+ if (false == theSource instanceof NamedElement) {
continue;
}
- NamedElement src = (NamedElement)theSource;
+ NamedElement src = (NamedElement) theSource;
result.add(new UMLLinkDescriptor(src, target, link, UMLElementTypes.Deployment_4009, DeploymentEditPart.VISUAL_ID));
}
return result;
@@ -11412,20 +11602,20 @@ public class UMLDiagramUpdater implements DiagramUpdater {
protected Collection<UMLLinkDescriptor> getIncomingTypeModelFacetLinks_Dependency_4017(NamedElement target, CrossReferenceAdapter crossReferencer) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
Collection<EStructuralFeature.Setting> settings = crossReferencer.getInverseReferences(target);
- for(EStructuralFeature.Setting setting : settings) {
- if(setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getDependency_Supplier() || false == setting.getEObject() instanceof Dependency) {
+ for (EStructuralFeature.Setting setting : settings) {
+ if (setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getDependency_Supplier() || false == setting.getEObject() instanceof Dependency) {
continue;
}
- Dependency link = (Dependency)setting.getEObject();
- if(RoleBindingEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Dependency link = (Dependency) setting.getEObject();
+ if (RoleBindingEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List<?> sources = link.getClients();
Object theSource = sources.size() == 1 ? sources.get(0) : null;
- if(false == theSource instanceof NamedElement) {
+ if (false == theSource instanceof NamedElement) {
continue;
}
- NamedElement src = (NamedElement)theSource;
+ NamedElement src = (NamedElement) theSource;
result.add(new UMLLinkDescriptor(src, target, link, UMLElementTypes.Dependency_4017, RoleBindingEditPart.VISUAL_ID));
}
return result;
@@ -11437,20 +11627,20 @@ public class UMLDiagramUpdater implements DiagramUpdater {
protected Collection<UMLLinkDescriptor> getIncomingTypeModelFacetLinks_Dependency_4010(NamedElement target, CrossReferenceAdapter crossReferencer) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
Collection<EStructuralFeature.Setting> settings = crossReferencer.getInverseReferences(target);
- for(EStructuralFeature.Setting setting : settings) {
- if(setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getDependency_Supplier() || false == setting.getEObject() instanceof Dependency) {
+ for (EStructuralFeature.Setting setting : settings) {
+ if (setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getDependency_Supplier() || false == setting.getEObject() instanceof Dependency) {
continue;
}
- Dependency link = (Dependency)setting.getEObject();
- if(DependencyEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Dependency link = (Dependency) setting.getEObject();
+ if (DependencyEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List<?> sources = link.getClients();
Object theSource = sources.size() == 1 ? sources.get(0) : null;
- if(false == theSource instanceof NamedElement) {
+ if (false == theSource instanceof NamedElement) {
continue;
}
- NamedElement src = (NamedElement)theSource;
+ NamedElement src = (NamedElement) theSource;
result.add(new UMLLinkDescriptor(src, target, link, UMLElementTypes.Dependency_4010, DependencyEditPart.VISUAL_ID));
}
return result;
@@ -11462,12 +11652,12 @@ public class UMLDiagramUpdater implements DiagramUpdater {
protected Collection<UMLLinkDescriptor> getIncomingTypeModelFacetLinks_Generalization_4015(Classifier target, CrossReferenceAdapter crossReferencer) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
Collection<EStructuralFeature.Setting> settings = crossReferencer.getInverseReferences(target);
- for(EStructuralFeature.Setting setting : settings) {
- if(setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getGeneralization_General() || false == setting.getEObject() instanceof Generalization) {
+ for (EStructuralFeature.Setting setting : settings) {
+ if (setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getGeneralization_General() || false == setting.getEObject() instanceof Generalization) {
continue;
}
- Generalization link = (Generalization)setting.getEObject();
- if(GeneralizationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Generalization link = (Generalization) setting.getEObject();
+ if (GeneralizationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
Classifier src = link.getSpecific();
@@ -11482,8 +11672,8 @@ public class UMLDiagramUpdater implements DiagramUpdater {
protected Collection<UMLLinkDescriptor> getIncomingFeatureModelFacetLinks_TimeObservation_Event_4018(NamedElement target, CrossReferenceAdapter crossReferencer) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
Collection<EStructuralFeature.Setting> settings = crossReferencer.getInverseReferences(target);
- for(EStructuralFeature.Setting setting : settings) {
- if(setting.getEStructuralFeature() == UMLPackage.eINSTANCE.getTimeObservation_Event()) {
+ for (EStructuralFeature.Setting setting : settings) {
+ if (setting.getEStructuralFeature() == UMLPackage.eINSTANCE.getTimeObservation_Event()) {
result.add(new UMLLinkDescriptor(setting.getEObject(), target, UMLElementTypes.TimeObservationEvent_4018, TimeObservationEventEditPart.VISUAL_ID));
}
}
@@ -11496,8 +11686,8 @@ public class UMLDiagramUpdater implements DiagramUpdater {
protected Collection<UMLLinkDescriptor> getIncomingFeatureModelFacetLinks_DurationObservation_Event_4019(NamedElement target, CrossReferenceAdapter crossReferencer) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
Collection<EStructuralFeature.Setting> settings = crossReferencer.getInverseReferences(target);
- for(EStructuralFeature.Setting setting : settings) {
- if(setting.getEStructuralFeature() == UMLPackage.eINSTANCE.getDurationObservation_Event()) {
+ for (EStructuralFeature.Setting setting : settings) {
+ if (setting.getEStructuralFeature() == UMLPackage.eINSTANCE.getDurationObservation_Event()) {
result.add(new UMLLinkDescriptor(setting.getEObject(), target, UMLElementTypes.DurationObservationEvent_4019, DurationObservationEventEditPart.VISUAL_ID));
}
}
@@ -11510,8 +11700,8 @@ public class UMLDiagramUpdater implements DiagramUpdater {
protected Collection<UMLLinkDescriptor> getIncomingFeatureModelFacetLinks_InformationItem_Represented_4020(Classifier target, CrossReferenceAdapter crossReferencer) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
Collection<EStructuralFeature.Setting> settings = crossReferencer.getInverseReferences(target);
- for(EStructuralFeature.Setting setting : settings) {
- if(setting.getEStructuralFeature() == UMLPackage.eINSTANCE.getInformationItem_Represented()) {
+ for (EStructuralFeature.Setting setting : settings) {
+ if (setting.getEStructuralFeature() == UMLPackage.eINSTANCE.getInformationItem_Represented()) {
result.add(new UMLLinkDescriptor(setting.getEObject(), target, UMLElementTypes.InformationItemRepresented_4020, RepresentationEditPart.VISUAL_ID));
}
}
@@ -11524,20 +11714,20 @@ public class UMLDiagramUpdater implements DiagramUpdater {
protected Collection<UMLLinkDescriptor> getIncomingTypeModelFacetLinks_InformationFlow_4021(NamedElement target, CrossReferenceAdapter crossReferencer) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
Collection<EStructuralFeature.Setting> settings = crossReferencer.getInverseReferences(target);
- for(EStructuralFeature.Setting setting : settings) {
- if(setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getInformationFlow_InformationTarget() || false == setting.getEObject() instanceof InformationFlow) {
+ for (EStructuralFeature.Setting setting : settings) {
+ if (setting.getEStructuralFeature() != UMLPackage.eINSTANCE.getInformationFlow_InformationTarget() || false == setting.getEObject() instanceof InformationFlow) {
continue;
}
- InformationFlow link = (InformationFlow)setting.getEObject();
- if(InformationFlowEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ InformationFlow link = (InformationFlow) setting.getEObject();
+ if (InformationFlowEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List<?> sources = link.getInformationSources();
Object theSource = sources.size() == 1 ? sources.get(0) : null;
- if(false == theSource instanceof NamedElement) {
+ if (false == theSource instanceof NamedElement) {
continue;
}
- NamedElement src = (NamedElement)theSource;
+ NamedElement src = (NamedElement) theSource;
result.add(new UMLLinkDescriptor(src, target, link, UMLElementTypes.InformationFlow_4021, InformationFlowEditPart.VISUAL_ID));
}
return result;
@@ -11548,8 +11738,9 @@ public class UMLDiagramUpdater implements DiagramUpdater {
*/
protected Collection<UMLLinkDescriptor> getOutgoingFeatureModelFacetLinks_Comment_AnnotatedElement_4002(Comment source) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- for(Iterator<?> destinations = source.getAnnotatedElements().iterator(); destinations.hasNext();) {
- Element destination = (Element)destinations.next();
+ for (Iterator<?> destinations = source.getAnnotatedElements()
+ .iterator(); destinations.hasNext();) {
+ Element destination = (Element) destinations.next();
result.add(new UMLLinkDescriptor(source, destination, UMLElementTypes.CommentAnnotatedElement_4002, CommentAnnotatedElementEditPart.VISUAL_ID));
}
return result;
@@ -11560,8 +11751,9 @@ public class UMLDiagramUpdater implements DiagramUpdater {
*/
protected Collection<UMLLinkDescriptor> getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElement_4003(Constraint source) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- for(Iterator<?> destinations = source.getConstrainedElements().iterator(); destinations.hasNext();) {
- Element destination = (Element)destinations.next();
+ for (Iterator<?> destinations = source.getConstrainedElements()
+ .iterator(); destinations.hasNext();) {
+ Element destination = (Element) destinations.next();
result.add(new UMLLinkDescriptor(source, destination, UMLElementTypes.ConstraintConstrainedElement_4003, ConstraintConstrainedElementEditPart.VISUAL_ID));
}
return result;
@@ -11575,37 +11767,38 @@ public class UMLDiagramUpdater implements DiagramUpdater {
// Find container element for the link.
// Climb up by containment hierarchy starting from the source
// and return the first element that is instance of the container class.
- for(EObject element = source; element != null && container == null; element = element.eContainer()) {
- if(element instanceof Package) {
- container = (Package)element;
+ for (EObject element = source; element != null && container == null; element = element.eContainer()) {
+ if (element instanceof Package) {
+ container = (Package) element;
}
}
- if(container == null) {
+ if (container == null) {
return Collections.emptyList();
}
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- for(Iterator<?> links = container.getPackagedElements().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof ComponentRealization) {
+ for (Iterator<?> links = container.getPackagedElements()
+ .iterator(); links.hasNext();) {
+ EObject linkObject = (EObject) links.next();
+ if (false == linkObject instanceof ComponentRealization) {
continue;
}
- ComponentRealization link = (ComponentRealization)linkObject;
- if(ComponentRealizationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ ComponentRealization link = (ComponentRealization) linkObject;
+ if (ComponentRealizationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List<?> targets = link.getSuppliers();
Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof NamedElement) {
+ if (false == theTarget instanceof NamedElement) {
continue;
}
- NamedElement dst = (NamedElement)theTarget;
+ NamedElement dst = (NamedElement) theTarget;
List<?> sources = link.getClients();
Object theSource = sources.size() == 1 ? sources.get(0) : null;
- if(false == theSource instanceof NamedElement) {
+ if (false == theSource instanceof NamedElement) {
continue;
}
- NamedElement src = (NamedElement)theSource;
- if(src != source) {
+ NamedElement src = (NamedElement) theSource;
+ if (src != source) {
continue;
}
result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.ComponentRealization_4004, ComponentRealizationEditPart.VISUAL_ID));
@@ -11621,37 +11814,38 @@ public class UMLDiagramUpdater implements DiagramUpdater {
// Find container element for the link.
// Climb up by containment hierarchy starting from the source
// and return the first element that is instance of the container class.
- for(EObject element = source; element != null && container == null; element = element.eContainer()) {
- if(element instanceof Package) {
- container = (Package)element;
+ for (EObject element = source; element != null && container == null; element = element.eContainer()) {
+ if (element instanceof Package) {
+ container = (Package) element;
}
}
- if(container == null) {
+ if (container == null) {
return Collections.emptyList();
}
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- for(Iterator<?> links = container.getPackagedElements().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof InterfaceRealization) {
+ for (Iterator<?> links = container.getPackagedElements()
+ .iterator(); links.hasNext();) {
+ EObject linkObject = (EObject) links.next();
+ if (false == linkObject instanceof InterfaceRealization) {
continue;
}
- InterfaceRealization link = (InterfaceRealization)linkObject;
- if(InterfaceRealizationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ InterfaceRealization link = (InterfaceRealization) linkObject;
+ if (InterfaceRealizationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List<?> targets = link.getSuppliers();
Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof NamedElement) {
+ if (false == theTarget instanceof NamedElement) {
continue;
}
- NamedElement dst = (NamedElement)theTarget;
+ NamedElement dst = (NamedElement) theTarget;
List<?> sources = link.getClients();
Object theSource = sources.size() == 1 ? sources.get(0) : null;
- if(false == theSource instanceof NamedElement) {
+ if (false == theSource instanceof NamedElement) {
continue;
}
- NamedElement src = (NamedElement)theSource;
- if(src != source) {
+ NamedElement src = (NamedElement) theSource;
+ if (src != source) {
continue;
}
result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.InterfaceRealization_4005, InterfaceRealizationEditPart.VISUAL_ID));
@@ -11667,37 +11861,38 @@ public class UMLDiagramUpdater implements DiagramUpdater {
// Find container element for the link.
// Climb up by containment hierarchy starting from the source
// and return the first element that is instance of the container class.
- for(EObject element = source; element != null && container == null; element = element.eContainer()) {
- if(element instanceof Package) {
- container = (Package)element;
+ for (EObject element = source; element != null && container == null; element = element.eContainer()) {
+ if (element instanceof Package) {
+ container = (Package) element;
}
}
- if(container == null) {
+ if (container == null) {
return Collections.emptyList();
}
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- for(Iterator<?> links = container.getPackagedElements().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Substitution) {
+ for (Iterator<?> links = container.getPackagedElements()
+ .iterator(); links.hasNext();) {
+ EObject linkObject = (EObject) links.next();
+ if (false == linkObject instanceof Substitution) {
continue;
}
- Substitution link = (Substitution)linkObject;
- if(SubstitutionEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Substitution link = (Substitution) linkObject;
+ if (SubstitutionEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List<?> targets = link.getSuppliers();
Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof NamedElement) {
+ if (false == theTarget instanceof NamedElement) {
continue;
}
- NamedElement dst = (NamedElement)theTarget;
+ NamedElement dst = (NamedElement) theTarget;
List<?> sources = link.getClients();
Object theSource = sources.size() == 1 ? sources.get(0) : null;
- if(false == theSource instanceof NamedElement) {
+ if (false == theSource instanceof NamedElement) {
continue;
}
- NamedElement src = (NamedElement)theSource;
- if(src != source) {
+ NamedElement src = (NamedElement) theSource;
+ if (src != source) {
continue;
}
result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Substitution_4011, SubstitutionEditPart.VISUAL_ID));
@@ -11713,37 +11908,38 @@ public class UMLDiagramUpdater implements DiagramUpdater {
// Find container element for the link.
// Climb up by containment hierarchy starting from the source
// and return the first element that is instance of the container class.
- for(EObject element = source; element != null && container == null; element = element.eContainer()) {
- if(element instanceof Package) {
- container = (Package)element;
+ for (EObject element = source; element != null && container == null; element = element.eContainer()) {
+ if (element instanceof Package) {
+ container = (Package) element;
}
}
- if(container == null) {
+ if (container == null) {
return Collections.emptyList();
}
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- for(Iterator<?> links = container.getPackagedElements().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Realization) {
+ for (Iterator<?> links = container.getPackagedElements()
+ .iterator(); links.hasNext();) {
+ EObject linkObject = (EObject) links.next();
+ if (false == linkObject instanceof Realization) {
continue;
}
- Realization link = (Realization)linkObject;
- if(RealizationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Realization link = (Realization) linkObject;
+ if (RealizationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List<?> targets = link.getSuppliers();
Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof NamedElement) {
+ if (false == theTarget instanceof NamedElement) {
continue;
}
- NamedElement dst = (NamedElement)theTarget;
+ NamedElement dst = (NamedElement) theTarget;
List<?> sources = link.getClients();
Object theSource = sources.size() == 1 ? sources.get(0) : null;
- if(false == theSource instanceof NamedElement) {
+ if (false == theSource instanceof NamedElement) {
continue;
}
- NamedElement src = (NamedElement)theSource;
- if(src != source) {
+ NamedElement src = (NamedElement) theSource;
+ if (src != source) {
continue;
}
result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Realization_4006, RealizationEditPart.VISUAL_ID));
@@ -11759,37 +11955,38 @@ public class UMLDiagramUpdater implements DiagramUpdater {
// Find container element for the link.
// Climb up by containment hierarchy starting from the source
// and return the first element that is instance of the container class.
- for(EObject element = source; element != null && container == null; element = element.eContainer()) {
- if(element instanceof Package) {
- container = (Package)element;
+ for (EObject element = source; element != null && container == null; element = element.eContainer()) {
+ if (element instanceof Package) {
+ container = (Package) element;
}
}
- if(container == null) {
+ if (container == null) {
return Collections.emptyList();
}
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- for(Iterator<?> links = container.getPackagedElements().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Manifestation) {
+ for (Iterator<?> links = container.getPackagedElements()
+ .iterator(); links.hasNext();) {
+ EObject linkObject = (EObject) links.next();
+ if (false == linkObject instanceof Manifestation) {
continue;
}
- Manifestation link = (Manifestation)linkObject;
- if(ManifestationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Manifestation link = (Manifestation) linkObject;
+ if (ManifestationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List<?> targets = link.getSuppliers();
Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof NamedElement) {
+ if (false == theTarget instanceof NamedElement) {
continue;
}
- NamedElement dst = (NamedElement)theTarget;
+ NamedElement dst = (NamedElement) theTarget;
List<?> sources = link.getClients();
Object theSource = sources.size() == 1 ? sources.get(0) : null;
- if(false == theSource instanceof NamedElement) {
+ if (false == theSource instanceof NamedElement) {
continue;
}
- NamedElement src = (NamedElement)theSource;
- if(src != source) {
+ NamedElement src = (NamedElement) theSource;
+ if (src != source) {
continue;
}
result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Manifestation_4012, ManifestationEditPart.VISUAL_ID));
@@ -11805,37 +12002,38 @@ public class UMLDiagramUpdater implements DiagramUpdater {
// Find container element for the link.
// Climb up by containment hierarchy starting from the source
// and return the first element that is instance of the container class.
- for(EObject element = source; element != null && container == null; element = element.eContainer()) {
- if(element instanceof Package) {
- container = (Package)element;
+ for (EObject element = source; element != null && container == null; element = element.eContainer()) {
+ if (element instanceof Package) {
+ container = (Package) element;
}
}
- if(container == null) {
+ if (container == null) {
return Collections.emptyList();
}
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- for(Iterator<?> links = container.getPackagedElements().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Abstraction) {
+ for (Iterator<?> links = container.getPackagedElements()
+ .iterator(); links.hasNext();) {
+ EObject linkObject = (EObject) links.next();
+ if (false == linkObject instanceof Abstraction) {
continue;
}
- Abstraction link = (Abstraction)linkObject;
- if(AbstractionEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Abstraction link = (Abstraction) linkObject;
+ if (AbstractionEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List<?> targets = link.getSuppliers();
Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof NamedElement) {
+ if (false == theTarget instanceof NamedElement) {
continue;
}
- NamedElement dst = (NamedElement)theTarget;
+ NamedElement dst = (NamedElement) theTarget;
List<?> sources = link.getClients();
Object theSource = sources.size() == 1 ? sources.get(0) : null;
- if(false == theSource instanceof NamedElement) {
+ if (false == theSource instanceof NamedElement) {
continue;
}
- NamedElement src = (NamedElement)theSource;
- if(src != source) {
+ NamedElement src = (NamedElement) theSource;
+ if (src != source) {
continue;
}
result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Abstraction_4007, AbstractionEditPart.VISUAL_ID));
@@ -11851,37 +12049,38 @@ public class UMLDiagramUpdater implements DiagramUpdater {
// Find container element for the link.
// Climb up by containment hierarchy starting from the source
// and return the first element that is instance of the container class.
- for(EObject element = source; element != null && container == null; element = element.eContainer()) {
- if(element instanceof Package) {
- container = (Package)element;
+ for (EObject element = source; element != null && container == null; element = element.eContainer()) {
+ if (element instanceof Package) {
+ container = (Package) element;
}
}
- if(container == null) {
+ if (container == null) {
return Collections.emptyList();
}
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- for(Iterator<?> links = container.getPackagedElements().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Usage) {
+ for (Iterator<?> links = container.getPackagedElements()
+ .iterator(); links.hasNext();) {
+ EObject linkObject = (EObject) links.next();
+ if (false == linkObject instanceof Usage) {
continue;
}
- Usage link = (Usage)linkObject;
- if(UsageEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Usage link = (Usage) linkObject;
+ if (UsageEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List<?> targets = link.getSuppliers();
Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof NamedElement) {
+ if (false == theTarget instanceof NamedElement) {
continue;
}
- NamedElement dst = (NamedElement)theTarget;
+ NamedElement dst = (NamedElement) theTarget;
List<?> sources = link.getClients();
Object theSource = sources.size() == 1 ? sources.get(0) : null;
- if(false == theSource instanceof NamedElement) {
+ if (false == theSource instanceof NamedElement) {
continue;
}
- NamedElement src = (NamedElement)theSource;
- if(src != source) {
+ NamedElement src = (NamedElement) theSource;
+ if (src != source) {
continue;
}
result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Usage_4008, UsageEditPart.VISUAL_ID));
@@ -11897,37 +12096,38 @@ public class UMLDiagramUpdater implements DiagramUpdater {
// Find container element for the link.
// Climb up by containment hierarchy starting from the source
// and return the first element that is instance of the container class.
- for(EObject element = source; element != null && container == null; element = element.eContainer()) {
- if(element instanceof Package) {
- container = (Package)element;
+ for (EObject element = source; element != null && container == null; element = element.eContainer()) {
+ if (element instanceof Package) {
+ container = (Package) element;
}
}
- if(container == null) {
+ if (container == null) {
return Collections.emptyList();
}
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- for(Iterator<?> links = container.getPackagedElements().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Deployment) {
+ for (Iterator<?> links = container.getPackagedElements()
+ .iterator(); links.hasNext();) {
+ EObject linkObject = (EObject) links.next();
+ if (false == linkObject instanceof Deployment) {
continue;
}
- Deployment link = (Deployment)linkObject;
- if(DeploymentEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Deployment link = (Deployment) linkObject;
+ if (DeploymentEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List<?> targets = link.getSuppliers();
Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof NamedElement) {
+ if (false == theTarget instanceof NamedElement) {
continue;
}
- NamedElement dst = (NamedElement)theTarget;
+ NamedElement dst = (NamedElement) theTarget;
List<?> sources = link.getClients();
Object theSource = sources.size() == 1 ? sources.get(0) : null;
- if(false == theSource instanceof NamedElement) {
+ if (false == theSource instanceof NamedElement) {
continue;
}
- NamedElement src = (NamedElement)theSource;
- if(src != source) {
+ NamedElement src = (NamedElement) theSource;
+ if (src != source) {
continue;
}
result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Deployment_4009, DeploymentEditPart.VISUAL_ID));
@@ -11943,37 +12143,38 @@ public class UMLDiagramUpdater implements DiagramUpdater {
// Find container element for the link.
// Climb up by containment hierarchy starting from the source
// and return the first element that is instance of the container class.
- for(EObject element = source; element != null && container == null; element = element.eContainer()) {
- if(element instanceof Package) {
- container = (Package)element;
+ for (EObject element = source; element != null && container == null; element = element.eContainer()) {
+ if (element instanceof Package) {
+ container = (Package) element;
}
}
- if(container == null) {
+ if (container == null) {
return Collections.emptyList();
}
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- for(Iterator<?> links = container.getPackagedElements().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Dependency) {
+ for (Iterator<?> links = container.getPackagedElements()
+ .iterator(); links.hasNext();) {
+ EObject linkObject = (EObject) links.next();
+ if (false == linkObject instanceof Dependency) {
continue;
}
- Dependency link = (Dependency)linkObject;
- if(RoleBindingEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Dependency link = (Dependency) linkObject;
+ if (RoleBindingEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List<?> targets = link.getSuppliers();
Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof NamedElement) {
+ if (false == theTarget instanceof NamedElement) {
continue;
}
- NamedElement dst = (NamedElement)theTarget;
+ NamedElement dst = (NamedElement) theTarget;
List<?> sources = link.getClients();
Object theSource = sources.size() == 1 ? sources.get(0) : null;
- if(false == theSource instanceof NamedElement) {
+ if (false == theSource instanceof NamedElement) {
continue;
}
- NamedElement src = (NamedElement)theSource;
- if(src != source) {
+ NamedElement src = (NamedElement) theSource;
+ if (src != source) {
continue;
}
result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Dependency_4017, RoleBindingEditPart.VISUAL_ID));
@@ -11989,37 +12190,38 @@ public class UMLDiagramUpdater implements DiagramUpdater {
// Find container element for the link.
// Climb up by containment hierarchy starting from the source
// and return the first element that is instance of the container class.
- for(EObject element = source; element != null && container == null; element = element.eContainer()) {
- if(element instanceof Package) {
- container = (Package)element;
+ for (EObject element = source; element != null && container == null; element = element.eContainer()) {
+ if (element instanceof Package) {
+ container = (Package) element;
}
}
- if(container == null) {
+ if (container == null) {
return Collections.emptyList();
}
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- for(Iterator<?> links = container.getPackagedElements().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Dependency) {
+ for (Iterator<?> links = container.getPackagedElements()
+ .iterator(); links.hasNext();) {
+ EObject linkObject = (EObject) links.next();
+ if (false == linkObject instanceof Dependency) {
continue;
}
- Dependency link = (Dependency)linkObject;
- if(DependencyEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Dependency link = (Dependency) linkObject;
+ if (DependencyEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List<?> targets = link.getSuppliers();
Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof NamedElement) {
+ if (false == theTarget instanceof NamedElement) {
continue;
}
- NamedElement dst = (NamedElement)theTarget;
+ NamedElement dst = (NamedElement) theTarget;
List<?> sources = link.getClients();
Object theSource = sources.size() == 1 ? sources.get(0) : null;
- if(false == theSource instanceof NamedElement) {
+ if (false == theSource instanceof NamedElement) {
continue;
}
- NamedElement src = (NamedElement)theSource;
- if(src != source) {
+ NamedElement src = (NamedElement) theSource;
+ if (src != source) {
continue;
}
result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Dependency_4010, DependencyEditPart.VISUAL_ID));
@@ -12035,27 +12237,28 @@ public class UMLDiagramUpdater implements DiagramUpdater {
// Find container element for the link.
// Climb up by containment hierarchy starting from the source
// and return the first element that is instance of the container class.
- for(EObject element = source; element != null && container == null; element = element.eContainer()) {
- if(element instanceof Classifier) {
- container = (Classifier)element;
+ for (EObject element = source; element != null && container == null; element = element.eContainer()) {
+ if (element instanceof Classifier) {
+ container = (Classifier) element;
}
}
- if(container == null) {
+ if (container == null) {
return Collections.emptyList();
}
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- for(Iterator<?> links = container.getGeneralizations().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Generalization) {
+ for (Iterator<?> links = container.getGeneralizations()
+ .iterator(); links.hasNext();) {
+ EObject linkObject = (EObject) links.next();
+ if (false == linkObject instanceof Generalization) {
continue;
}
- Generalization link = (Generalization)linkObject;
- if(GeneralizationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ Generalization link = (Generalization) linkObject;
+ if (GeneralizationEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
Classifier dst = link.getGeneral();
Classifier src = link.getSpecific();
- if(src != source) {
+ if (src != source) {
continue;
}
result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Generalization_4015, GeneralizationEditPart.VISUAL_ID));
@@ -12069,7 +12272,7 @@ public class UMLDiagramUpdater implements DiagramUpdater {
protected Collection<UMLLinkDescriptor> getOutgoingFeatureModelFacetLinks_TimeObservation_Event_4018(TimeObservation source) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
NamedElement destination = source.getEvent();
- if(destination == null) {
+ if (destination == null) {
return result;
}
result.add(new UMLLinkDescriptor(source, destination, UMLElementTypes.TimeObservationEvent_4018, TimeObservationEventEditPart.VISUAL_ID));
@@ -12081,8 +12284,9 @@ public class UMLDiagramUpdater implements DiagramUpdater {
*/
protected Collection<UMLLinkDescriptor> getOutgoingFeatureModelFacetLinks_DurationObservation_Event_4019(DurationObservation source) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- for(Iterator<?> destinations = source.getEvents().iterator(); destinations.hasNext();) {
- NamedElement destination = (NamedElement)destinations.next();
+ for (Iterator<?> destinations = source.getEvents()
+ .iterator(); destinations.hasNext();) {
+ NamedElement destination = (NamedElement) destinations.next();
result.add(new UMLLinkDescriptor(source, destination, UMLElementTypes.DurationObservationEvent_4019, DurationObservationEventEditPart.VISUAL_ID));
}
return result;
@@ -12093,8 +12297,9 @@ public class UMLDiagramUpdater implements DiagramUpdater {
*/
protected Collection<UMLLinkDescriptor> getOutgoingFeatureModelFacetLinks_InformationItem_Represented_4020(InformationItem source) {
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- for(Iterator<?> destinations = source.getRepresenteds().iterator(); destinations.hasNext();) {
- Classifier destination = (Classifier)destinations.next();
+ for (Iterator<?> destinations = source.getRepresenteds()
+ .iterator(); destinations.hasNext();) {
+ Classifier destination = (Classifier) destinations.next();
result.add(new UMLLinkDescriptor(source, destination, UMLElementTypes.InformationItemRepresented_4020, RepresentationEditPart.VISUAL_ID));
}
return result;
@@ -12108,37 +12313,38 @@ public class UMLDiagramUpdater implements DiagramUpdater {
// Find container element for the link.
// Climb up by containment hierarchy starting from the source
// and return the first element that is instance of the container class.
- for(EObject element = source; element != null && container == null; element = element.eContainer()) {
- if(element instanceof Package) {
- container = (Package)element;
+ for (EObject element = source; element != null && container == null; element = element.eContainer()) {
+ if (element instanceof Package) {
+ container = (Package) element;
}
}
- if(container == null) {
+ if (container == null) {
return Collections.emptyList();
}
LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- for(Iterator<?> links = container.getPackagedElements().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof InformationFlow) {
+ for (Iterator<?> links = container.getPackagedElements()
+ .iterator(); links.hasNext();) {
+ EObject linkObject = (EObject) links.next();
+ if (false == linkObject instanceof InformationFlow) {
continue;
}
- InformationFlow link = (InformationFlow)linkObject;
- if(InformationFlowEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
+ InformationFlow link = (InformationFlow) linkObject;
+ if (InformationFlowEditPart.VISUAL_ID != UMLVisualIDRegistry.getLinkWithClassVisualID(link)) {
continue;
}
List<?> targets = link.getInformationTargets();
Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if(false == theTarget instanceof NamedElement) {
+ if (false == theTarget instanceof NamedElement) {
continue;
}
- NamedElement dst = (NamedElement)theTarget;
+ NamedElement dst = (NamedElement) theTarget;
List<?> sources = link.getInformationSources();
Object theSource = sources.size() == 1 ? sources.get(0) : null;
- if(false == theSource instanceof NamedElement) {
+ if (false == theSource instanceof NamedElement) {
continue;
}
- NamedElement src = (NamedElement)theSource;
- if(src != source) {
+ NamedElement src = (NamedElement) theSource;
+ if (src != source) {
continue;
}
result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.InformationFlow_4021, InformationFlowEditPart.VISUAL_ID));
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLDocumentProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLDocumentProvider.java
index cd62145d240..505b96e7638 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLDocumentProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLDocumentProvider.java
@@ -74,12 +74,16 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
* @generated
*/
protected ElementInfo createElementInfo(Object element) throws CoreException {
- if(false == element instanceof FileEditorInput && false == element instanceof URIEditorInput) {
- throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, 0, NLS.bind(Messages.UMLDocumentProvider_IncorrectInputError, new Object[]{ element, "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
- null));
+ if (false == element instanceof FileEditorInput && false == element instanceof URIEditorInput) {
+ throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, 0,
+ NLS.bind(
+ Messages.UMLDocumentProvider_IncorrectInputError,
+ new Object[] { element, "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
+ null));
}
- IEditorInput editorInput = (IEditorInput)element;
- IDiagramDocument document = (IDiagramDocument)createDocument(editorInput);
+ IEditorInput editorInput = (IEditorInput) element;
+ IDiagramDocument document = (IDiagramDocument) createDocument(editorInput);
+
ResourceSetInfo info = new ResourceSetInfo(document, editorInput);
info.setModificationStamp(computeModificationStamp(info));
info.fStatus = null;
@@ -90,12 +94,15 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
* @generated
*/
protected IDocument createDocument(Object element) throws CoreException {
- if(false == element instanceof FileEditorInput && false == element instanceof URIEditorInput) {
- throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, 0, NLS.bind(Messages.UMLDocumentProvider_IncorrectInputError, new Object[]{ element, "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
- null));
+ if (false == element instanceof FileEditorInput && false == element instanceof URIEditorInput) {
+ throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, 0,
+ NLS.bind(
+ Messages.UMLDocumentProvider_IncorrectInputError,
+ new Object[] { element, "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
+ null));
}
IDocument document = createEmptyDocument();
- setDocumentContent(document, (IEditorInput)element);
+ setDocumentContent(document, (IEditorInput) element);
setupDocument(element, document);
return document;
}
@@ -105,8 +112,10 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
* 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
+ * @param element
+ * the blue-print element
+ * @param document
+ * the document to set up
* @generated
*/
protected void setupDocument(Object element, IDocument document) {
@@ -118,11 +127,11 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
*/
private long computeModificationStamp(ResourceSetInfo info) {
int result = 0;
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
+ for (Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
Resource nextResource = it.next();
IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if(file != null) {
- if(file.getLocation() != null) {
+ if (file != null) {
+ if (file.getLocation() != null) {
result += file.getLocation().toFile().lastModified();
} else {
result += file.getModificationStamp();
@@ -147,7 +156,8 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
private TransactionalEditingDomain createEditingDomain() {
TransactionalEditingDomain editingDomain = DiagramEditingDomainFactory.getInstance().createEditingDomain();
editingDomain.setID("org.eclipse.papyrus.uml.diagram.composite.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));
+ 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;
@@ -164,10 +174,10 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
@Override
public void notifyChanged(Notification notification) {
- if(diagramResourceModifiedFilter.matches(notification)) {
+ if (diagramResourceModifiedFilter.matches(notification)) {
Object value = notification.getNewValue();
- if(value instanceof Resource) {
- ((Resource)value).setTrackingModification(true);
+ if (value instanceof Resource) {
+ ((Resource) value).setTrackingModification(true);
}
}
}
@@ -176,7 +186,9 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
public void setTarget(Notifier newTarget) {
myTarger = newTarget;
}
+
});
+
return editingDomain;
}
@@ -184,25 +196,25 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
* @generated
*/
protected void setDocumentContent(IDocument document, IEditorInput element) throws CoreException {
- IDiagramDocument diagramDocument = (IDiagramDocument)document;
+ IDiagramDocument diagramDocument = (IDiagramDocument) document;
TransactionalEditingDomain domain = diagramDocument.getEditingDomain();
- if(element instanceof FileEditorInput) {
- IStorage storage = ((FileEditorInput)element).getStorage();
+ 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();
+ } else if (element instanceof URIEditorInput) {
+ URI uri = ((URIEditorInput) element).getURI();
Resource resource = null;
try {
resource = domain.getResourceSet().getResource(uri.trimFragment(), false);
- if(resource == null) {
+ if (resource == null) {
resource = domain.getResourceSet().createResource(uri.trimFragment());
}
- if(!resource.isLoaded()) {
+ if (!resource.isLoaded()) {
try {
@SuppressWarnings({ "rawtypes", "unchecked" })
Map<?, ?> options = new HashMap(GMFResourceFactory.getDefaultLoadOptions());
- // @see 171060
+ // @see 171060
// options.put(org.eclipse.emf.ecore.xmi.XMLResource.OPTION_RECORD_UNKNOWN_FEATURE, Boolean.TRUE);
resource.load(options);
} catch (IOException e) {
@@ -210,16 +222,16 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
throw e;
}
}
- if(uri.fragment() != null) {
+ if (uri.fragment() != null) {
EObject rootElement = resource.getEObject(uri.fragment());
- if(rootElement instanceof Diagram) {
+ if (rootElement instanceof Diagram) {
document.setContent(rootElement);
return;
}
} else {
- for(Iterator<EObject> it = resource.getContents().iterator(); it.hasNext();) {
+ for (Iterator<EObject> it = resource.getContents().iterator(); it.hasNext();) {
Object rootElement = it.next();
- if(rootElement instanceof Diagram) {
+ if (rootElement instanceof Diagram) {
document.setContent(rootElement);
return;
}
@@ -228,17 +240,21 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
throw new RuntimeException(Messages.UMLDocumentProvider_NoDiagramInResourceError);
} catch (Exception e) {
CoreException thrownExcp = null;
- if(e instanceof CoreException) {
- thrownExcp = (CoreException)e;
+ if (e instanceof CoreException) {
+ thrownExcp = (CoreException) e;
} else {
String msg = e.getLocalizedMessage();
- thrownExcp = new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, 0, msg != null ? msg : Messages.UMLDocumentProvider_DiagramLoadingError, e));
+ thrownExcp = new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, 0,
+ msg != null ? msg : Messages.UMLDocumentProvider_DiagramLoadingError, e));
}
throw thrownExcp;
}
} else {
- throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, 0, NLS.bind(Messages.UMLDocumentProvider_IncorrectInputError, new Object[]{ element, "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
- null));
+ throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, 0,
+ NLS.bind(
+ Messages.UMLDocumentProvider_IncorrectInputError,
+ new Object[] { element, "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
+ null));
}
}
@@ -247,7 +263,7 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
*/
public long getModificationStamp(Object element) {
ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
+ if (info != null) {
return computeModificationStamp(info);
}
return super.getModificationStamp(element);
@@ -258,9 +274,9 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
*/
public boolean isDeleted(Object element) {
IDiagramDocument document = getDiagramDocument(element);
- if(document != null) {
+ if (document != null) {
Resource diagramResource = document.getDiagram().eResource();
- if(diagramResource != null) {
+ if (diagramResource != null) {
IFile file = WorkspaceSynchronizer.getFile(diagramResource);
return file == null || file.getLocation() == null || !file.getLocation().toFile().exists();
}
@@ -272,15 +288,15 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
* @generated
*/
public ResourceSetInfo getResourceSetInfo(Object editorInput) {
- return (ResourceSetInfo)super.getElementInfo(editorInput);
+ return (ResourceSetInfo) super.getElementInfo(editorInput);
}
/**
* @generated
*/
protected void disposeElementInfo(Object element, ElementInfo info) {
- if(info instanceof ResourceSetInfo) {
- ResourceSetInfo resourceSetInfo = (ResourceSetInfo)info;
+ if (info instanceof ResourceSetInfo) {
+ ResourceSetInfo resourceSetInfo = (ResourceSetInfo) info;
resourceSetInfo.dispose();
}
super.disposeElementInfo(element, info);
@@ -291,17 +307,18 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
*/
protected void doValidateState(Object element, Object computationContext) throws CoreException {
ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
+ if (info != null) {
LinkedList<IFile> files2Validate = new LinkedList<IFile>();
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
+ for (Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
Resource nextResource = it.next();
IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if(file != null && file.isReadOnly()) {
+ if (file != null && file.isReadOnly()) {
files2Validate.add(file);
}
}
ResourcesPlugin.getWorkspace().validateEdit(files2Validate.toArray(new IFile[files2Validate.size()]), computationContext);
}
+
super.doValidateState(element, computationContext);
}
@@ -310,8 +327,8 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
*/
public boolean isReadOnly(Object element) {
ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- if(info.isUpdateCache()) {
+ if (info != null) {
+ if (info.isUpdateCache()) {
try {
updateCache(element);
} catch (CoreException ex) {
@@ -328,14 +345,14 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
* @generated
*/
public boolean isModifiable(Object element) {
- if(!isStateValidated(element)) {
- if(element instanceof FileEditorInput || element instanceof URIEditorInput) {
+ if (!isStateValidated(element)) {
+ if (element instanceof FileEditorInput || element instanceof URIEditorInput) {
return true;
}
}
ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- if(info.isUpdateCache()) {
+ if (info != null) {
+ if (info.isUpdateCache()) {
try {
updateCache(element);
} catch (CoreException ex) {
@@ -353,11 +370,11 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
*/
protected void updateCache(Object element) throws CoreException {
ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
+ 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()) {
+ if (file != null && file.isReadOnly()) {
info.setReadOnly(true);
info.setModifiable(false);
return;
@@ -374,7 +391,7 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
*/
protected void doUpdateStateCache(Object element) throws CoreException {
ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
+ if (info != null) {
info.setUpdateCache(true);
}
super.doUpdateStateCache(element);
@@ -385,7 +402,7 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
*/
public boolean isSynchronized(Object element) {
ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
+ if (info != null) {
return info.isSynchronized();
}
return super.isSynchronized(element);
@@ -396,12 +413,12 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
*/
protected ISchedulingRule getResetRule(Object element) {
ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
+ if (info != null) {
LinkedList<ISchedulingRule> rules = new LinkedList<ISchedulingRule>();
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
+ for (Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
Resource nextResource = it.next();
IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if(file != null) {
+ if (file != null) {
rules.add(ResourcesPlugin.getWorkspace().getRuleFactory().modifyRule(file));
}
}
@@ -415,12 +432,12 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
*/
protected ISchedulingRule getSaveRule(Object element) {
ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
+ if (info != null) {
LinkedList<ISchedulingRule> rules = new LinkedList<ISchedulingRule>();
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
+ for (Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
Resource nextResource = it.next();
IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if(file != null) {
+ if (file != null) {
rules.add(computeSchedulingRule(file));
}
}
@@ -434,12 +451,12 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
*/
protected ISchedulingRule getSynchronizeRule(Object element) {
ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
+ if (info != null) {
LinkedList<ISchedulingRule> rules = new LinkedList<ISchedulingRule>();
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
+ for (Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
Resource nextResource = it.next();
IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if(file != null) {
+ if (file != null) {
rules.add(ResourcesPlugin.getWorkspace().getRuleFactory().refreshRule(file));
}
}
@@ -453,12 +470,12 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
*/
protected ISchedulingRule getValidateStateRule(Object element) {
ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
+ if (info != null) {
LinkedList<ISchedulingRule> files = new LinkedList<ISchedulingRule>();
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
+ for (Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
Resource nextResource = it.next();
IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if(file != null) {
+ if (file != null) {
files.add(file);
}
}
@@ -471,7 +488,7 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
* @generated
*/
private ISchedulingRule computeSchedulingRule(IResource toCreateOrModify) {
- if(toCreateOrModify.exists()) {
+ if (toCreateOrModify.exists()) {
return ResourcesPlugin.getWorkspace().getRuleFactory().modifyRule(toCreateOrModify);
}
IResource parent = toCreateOrModify;
@@ -484,7 +501,8 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
*/
toCreateOrModify = parent;
parent = toCreateOrModify.getParent();
- } while(parent != null && !parent.exists());
+ } while (parent != null && !parent.exists());
+
return ResourcesPlugin.getWorkspace().getRuleFactory().createRule(toCreateOrModify);
}
@@ -493,8 +511,8 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
*/
protected void doSynchronize(Object element, IProgressMonitor monitor) throws CoreException {
ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
+ if (info != null) {
+ for (Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
Resource nextResource = it.next();
handleElementChanged(info, nextResource, monitor);
}
@@ -508,18 +526,23 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
*/
protected void doSaveDocument(IProgressMonitor monitor, Object element, IDocument document, boolean overwrite) throws CoreException {
ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- if(!overwrite && !info.isSynchronized()) {
- throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, IResourceStatus.OUT_OF_SYNC_LOCAL, Messages.UMLDocumentProvider_UnsynchronizedFileSaveError, null));
+ if (info != null) {
+ if (!overwrite && !info.isSynchronized()) {
+ throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID,
+ IResourceStatus.OUT_OF_SYNC_LOCAL,
+ Messages.UMLDocumentProvider_UnsynchronizedFileSaveError,
+ null));
}
info.stopResourceListening();
fireElementStateChanging(element);
try {
- monitor.beginTask(Messages.UMLDocumentProvider_SaveDiagramTask, info.getResourceSet().getResources().size() + 1); //"Saving diagram"
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
+ monitor.beginTask(Messages.UMLDocumentProvider_SaveDiagramTask, info.getResourceSet().getResources().size() + 1); // "Saving diagram"
+ for (Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
Resource nextResource = it.next();
- monitor.setTaskName(NLS.bind(Messages.UMLDocumentProvider_SaveNextResourceTask, nextResource.getURI()));
- if(nextResource.isLoaded() && !info.getEditingDomain().isReadOnly(nextResource)) {
+ monitor.setTaskName(NLS.bind(
+ Messages.UMLDocumentProvider_SaveNextResourceTask,
+ nextResource.getURI()));
+ if (nextResource.isLoaded() && !info.getEditingDomain().isReadOnly(nextResource)) {
try {
nextResource.save(UMLDiagramEditorUtil.getSaveOptions());
} catch (IOException e) {
@@ -540,27 +563,30 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
} else {
URI newResoruceURI;
List<IFile> affectedFiles = null;
- if(element instanceof FileEditorInput) {
- IFile newFile = ((FileEditorInput)element).getFile();
+ 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 if (element instanceof URIEditorInput) {
+ newResoruceURI = ((URIEditorInput) element).getURI();
} else {
fireElementStateChangeFailed(element);
- throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, 0, NLS.bind(Messages.UMLDocumentProvider_IncorrectInputError, new Object[]{ element, "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
- null));
+ throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, 0,
+ NLS.bind(
+ Messages.UMLDocumentProvider_IncorrectInputError,
+ new Object[] { element, "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
+ null));
}
- if(false == document instanceof IDiagramDocument) {
+ if (false == document instanceof IDiagramDocument) {
fireElementStateChangeFailed(element);
- throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, 0, "Incorrect document used: " + document + " instead of org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocument", null)); //$NON-NLS-1$ //$NON-NLS-2$
+ throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, 0,
+ "Incorrect document used: " + document + " instead of org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocument", null)); //$NON-NLS-1$ //$NON-NLS-2$
}
- IDiagramDocument diagramDocument = (IDiagramDocument)document;
+ IDiagramDocument diagramDocument = (IDiagramDocument) document;
final Resource newResource = diagramDocument.getEditingDomain().getResourceSet().createResource(newResoruceURI);
final Diagram diagramCopy = EcoreUtil.copy(diagramDocument.getDiagram());
try {
new AbstractTransactionalCommand(diagramDocument.getEditingDomain(), NLS.bind(Messages.UMLDocumentProvider_SaveAsOperation, diagramCopy.getName()), affectedFiles) {
-
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
newResource.getContents().add(diagramCopy);
@@ -584,7 +610,7 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
*/
protected void handleElementChanged(ResourceSetInfo info, Resource changedResource, IProgressMonitor monitor) {
IFile file = WorkspaceSynchronizer.getFile(changedResource);
- if(file != null) {
+ if (file != null) {
try {
file.refreshLocal(IResource.DEPTH_INFINITE, monitor);
} catch (CoreException ex) {
@@ -593,6 +619,7 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
}
}
changedResource.unload();
+
fireElementContentAboutToBeReplaced(info.getEditorInput());
removeUnchangedElementListeners(info.getEditorInput(), info);
info.fStatus = null;
@@ -601,7 +628,7 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
} catch (CoreException e) {
info.fStatus = e.getStatus();
}
- if(!info.fCanBeSaved) {
+ if (!info.fCanBeSaved) {
info.setModificationStamp(computeModificationStamp(info));
}
addUnchangedElementListeners(info.getEditorInput(), info);
@@ -612,7 +639,7 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
* @generated
*/
protected void handleElementMoved(IEditorInput input, URI uri) {
- if(input instanceof FileEditorInput) {
+ 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;
@@ -633,8 +660,8 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
*/
public IDiagramDocument getDiagramDocument(Object element) {
IDocument doc = getDocument(element);
- if(doc instanceof IDiagramDocument) {
- return (IDiagramDocument)doc;
+ if (doc instanceof IDiagramDocument) {
+ return (IDiagramDocument) doc;
}
return null;
}
@@ -756,7 +783,7 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
public void dispose() {
stopResourceListening();
getResourceSet().eAdapters().remove(myResourceSetListener);
- for(Iterator<Resource> it = getLoadedResourcesIterator(); it.hasNext();) {
+ for (Iterator<Resource> it = getLoadedResourcesIterator(); it.hasNext();) {
Resource resource = it.next();
resource.unload();
}
@@ -856,14 +883,13 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
* @generated
*/
public boolean handleResourceChanged(final Resource resource) {
- synchronized(ResourceSetInfo.this) {
- if(ResourceSetInfo.this.fCanBeSaved) {
+ synchronized (ResourceSetInfo.this) {
+ if (ResourceSetInfo.this.fCanBeSaved) {
ResourceSetInfo.this.setUnSynchronized(resource);
return true;
}
}
Display.getDefault().asyncExec(new Runnable() {
-
@Override
public void run() {
handleElementChanged(ResourceSetInfo.this, resource, null);
@@ -876,14 +902,13 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
* @generated
*/
public boolean handleResourceDeleted(Resource resource) {
- synchronized(ResourceSetInfo.this) {
- if(ResourceSetInfo.this.fCanBeSaved) {
+ synchronized (ResourceSetInfo.this) {
+ if (ResourceSetInfo.this.fCanBeSaved) {
ResourceSetInfo.this.setUnSynchronized(resource);
return true;
}
}
Display.getDefault().asyncExec(new Runnable() {
-
@Override
public void run() {
fireElementDeleted(ResourceSetInfo.this.getEditorInput());
@@ -896,15 +921,14 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
* @generated
*/
public boolean handleResourceMoved(Resource resource, final URI newURI) {
- synchronized(ResourceSetInfo.this) {
- if(ResourceSetInfo.this.fCanBeSaved) {
+ synchronized (ResourceSetInfo.this) {
+ if (ResourceSetInfo.this.fCanBeSaved) {
ResourceSetInfo.this.setUnSynchronized(resource);
return true;
}
}
- if(myDocument.getDiagram().eResource() == resource) {
+ if (myDocument.getDiagram().eResource() == resource) {
Display.getDefault().asyncExec(new Runnable() {
-
@Override
public void run() {
handleElementMoved(ResourceSetInfo.this.getEditorInput(), newURI);
@@ -945,33 +969,34 @@ public class UMLDocumentProvider extends AbstractDocumentProvider implements IDi
* @generated
*/
public void notifyChanged(Notification notification) {
- if(notification.getNotifier() instanceof ResourceSet) {
+ 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()) {
+ if (!notification.isTouch() && myModifiedFilter.matches(notification)) {
+ if (notification.getNotifier() instanceof Resource) {
+ Resource resource = (Resource) notification.getNotifier();
+ if (resource.isLoaded()) {
boolean modified = false;
- for(Iterator<Resource> it = myInfo.getLoadedResourcesIterator(); it.hasNext() && !modified;) {
+ for (Iterator<Resource> it = myInfo.getLoadedResourcesIterator(); it.hasNext() && !modified;) {
Resource nextResource = it.next();
- if(nextResource.isLoaded()) {
+ if (nextResource.isLoaded()) {
modified = nextResource.isModified();
}
}
boolean dirtyStateChanged = false;
- synchronized(myInfo) {
- if(modified != myInfo.fCanBeSaved) {
+ synchronized (myInfo) {
+ if (modified != myInfo.fCanBeSaved) {
myInfo.fCanBeSaved = modified;
dirtyStateChanged = true;
}
- if(!resource.isModified()) {
+ if (!resource.isModified()) {
myInfo.setSynchronized(resource);
}
}
- if(dirtyStateChanged) {
+ if (dirtyStateChanged) {
fireElementDirtyStateChanged(myInfo.getEditorInput(), modified);
- if(!modified) {
+
+ if (!modified) {
myInfo.setModificationStamp(computeModificationStamp(myInfo));
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLInitDiagramFileAction.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLInitDiagramFileAction.java
index ed2fe467312..18b1349a7c6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLInitDiagramFileAction.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLInitDiagramFileAction.java
@@ -58,10 +58,10 @@ public class UMLInitDiagramFileAction implements IObjectActionDelegate {
public void selectionChanged(IAction action, ISelection selection) {
domainModelURI = null;
action.setEnabled(false);
- if(selection instanceof IStructuredSelection == false || selection.isEmpty()) {
+ if (selection instanceof IStructuredSelection == false || selection.isEmpty()) {
return;
}
- IFile file = (IFile)((IStructuredSelection)selection).getFirstElement();
+ IFile file = (IFile) ((IStructuredSelection) selection).getFirstElement();
domainModelURI = URI.createPlatformResourceURI(file.getFullPath().toString(), true);
action.setEnabled(true);
}
@@ -84,14 +84,19 @@ public class UMLInitDiagramFileAction implements IObjectActionDelegate {
Resource resource = resourceSet.getResource(domainModelURI, true);
diagramRoot = resource.getContents().get(0);
} catch (WrappedException ex) {
- UMLDiagramEditorPlugin.getInstance().logError("Unable to load resource: " + domainModelURI, ex); //$NON-NLS-1$
+ UMLDiagramEditorPlugin.getInstance().logError(
+ "Unable to load resource: " + domainModelURI, ex); //$NON-NLS-1$
}
- if(diagramRoot == null) {
- MessageDialog.openError(getShell(), Messages.InitDiagramFile_ResourceErrorDialogTitle, Messages.InitDiagramFile_ResourceErrorDialogMessage);
+ if (diagramRoot == null) {
+ MessageDialog.openError(getShell(),
+ Messages.InitDiagramFile_ResourceErrorDialogTitle,
+ Messages.InitDiagramFile_ResourceErrorDialogMessage);
return;
}
Wizard wizard = new UMLNewDiagramFileWizard(domainModelURI, diagramRoot, editingDomain);
- wizard.setWindowTitle(NLS.bind(Messages.InitDiagramFile_WizardTitle, CompositeStructureDiagramEditPart.MODEL_ID));
+ wizard.setWindowTitle(NLS.bind(
+ Messages.InitDiagramFile_WizardTitle,
+ CompositeStructureDiagramEditPart.MODEL_ID));
UMLDiagramEditorUtil.runWizard(getShell(), wizard, "InitDiagramFile"); //$NON-NLS-1$
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLMatchingStrategy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLMatchingStrategy.java
index ce6a3fc41fa..9b96f7b25e1 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLMatchingStrategy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLMatchingStrategy.java
@@ -32,11 +32,12 @@ public class UMLMatchingStrategy implements IEditorMatchingStrategy {
} catch (PartInitException e) {
return false;
}
- if(editorInput.equals(input)) {
+
+ if (editorInput.equals(input)) {
return true;
}
- if(editorInput instanceof URIEditorInput && input instanceof URIEditorInput) {
- return ((URIEditorInput)editorInput).getURI().equals(((URIEditorInput)input).getURI());
+ if (editorInput instanceof URIEditorInput && input instanceof URIEditorInput) {
+ return ((URIEditorInput) editorInput).getURI().equals(((URIEditorInput) input).getURI());
}
return false;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLNewDiagramFileWizard.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLNewDiagramFileWizard.java
index 28209d52587..4b1fcacff45 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLNewDiagramFileWizard.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLNewDiagramFileWizard.java
@@ -67,25 +67,31 @@ public class UMLNewDiagramFileWizard extends Wizard {
assert domainModelURI != null : "Domain model uri must be specified"; //$NON-NLS-1$
assert diagramRoot != null : "Doagram root element must be specified"; //$NON-NLS-1$
assert editingDomain != null : "Editing domain must be specified"; //$NON-NLS-1$
+
myFileCreationPage = new WizardNewFileCreationPage(Messages.UMLNewDiagramFileWizard_CreationPageName, StructuredSelection.EMPTY);
myFileCreationPage.setTitle(Messages.UMLNewDiagramFileWizard_CreationPageTitle);
- myFileCreationPage.setDescription(NLS.bind(Messages.UMLNewDiagramFileWizard_CreationPageDescription, CompositeStructureDiagramEditPart.MODEL_ID));
+ myFileCreationPage.setDescription(NLS.bind(
+ Messages.UMLNewDiagramFileWizard_CreationPageDescription,
+ CompositeStructureDiagramEditPart.MODEL_ID));
IPath filePath;
String fileName = URI.decode(domainModelURI.trimFileExtension().lastSegment());
- if(domainModelURI.isPlatformResource()) {
+ if (domainModelURI.isPlatformResource()) {
filePath = new Path(domainModelURI.trimSegments(1).toPlatformString(true));
- } else if(domainModelURI.isFile()) {
+ } else if (domainModelURI.isFile()) {
filePath = new Path(domainModelURI.trimSegments(1).toFileString());
} else {
// TODO : use some default path
throw new IllegalArgumentException("Unsupported URI: " + domainModelURI); //$NON-NLS-1$
}
myFileCreationPage.setContainerFullPath(filePath);
- myFileCreationPage.setFileName(UMLDiagramEditorUtil.getUniqueFileName(filePath, fileName, "uml_csd")); //$NON-NLS-1$
+ myFileCreationPage.setFileName(UMLDiagramEditorUtil.getUniqueFileName(
+ filePath, fileName, "uml_csd")); //$NON-NLS-1$
+
diagramRootElementSelectionPage = new DiagramRootElementSelectionPage(Messages.UMLNewDiagramFileWizard_RootSelectionPageName);
diagramRootElementSelectionPage.setTitle(Messages.UMLNewDiagramFileWizard_RootSelectionPageTitle);
diagramRootElementSelectionPage.setDescription(Messages.UMLNewDiagramFileWizard_RootSelectionPageDescription);
diagramRootElementSelectionPage.setModelElement(diagramRoot);
+
myEditingDomain = editingDomain;
}
@@ -108,30 +114,40 @@ public class UMLNewDiagramFileWizard extends Wizard {
URI diagramModelURI = URI.createPlatformResourceURI(diagramFile.getFullPath().toString(), true);
ResourceSet resourceSet = myEditingDomain.getResourceSet();
final Resource diagramResource = resourceSet.createResource(diagramModelURI);
- AbstractTransactionalCommand command = new AbstractTransactionalCommand(myEditingDomain, Messages.UMLNewDiagramFileWizard_InitDiagramCommand, affectedFiles) {
+ AbstractTransactionalCommand command = new AbstractTransactionalCommand(
+ myEditingDomain, Messages.UMLNewDiagramFileWizard_InitDiagramCommand, affectedFiles) {
@Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ protected CommandResult doExecuteWithResult(
+ IProgressMonitor monitor, IAdaptable info)
+ throws ExecutionException {
int diagramVID = UMLVisualIDRegistry.getDiagramVisualID(diagramRootElementSelectionPage.getModelElement());
- if(diagramVID != CompositeStructureDiagramEditPart.VISUAL_ID) {
- return CommandResult.newErrorCommandResult(Messages.UMLNewDiagramFileWizard_IncorrectRootError);
+ if (diagramVID != CompositeStructureDiagramEditPart.VISUAL_ID) {
+ return CommandResult.newErrorCommandResult(
+ Messages.UMLNewDiagramFileWizard_IncorrectRootError);
}
- Diagram diagram = ViewService.createDiagram(diagramRootElementSelectionPage.getModelElement(), CompositeStructureDiagramEditPart.MODEL_ID, UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
+ Diagram diagram = ViewService.createDiagram(
+ diagramRootElementSelectionPage.getModelElement(), CompositeStructureDiagramEditPart.MODEL_ID,
+ UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
diagramResource.getContents().add(diagram);
new UMLDiagramContentInitializer().initDiagramContent(diagram);
return CommandResult.newOKCommandResult();
}
};
try {
- OperationHistoryFactory.getOperationHistory().execute(command, new NullProgressMonitor(), null);
+ OperationHistoryFactory.getOperationHistory().execute(
+ command, new NullProgressMonitor(), null);
diagramResource.save(UMLDiagramEditorUtil.getSaveOptions());
UMLDiagramEditorUtil.openDiagram(diagramResource);
} catch (ExecutionException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Unable to create model and diagram", e); //$NON-NLS-1$
+ UMLDiagramEditorPlugin.getInstance().logError(
+ "Unable to create model and diagram", e); //$NON-NLS-1$
} catch (IOException ex) {
- UMLDiagramEditorPlugin.getInstance().logError("Save operation failed for: " + diagramModelURI, ex); //$NON-NLS-1$
+ UMLDiagramEditorPlugin.getInstance().logError(
+ "Save operation failed for: " + diagramModelURI, ex); //$NON-NLS-1$
} catch (PartInitException ex) {
- UMLDiagramEditorPlugin.getInstance().logError("Unable to open editor", ex); //$NON-NLS-1$
+ UMLDiagramEditorPlugin.getInstance().logError(
+ "Unable to open editor", ex); //$NON-NLS-1$
}
return true;
}
@@ -159,11 +175,14 @@ public class UMLNewDiagramFileWizard extends Wizard {
* @generated
*/
protected boolean validatePage() {
- if(getModelElement() == null) {
+ if (getModelElement() == null) {
setErrorMessage(Messages.UMLNewDiagramFileWizard_RootSelectionPageNoSelectionMessage);
return false;
}
- boolean result = ViewService.getInstance().provides(new CreateDiagramViewOperation(new EObjectAdapter(getModelElement()), CompositeStructureDiagramEditPart.MODEL_ID, UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT));
+ boolean result = ViewService.getInstance().provides(
+ new CreateDiagramViewOperation(
+ new EObjectAdapter(getModelElement()),
+ CompositeStructureDiagramEditPart.MODEL_ID, UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT));
setErrorMessage(result ? null : Messages.UMLNewDiagramFileWizard_RootSelectionPageInvalidSelectionMessage);
return result;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLPaletteFactory.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLPaletteFactory.java
index 673cc2777dd..d6b82a92390 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLPaletteFactory.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLPaletteFactory.java
@@ -26,9 +26,9 @@ import org.eclipse.papyrus.uml.diagram.composite.providers.UMLElementTypes;
*/
public class UMLPaletteFactory extends PaletteFactory.Adapter {
- //RS: New Palette generation
- //Generates the ID for the tool elements
- //Generate the tool factory (if(ID) createtool...)
+ // RS: New Palette generation
+ // Generates the ID for the tool elements
+ // Generate the tool factory (if(ID) createtool...)
/**
* @generated
*/
@@ -193,106 +193,107 @@ public class UMLPaletteFactory extends PaletteFactory.Adapter {
* @generated
*/
public UMLPaletteFactory() {
+
}
/**
* @generated
*/
public Tool createTool(String toolId) {
- if(toolId.equals(COMPOSITE_TOOL_CLASS)) {
+ if (toolId.equals(COMPOSITE_TOOL_CLASS)) {
return createClassCreationTool();
}
- if(toolId.equals(COMPOSITE_TOOL_PROPERTY)) {
+ if (toolId.equals(COMPOSITE_TOOL_PROPERTY)) {
return createPropertyCreationTool();
}
- if(toolId.equals(COMPOSITE_TOOL_PORT)) {
+ if (toolId.equals(COMPOSITE_TOOL_PORT)) {
return createPortCreationTool();
}
- if(toolId.equals(COMPOSITE_TOOL_COLLABORATION)) {
+ if (toolId.equals(COMPOSITE_TOOL_COLLABORATION)) {
return createCollaborationCreationTool();
}
- if(toolId.equals(COMPOSITE_TOOL_COLLABORATIONROLE)) {
+ if (toolId.equals(COMPOSITE_TOOL_COLLABORATIONROLE)) {
return createCollaborationRoleCreationTool();
}
- if(toolId.equals(COMPOSITE_TOOL_COLLABORATIONUSE)) {
+ if (toolId.equals(COMPOSITE_TOOL_COLLABORATIONUSE)) {
return createCollaborationUseCreationTool();
}
- if(toolId.equals(COMPOSITE_TOOL_COMMENT)) {
+ if (toolId.equals(COMPOSITE_TOOL_COMMENT)) {
return createCommentCreationTool();
}
- if(toolId.equals(COMPOSITE_TOOL_CONSTRAINT)) {
+ if (toolId.equals(COMPOSITE_TOOL_CONSTRAINT)) {
return createConstraintCreationTool();
}
- if(toolId.equals(COMPOSITE_TOOL_TIMEOBSERVATION)) {
+ if (toolId.equals(COMPOSITE_TOOL_TIMEOBSERVATION)) {
return createTimeObservationCreationTool();
}
- if(toolId.equals(COMPOSITE_TOOL_DURATIONOBSERVATION)) {
+ if (toolId.equals(COMPOSITE_TOOL_DURATIONOBSERVATION)) {
return createDurationObservationCreationTool();
}
- if(toolId.equals(COMPOSITE_TOOL_INFORMATIONITEM)) {
+ if (toolId.equals(COMPOSITE_TOOL_INFORMATIONITEM)) {
return createInformationItemCreationTool();
}
- if(toolId.equals(COMPOSITE_TOOL_PARAMETER)) {
+ if (toolId.equals(COMPOSITE_TOOL_PARAMETER)) {
return createParameterCreationTool();
}
- if(toolId.equals(COMPOSITE_TOOL_ACTIVITY)) {
+ if (toolId.equals(COMPOSITE_TOOL_ACTIVITY)) {
return createActivityCreationTool();
}
- if(toolId.equals(COMPOSITE_TOOL_INTERACTION)) {
+ if (toolId.equals(COMPOSITE_TOOL_INTERACTION)) {
return createInteractionCreationTool();
}
- if(toolId.equals(COMPOSITE_TOOL_PROTOCOLSTATEMACHINE)) {
+ if (toolId.equals(COMPOSITE_TOOL_PROTOCOLSTATEMACHINE)) {
return createProtocolStateMachineCreationTool();
}
- if(toolId.equals(COMPOSITE_TOOL_STATEMACHINE)) {
+ if (toolId.equals(COMPOSITE_TOOL_STATEMACHINE)) {
return createStateMachineCreationTool();
}
- if(toolId.equals(COMPOSITE_TOOL_FUNCTIONBEHAVIOR)) {
+ if (toolId.equals(COMPOSITE_TOOL_FUNCTIONBEHAVIOR)) {
return createFunctionBehaviorCreationTool();
}
- if(toolId.equals(COMPOSITE_TOOL_OPAQUEBEHAVIOR)) {
+ if (toolId.equals(COMPOSITE_TOOL_OPAQUEBEHAVIOR)) {
return createOpaqueBehaviorCreationTool();
}
- if(toolId.equals(COMPOSITE_TOOL_STRINGEXPRESSION)) {
+ if (toolId.equals(COMPOSITE_TOOL_STRINGEXPRESSION)) {
return createStringExpressionCreationTool();
}
- if(toolId.equals(COMPOSITE_TOOL_LINK)) {
+ if (toolId.equals(COMPOSITE_TOOL_LINK)) {
return createLinkCreationTool();
}
- if(toolId.equals(COMPOSITE_TOOL_CONNECTOR)) {
+ if (toolId.equals(COMPOSITE_TOOL_CONNECTOR)) {
return createConnectorCreationTool();
}
- if(toolId.equals(COMPOSITE_TOOL_ROLEBINDING)) {
+ if (toolId.equals(COMPOSITE_TOOL_ROLEBINDING)) {
return createRoleBindingCreationTool();
}
- if(toolId.equals(COMPOSITE_TOOL_GENERALIZATION)) {
+ if (toolId.equals(COMPOSITE_TOOL_GENERALIZATION)) {
return createGeneralizationCreationTool();
}
- if(toolId.equals(COMPOSITE_TOOL_REALIZATION)) {
+ if (toolId.equals(COMPOSITE_TOOL_REALIZATION)) {
return createRealizationCreationTool();
}
- if(toolId.equals(COMPOSITE_TOOL_SUBSTITUTION)) {
+ if (toolId.equals(COMPOSITE_TOOL_SUBSTITUTION)) {
return createSubstitutionCreationTool();
}
- if(toolId.equals(COMPOSITE_TOOL_ABSTRACTION)) {
+ if (toolId.equals(COMPOSITE_TOOL_ABSTRACTION)) {
return createAbstractionCreationTool();
}
- if(toolId.equals(COMPOSITE_TOOL_USAGE)) {
+ if (toolId.equals(COMPOSITE_TOOL_USAGE)) {
return createUsageCreationTool();
}
- if(toolId.equals(COMPOSITE_TOOL_DEPENDENCY)) {
+ if (toolId.equals(COMPOSITE_TOOL_DEPENDENCY)) {
return createDependencyCreationTool();
}
- if(toolId.equals(COMPOSITE_TOOL_REPRESENTATION)) {
+ if (toolId.equals(COMPOSITE_TOOL_REPRESENTATION)) {
return createRepresentationCreationTool();
}
- if(toolId.equals(COMPOSITE_TOOL_INFORMATIONFLOW)) {
+ if (toolId.equals(COMPOSITE_TOOL_INFORMATIONFLOW)) {
return createInformationFlowCreationTool();
}
- if(toolId.equals(COMPOSITE_TOOL_MANIFESTATION)) {
+ if (toolId.equals(COMPOSITE_TOOL_MANIFESTATION)) {
return createManifestationCreationTool();
}
- if(toolId.equals(COMPOSITE_TOOL_DEPLOYMENT)) {
+ if (toolId.equals(COMPOSITE_TOOL_DEPLOYMENT)) {
return createDeploymentCreationTool();
}
// default return: null
@@ -303,6 +304,7 @@ public class UMLPaletteFactory extends PaletteFactory.Adapter {
* @generated
*/
public Object getTemplate(String templateId) {
+
// default return: null
return null;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLVisualIDRegistry.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLVisualIDRegistry.java
index 69d5042ea29..9075a90634e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLVisualIDRegistry.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/UMLVisualIDRegistry.java
@@ -43,8 +43,8 @@ public class UMLVisualIDRegistry {
* @generated
*/
public static int getVisualID(View view) {
- if(view instanceof Diagram) {
- if(CompositeStructureDiagramEditPart.MODEL_ID.equals(view.getType())) {
+ if (view instanceof Diagram) {
+ if (CompositeStructureDiagramEditPart.MODEL_ID.equals(view.getType())) {
return CompositeStructureDiagramEditPart.VISUAL_ID;
} else {
return -1;
@@ -58,12 +58,12 @@ public class UMLVisualIDRegistry {
*/
public static String getModelID(View view) {
View diagram = view.getDiagram();
- while(view != diagram) {
+ while (view != diagram) {
EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
- if(annotation != null) {
+ if (annotation != null) {
return annotation.getDetails().get("modelID"); //$NON-NLS-1$
}
- view = (View)view.eContainer();
+ view = (View) view.eContainer();
}
return diagram != null ? diagram.getType() : null;
}
@@ -75,7 +75,7 @@ public class UMLVisualIDRegistry {
try {
return Integer.parseInt(type);
} catch (NumberFormatException e) {
- if(Boolean.TRUE.toString().equalsIgnoreCase(Platform.getDebugOption(DEBUG_KEY))) {
+ if (Boolean.TRUE.toString().equalsIgnoreCase(Platform.getDebugOption(DEBUG_KEY))) {
UMLDiagramEditorPlugin.getInstance().logError("Unable to parse view type as a visualID number: " + type);
}
}
@@ -93,7 +93,7 @@ public class UMLVisualIDRegistry {
* @generated
*/
public static int getDiagramVisualID(EObject domainElement) {
- if(domainElement == null) {
+ if (domainElement == null) {
return -1;
}
return 1000;
@@ -103,2487 +103,2487 @@ public class UMLVisualIDRegistry {
* @generated
*/
public static int getNodeVisualID(View containerView, EObject domainElement) {
- if(domainElement == null) {
+ if (domainElement == null) {
return -1;
}
String containerModelID = org.eclipse.papyrus.uml.diagram.composite.part.UMLVisualIDRegistry.getModelID(containerView);
- if(!CompositeStructureDiagramEditPart.MODEL_ID.equals(containerModelID)) {
+ if (!CompositeStructureDiagramEditPart.MODEL_ID.equals(containerModelID)) {
return -1;
}
int containerVisualID;
- if(CompositeStructureDiagramEditPart.MODEL_ID.equals(containerModelID)) {
+ if (CompositeStructureDiagramEditPart.MODEL_ID.equals(containerModelID)) {
containerVisualID = org.eclipse.papyrus.uml.diagram.composite.part.UMLVisualIDRegistry.getVisualID(containerView);
} else {
- if(containerView instanceof Diagram) {
+ if (containerView instanceof Diagram) {
containerVisualID = CompositeStructureDiagramEditPart.VISUAL_ID;
} else {
return -1;
}
}
- switch(containerVisualID) {
+ switch (containerVisualID) {
case CompositeStructureDiagramEditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
return ActivityCompositeEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
return InteractionCompositeEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
return ProtocolStateMachineCompositeEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
return StateMachineCompositeEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
return FunctionBehaviorCompositeEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
return OpaqueBehaviorCompositeEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
return ComponentCompositeEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
return DeviceCompositeEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
return ExecutionEnvironmentCompositeEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
return NodeCompositeEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
return ClassCompositeEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
return CollaborationCompositeEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
return InterfaceEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
return PrimitiveTypeEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
return EnumerationEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
return DataTypeEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
return ActorEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
return DeploymentSpecificationEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
return ArtifactEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
return InformationItemEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
return SignalEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
return UseCaseEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getSignalEvent().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getSignalEvent().isSuperTypeOf(domainElement.eClass())) {
return SignalEventEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCallEvent().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCallEvent().isSuperTypeOf(domainElement.eClass())) {
return CallEventEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getAnyReceiveEvent().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getAnyReceiveEvent().isSuperTypeOf(domainElement.eClass())) {
return AnyReceiveEventEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getChangeEvent().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getChangeEvent().isSuperTypeOf(domainElement.eClass())) {
return ChangeEventEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getTimeEvent().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getTimeEvent().isSuperTypeOf(domainElement.eClass())) {
return TimeEventEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDurationObservation().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDurationObservation().isSuperTypeOf(domainElement.eClass())) {
return DurationObservationEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getTimeObservation().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getTimeObservation().isSuperTypeOf(domainElement.eClass())) {
return TimeObservationEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getLiteralBoolean().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getLiteralBoolean().isSuperTypeOf(domainElement.eClass())) {
return LiteralBooleanEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getLiteralInteger().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getLiteralInteger().isSuperTypeOf(domainElement.eClass())) {
return LiteralIntegerEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getLiteralNull().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getLiteralNull().isSuperTypeOf(domainElement.eClass())) {
return LiteralNullEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getLiteralString().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getLiteralString().isSuperTypeOf(domainElement.eClass())) {
return LiteralStringEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getLiteralUnlimitedNatural().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getLiteralUnlimitedNatural().isSuperTypeOf(domainElement.eClass())) {
return LiteralUnlimitedNaturalEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getStringExpression().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getStringExpression().isSuperTypeOf(domainElement.eClass())) {
return StringExpressionEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getOpaqueExpression().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getOpaqueExpression().isSuperTypeOf(domainElement.eClass())) {
return OpaqueExpressionEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getTimeExpression().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getTimeExpression().isSuperTypeOf(domainElement.eClass())) {
return TimeExpressionEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getExpression().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getExpression().isSuperTypeOf(domainElement.eClass())) {
return ExpressionEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDuration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDuration().isSuperTypeOf(domainElement.eClass())) {
return DurationEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getTimeInterval().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getTimeInterval().isSuperTypeOf(domainElement.eClass())) {
return TimeIntervalEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDurationInterval().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDurationInterval().isSuperTypeOf(domainElement.eClass())) {
return DurationIntervalEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInterval().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInterval().isSuperTypeOf(domainElement.eClass())) {
return IntervalEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInstanceValue().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInstanceValue().isSuperTypeOf(domainElement.eClass())) {
return InstanceValueEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
return CommentEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
return DurationConstraintEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
return TimeConstraintEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
return IntervalConstraintEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
return InteractionConstraintEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
return ConstraintEditPart.VISUAL_ID;
}
break;
case ActivityCompositeEditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
return PortEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
return ParameterEditPart.VISUAL_ID;
}
break;
case InteractionCompositeEditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
return PortEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
return ParameterEditPart.VISUAL_ID;
}
break;
case ProtocolStateMachineCompositeEditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
return PortEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
return ParameterEditPart.VISUAL_ID;
}
break;
case StateMachineCompositeEditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
return PortEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
return ParameterEditPart.VISUAL_ID;
}
break;
case FunctionBehaviorCompositeEditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
return PortEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
return ParameterEditPart.VISUAL_ID;
}
break;
case OpaqueBehaviorCompositeEditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
return PortEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
return ParameterEditPart.VISUAL_ID;
}
break;
case ComponentCompositeEditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
return PortEditPart.VISUAL_ID;
}
break;
case DeviceCompositeEditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
return PortEditPart.VISUAL_ID;
}
break;
case ExecutionEnvironmentCompositeEditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
return PortEditPart.VISUAL_ID;
}
break;
case NodeCompositeEditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
return PortEditPart.VISUAL_ID;
}
break;
case ClassCompositeEditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
return PortEditPart.VISUAL_ID;
}
break;
case EnumerationEditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getEnumerationLiteral().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getEnumerationLiteral().isSuperTypeOf(domainElement.eClass())) {
return EnumerationLiteralEditPartCLN.VISUAL_ID;
}
break;
case PropertyPartEditPartCN.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
return PortEditPart.VISUAL_ID;
}
break;
case ActivityCompositeEditPartCN.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
return PortEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
return ParameterEditPart.VISUAL_ID;
}
break;
case InteractionCompositeEditPartCN.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
return PortEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
return ParameterEditPart.VISUAL_ID;
}
break;
case ProtocolStateMachineCompositeEditPartCN.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
return PortEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
return ParameterEditPart.VISUAL_ID;
}
break;
case StateMachineCompositeEditPartCN.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
return PortEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
return ParameterEditPart.VISUAL_ID;
}
break;
case FunctionBehaviorCompositeEditPartCN.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
return PortEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
return ParameterEditPart.VISUAL_ID;
}
break;
case OpaqueBehaviorCompositeEditPartCN.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
return PortEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
return ParameterEditPart.VISUAL_ID;
}
break;
case ComponentCompositeEditPartCN.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
return PortEditPart.VISUAL_ID;
}
break;
case DeviceCompositeEditPartCN.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
return PortEditPart.VISUAL_ID;
}
break;
case ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
return PortEditPart.VISUAL_ID;
}
break;
case NodeCompositeEditPartCN.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
return PortEditPart.VISUAL_ID;
}
break;
case ClassCompositeEditPartCN.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElement.eClass())) {
return PortEditPart.VISUAL_ID;
}
break;
case EnumerationEditPartCN.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getEnumerationLiteral().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getEnumerationLiteral().isSuperTypeOf(domainElement.eClass())) {
return EnumerationLiteralEditPartCLN.VISUAL_ID;
}
break;
case DataTypeAttributeCompartmentEditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass())) {
return PropertyEditPartCLN.VISUAL_ID;
}
break;
case DataTypeOperationCompartmentEditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getOperation().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getOperation().isSuperTypeOf(domainElement.eClass())) {
return OperationEditPartCLN.VISUAL_ID;
}
break;
case DataTypeAttributeCompartmentEditPartCN.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass())) {
return PropertyEditPartCLN.VISUAL_ID;
}
break;
case DataTypeOperationCompartmentEditPartCN.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getOperation().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getOperation().isSuperTypeOf(domainElement.eClass())) {
return OperationEditPartCLN.VISUAL_ID;
}
break;
case EnumerationEnumerationLiteralCompartmentEditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getEnumerationLiteral().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getEnumerationLiteral().isSuperTypeOf(domainElement.eClass())) {
return EnumerationLiteralEditPartCLN.VISUAL_ID;
}
break;
case EnumerationEnumerationLiteralCompartmentEditPartCN.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getEnumerationLiteral().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getEnumerationLiteral().isSuperTypeOf(domainElement.eClass())) {
return EnumerationLiteralEditPartCLN.VISUAL_ID;
}
break;
case ActivityCompositeCompartmentEditPartCN.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
return ParameterEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property)domainElement)) {
+ if (UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property) domainElement)) {
return PropertyPartEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
return CollaborationUseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
return ActivityCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
return InteractionCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
return ProtocolStateMachineCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
return StateMachineCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
return FunctionBehaviorCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
return OpaqueBehaviorCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
return ComponentCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
return DeviceCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
return ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
return NodeCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
return ClassCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
return CollaborationCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
return InterfaceEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
return PrimitiveTypeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
return EnumerationEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
return DataTypeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
return ActorEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
return DeploymentSpecificationEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
return ArtifactEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
return InformationItemEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
return SignalEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
return UseCaseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
return CommentEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
return DurationConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
return TimeConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
return IntervalConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
return InteractionConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
return ConstraintEditPartCN.VISUAL_ID;
}
break;
case InteractionCompositeCompartmentEditPartCN.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
return ParameterEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property)domainElement)) {
+ if (UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property) domainElement)) {
return PropertyPartEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
return CollaborationUseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
return ActivityCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
return InteractionCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
return ProtocolStateMachineCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
return StateMachineCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
return FunctionBehaviorCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
return OpaqueBehaviorCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
return ComponentCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
return DeviceCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
return ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
return NodeCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
return ClassCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
return CollaborationCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
return InterfaceEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
return PrimitiveTypeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
return EnumerationEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
return DataTypeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
return ActorEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
return DeploymentSpecificationEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
return ArtifactEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
return InformationItemEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
return SignalEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
return UseCaseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
return CommentEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
return DurationConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
return TimeConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
return IntervalConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
return InteractionConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
return ConstraintEditPartCN.VISUAL_ID;
}
break;
case ProtocolStateMachineCompositeCompartmentEditPartCN.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
return ParameterEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property)domainElement)) {
+ if (UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property) domainElement)) {
return PropertyPartEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
return CollaborationUseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
return ActivityCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
return InteractionCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
return ProtocolStateMachineCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
return StateMachineCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
return FunctionBehaviorCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
return OpaqueBehaviorCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
return ComponentCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
return DeviceCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
return ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
return NodeCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
return ClassCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
return CollaborationCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
return InterfaceEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
return PrimitiveTypeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
return EnumerationEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
return DataTypeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
return ActorEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
return DeploymentSpecificationEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
return ArtifactEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
return InformationItemEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
return SignalEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
return UseCaseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
return CommentEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
return DurationConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
return TimeConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
return IntervalConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
return InteractionConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
return ConstraintEditPartCN.VISUAL_ID;
}
break;
case StateMachineCompositeCompartmentEditPartCN.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
return ParameterEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property)domainElement)) {
+ if (UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property) domainElement)) {
return PropertyPartEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
return CollaborationUseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
return ActivityCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
return InteractionCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
return ProtocolStateMachineCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
return StateMachineCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
return FunctionBehaviorCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
return OpaqueBehaviorCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
return ComponentCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
return DeviceCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
return ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
return NodeCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
return ClassCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
return CollaborationCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
return InterfaceEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
return PrimitiveTypeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
return EnumerationEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
return DataTypeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
return ActorEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
return DeploymentSpecificationEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
return ArtifactEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
return InformationItemEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
return SignalEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
return UseCaseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
return CommentEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
return DurationConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
return TimeConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
return IntervalConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
return InteractionConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
return ConstraintEditPartCN.VISUAL_ID;
}
break;
case FunctionBehaviorCompositeCompartmentEditPartCN.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
return ParameterEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property)domainElement)) {
+ if (UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property) domainElement)) {
return PropertyPartEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
return CollaborationUseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
return ActivityCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
return InteractionCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
return ProtocolStateMachineCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
return StateMachineCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
return FunctionBehaviorCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
return OpaqueBehaviorCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
return ComponentCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
return DeviceCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
return ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
return NodeCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
return ClassCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
return CollaborationCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
return InterfaceEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
return PrimitiveTypeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
return EnumerationEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
return DataTypeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
return ActorEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
return DeploymentSpecificationEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
return ArtifactEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
return InformationItemEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
return SignalEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
return UseCaseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
return CommentEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
return DurationConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
return TimeConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
return IntervalConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
return InteractionConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
return ConstraintEditPartCN.VISUAL_ID;
}
break;
case OpaqueBehaviorCompositeCompartmentEditPartCN.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
return ParameterEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property)domainElement)) {
+ if (UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property) domainElement)) {
return PropertyPartEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
return CollaborationUseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
return ActivityCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
return InteractionCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
return ProtocolStateMachineCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
return StateMachineCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
return FunctionBehaviorCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
return OpaqueBehaviorCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
return ComponentCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
return DeviceCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
return ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
return NodeCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
return ClassCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
return CollaborationCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
return InterfaceEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
return PrimitiveTypeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
return EnumerationEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
return DataTypeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
return ActorEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
return DeploymentSpecificationEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
return ArtifactEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
return InformationItemEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
return SignalEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
return UseCaseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
return CommentEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
return DurationConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
return TimeConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
return IntervalConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
return InteractionConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
return ConstraintEditPartCN.VISUAL_ID;
}
break;
case ComponentCompositeCompartmentEditPartCN.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property)domainElement)) {
+ if (UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property) domainElement)) {
return PropertyPartEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
return CollaborationUseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
return ActivityCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
return InteractionCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
return ProtocolStateMachineCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
return StateMachineCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
return FunctionBehaviorCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
return OpaqueBehaviorCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
return ComponentCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
return DeviceCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
return ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
return NodeCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
return ClassCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
return CollaborationCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
return InterfaceEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
return PrimitiveTypeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
return EnumerationEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
return DataTypeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
return ActorEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
return DeploymentSpecificationEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
return ArtifactEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
return InformationItemEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
return SignalEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
return UseCaseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
return CommentEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
return DurationConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
return TimeConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
return IntervalConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
return InteractionConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
return ConstraintEditPartCN.VISUAL_ID;
}
break;
case DeviceCompositeCompartmentEditPartCN.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property)domainElement)) {
+ if (UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property) domainElement)) {
return PropertyPartEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
return CollaborationUseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
return ActivityCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
return InteractionCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
return ProtocolStateMachineCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
return StateMachineCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
return FunctionBehaviorCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
return OpaqueBehaviorCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
return ComponentCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
return DeviceCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
return ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
return NodeCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
return ClassCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
return CollaborationCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
return InterfaceEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
return PrimitiveTypeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
return EnumerationEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
return DataTypeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
return ActorEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
return DeploymentSpecificationEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
return ArtifactEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
return InformationItemEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
return SignalEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
return UseCaseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
return CommentEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
return DurationConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
return TimeConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
return IntervalConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
return InteractionConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
return ConstraintEditPartCN.VISUAL_ID;
}
break;
case ExecutionEnvironmentCompositeCompartmentEditPartCN.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property)domainElement)) {
+ if (UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property) domainElement)) {
return PropertyPartEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
return CollaborationUseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
return ActivityCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
return InteractionCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
return ProtocolStateMachineCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
return StateMachineCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
return FunctionBehaviorCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
return OpaqueBehaviorCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
return ComponentCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
return DeviceCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
return ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
return NodeCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
return ClassCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
return CollaborationCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
return InterfaceEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
return PrimitiveTypeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
return EnumerationEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
return DataTypeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
return ActorEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
return DeploymentSpecificationEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
return ArtifactEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
return InformationItemEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
return SignalEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
return UseCaseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
return CommentEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
return DurationConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
return TimeConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
return IntervalConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
return InteractionConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
return ConstraintEditPartCN.VISUAL_ID;
}
break;
case NodeCompositeCompartmentEditPartCN.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property)domainElement)) {
+ if (UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property) domainElement)) {
return PropertyPartEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
return CollaborationUseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
return ActivityCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
return InteractionCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
return ProtocolStateMachineCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
return StateMachineCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
return FunctionBehaviorCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
return OpaqueBehaviorCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
return ComponentCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
return DeviceCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
return ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
return NodeCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
return ClassCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
return CollaborationCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
return InterfaceEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
return PrimitiveTypeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
return EnumerationEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
return DataTypeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
return ActorEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
return DeploymentSpecificationEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
return ArtifactEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
return InformationItemEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
return SignalEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
return UseCaseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
return CommentEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
return DurationConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
return TimeConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
return IntervalConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
return InteractionConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
return ConstraintEditPartCN.VISUAL_ID;
}
break;
case ClassCompositeCompartmentEditPartCN.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property)domainElement)) {
+ if (UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property) domainElement)) {
return PropertyPartEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
return CollaborationUseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
return ActivityCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
return InteractionCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
return ProtocolStateMachineCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
return StateMachineCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
return FunctionBehaviorCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
return OpaqueBehaviorCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
return ComponentCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
return DeviceCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
return ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
return NodeCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
return ClassCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
return CollaborationCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
return InterfaceEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
return PrimitiveTypeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
return EnumerationEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
return DataTypeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
return ActorEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
return DeploymentSpecificationEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
return ArtifactEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
return InformationItemEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
return SignalEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
return UseCaseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
return CommentEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
return DurationConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
return TimeConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
return IntervalConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
return InteractionConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
return ConstraintEditPartCN.VISUAL_ID;
}
break;
case CollaborationCompositeCompartmentEditPartCN.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property)domainElement)) {
+ if (UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property) domainElement)) {
return PropertyPartEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
return CollaborationUseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
return CommentEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getConnectableElement().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getConnectableElement().isSuperTypeOf(domainElement.eClass())) {
return CollaborationRoleEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
return DurationConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
return TimeConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
return IntervalConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
return InteractionConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
return ConstraintEditPartCN.VISUAL_ID;
}
break;
case ActivityCompositeCompartmentEditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
return ParameterEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property)domainElement)) {
+ if (UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property) domainElement)) {
return PropertyPartEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
return CollaborationUseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
return ActivityCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
return InteractionCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
return ProtocolStateMachineCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
return StateMachineCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
return FunctionBehaviorCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
return OpaqueBehaviorCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
return ComponentCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
return DeviceCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
return ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
return NodeCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
return ClassCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
return CollaborationCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
return InterfaceEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
return PrimitiveTypeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
return EnumerationEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
return DataTypeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
return ActorEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
return DeploymentSpecificationEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
return ArtifactEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
return InformationItemEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
return SignalEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
return UseCaseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
return CommentEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
return DurationConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
return TimeConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
return IntervalConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
return InteractionConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
return ConstraintEditPartCN.VISUAL_ID;
}
break;
case InteractionCompositeCompartmentEditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
return ParameterEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property)domainElement)) {
+ if (UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property) domainElement)) {
return PropertyPartEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
return CollaborationUseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
return ActivityCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
return InteractionCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
return ProtocolStateMachineCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
return StateMachineCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
return FunctionBehaviorCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
return OpaqueBehaviorCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
return ComponentCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
return DeviceCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
return ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
return NodeCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
return ClassCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
return CollaborationCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
return InterfaceEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
return PrimitiveTypeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
return EnumerationEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
return DataTypeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
return ActorEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
return DeploymentSpecificationEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
return ArtifactEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
return InformationItemEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
return SignalEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
return UseCaseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
return CommentEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
return DurationConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
return TimeConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
return IntervalConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
return InteractionConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
return ConstraintEditPartCN.VISUAL_ID;
}
break;
case ProtocolStateMachineCompositeCompartmentEditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
return ParameterEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property)domainElement)) {
+ if (UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property) domainElement)) {
return PropertyPartEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
return CollaborationUseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
return ActivityCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
return InteractionCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
return ProtocolStateMachineCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
return StateMachineCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
return FunctionBehaviorCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
return OpaqueBehaviorCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
return ComponentCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
return DeviceCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
return ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
return NodeCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
return ClassCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
return CollaborationCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
return InterfaceEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
return PrimitiveTypeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
return EnumerationEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
return DataTypeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
return ActorEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
return DeploymentSpecificationEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
return ArtifactEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
return InformationItemEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
return SignalEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
return UseCaseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
return CommentEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
return DurationConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
return TimeConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
return IntervalConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
return InteractionConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
return ConstraintEditPartCN.VISUAL_ID;
}
break;
case StateMachineCompositeCompartmentEditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
return ParameterEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property)domainElement)) {
+ if (UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property) domainElement)) {
return PropertyPartEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
return CollaborationUseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
return ActivityCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
return InteractionCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
return ProtocolStateMachineCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
return StateMachineCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
return FunctionBehaviorCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
return OpaqueBehaviorCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
return ComponentCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
return DeviceCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
return ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
return NodeCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
return ClassCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
return CollaborationCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
return InterfaceEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
return PrimitiveTypeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
return EnumerationEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
return DataTypeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
return ActorEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
return DeploymentSpecificationEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
return ArtifactEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
return InformationItemEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
return SignalEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
return UseCaseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
return CommentEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
return DurationConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
return TimeConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
return IntervalConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
return InteractionConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
return ConstraintEditPartCN.VISUAL_ID;
}
break;
case FunctionBehaviorCompositeCompartmentEditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
return ParameterEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property)domainElement)) {
+ if (UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property) domainElement)) {
return PropertyPartEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
return CollaborationUseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
return ActivityCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
return InteractionCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
return ProtocolStateMachineCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
return StateMachineCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
return FunctionBehaviorCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
return OpaqueBehaviorCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
return ComponentCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
return DeviceCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
return ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
return NodeCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
return ClassCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
return CollaborationCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
return InterfaceEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
return PrimitiveTypeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
return EnumerationEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
return DataTypeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
return ActorEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
return DeploymentSpecificationEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
return ArtifactEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
return InformationItemEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
return SignalEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
return UseCaseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
return CommentEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
return DurationConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
return TimeConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
return IntervalConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
return InteractionConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
return ConstraintEditPartCN.VISUAL_ID;
}
break;
case OpaqueBehaviorCompositeCompartmentEditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getParameter().isSuperTypeOf(domainElement.eClass())) {
return ParameterEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property)domainElement)) {
+ if (UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property) domainElement)) {
return PropertyPartEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
return CollaborationUseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
return ActivityCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
return InteractionCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
return ProtocolStateMachineCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
return StateMachineCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
return FunctionBehaviorCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
return OpaqueBehaviorCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
return ComponentCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
return DeviceCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
return ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
return NodeCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
return ClassCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
return CollaborationCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
return InterfaceEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
return PrimitiveTypeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
return EnumerationEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
return DataTypeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
return ActorEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
return DeploymentSpecificationEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
return ArtifactEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
return InformationItemEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
return SignalEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
return UseCaseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
return CommentEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
return DurationConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
return TimeConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
return IntervalConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
return InteractionConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
return ConstraintEditPartCN.VISUAL_ID;
}
break;
case ComponentCompositeCompartmentEditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property)domainElement)) {
+ if (UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property) domainElement)) {
return PropertyPartEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
return CollaborationUseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
return ActivityCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
return InteractionCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
return ProtocolStateMachineCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
return StateMachineCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
return FunctionBehaviorCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
return OpaqueBehaviorCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
return ComponentCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
return DeviceCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
return ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
return NodeCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
return ClassCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
return CollaborationCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
return InterfaceEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
return PrimitiveTypeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
return EnumerationEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
return DataTypeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
return ActorEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
return DeploymentSpecificationEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
return ArtifactEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
return InformationItemEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
return SignalEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
return UseCaseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
return CommentEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
return DurationConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
return TimeConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
return IntervalConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
return InteractionConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
return ConstraintEditPartCN.VISUAL_ID;
}
break;
case DeviceCompositeCompartmentEditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property)domainElement)) {
+ if (UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property) domainElement)) {
return PropertyPartEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
return CollaborationUseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
return ActivityCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
return InteractionCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
return ProtocolStateMachineCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
return StateMachineCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
return FunctionBehaviorCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
return OpaqueBehaviorCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
return ComponentCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
return DeviceCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
return ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
return NodeCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
return ClassCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
return CollaborationCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
return InterfaceEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
return PrimitiveTypeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
return EnumerationEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
return DataTypeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
return ActorEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
return DeploymentSpecificationEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
return ArtifactEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
return InformationItemEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
return SignalEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
return UseCaseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
return CommentEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
return DurationConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
return TimeConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
return IntervalConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
return InteractionConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
return ConstraintEditPartCN.VISUAL_ID;
}
break;
case ExecutionEnvironmentCompositeCompartmentEditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property)domainElement)) {
+ if (UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property) domainElement)) {
return PropertyPartEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
return CollaborationUseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
return ActivityCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
return InteractionCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
return ProtocolStateMachineCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
return StateMachineCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
return FunctionBehaviorCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
return OpaqueBehaviorCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
return ComponentCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
return DeviceCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
return ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
return NodeCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
return ClassCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
return CollaborationCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
return InterfaceEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
return PrimitiveTypeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
return EnumerationEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
return DataTypeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
return ActorEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
return DeploymentSpecificationEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
return ArtifactEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
return InformationItemEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
return SignalEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
return UseCaseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
return CommentEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
return DurationConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
return TimeConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
return IntervalConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
return InteractionConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
return ConstraintEditPartCN.VISUAL_ID;
}
break;
case NodeCompositeCompartmentEditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property)domainElement)) {
+ if (UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property) domainElement)) {
return PropertyPartEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
return CollaborationUseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
return ActivityCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
return InteractionCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
return ProtocolStateMachineCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
return StateMachineCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
return FunctionBehaviorCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
return OpaqueBehaviorCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
return ComponentCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
return DeviceCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
return ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
return NodeCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
return ClassCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
return CollaborationCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
return InterfaceEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
return PrimitiveTypeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
return EnumerationEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
return DataTypeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
return ActorEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
return DeploymentSpecificationEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
return ArtifactEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
return InformationItemEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
return SignalEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
return UseCaseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
return CommentEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
return DurationConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
return TimeConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
return IntervalConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
return InteractionConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
return ConstraintEditPartCN.VISUAL_ID;
}
break;
case ClassCompositeCompartmentEditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property)domainElement)) {
+ if (UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property) domainElement)) {
return PropertyPartEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
return CollaborationUseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActivity().isSuperTypeOf(domainElement.eClass())) {
return ActivityCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
return InteractionCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getProtocolStateMachine().isSuperTypeOf(domainElement.eClass())) {
return ProtocolStateMachineCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getStateMachine().isSuperTypeOf(domainElement.eClass())) {
return StateMachineCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getFunctionBehavior().isSuperTypeOf(domainElement.eClass())) {
return FunctionBehaviorCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getOpaqueBehavior().isSuperTypeOf(domainElement.eClass())) {
return OpaqueBehaviorCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(domainElement.eClass())) {
return ComponentCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDevice().isSuperTypeOf(domainElement.eClass())) {
return DeviceCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getExecutionEnvironment().isSuperTypeOf(domainElement.eClass())) {
return ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getNode().isSuperTypeOf(domainElement.eClass())) {
return NodeCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElement.eClass())) {
return ClassCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaboration().isSuperTypeOf(domainElement.eClass())) {
return CollaborationCompositeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElement.eClass())) {
return InterfaceEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElement.eClass())) {
return PrimitiveTypeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElement.eClass())) {
return EnumerationEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElement.eClass())) {
return DataTypeEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getActor().isSuperTypeOf(domainElement.eClass())) {
return ActorEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDeploymentSpecification().isSuperTypeOf(domainElement.eClass())) {
return DeploymentSpecificationEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getArtifact().isSuperTypeOf(domainElement.eClass())) {
return ArtifactEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInformationItem().isSuperTypeOf(domainElement.eClass())) {
return InformationItemEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getSignal().isSuperTypeOf(domainElement.eClass())) {
return SignalEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
return UseCaseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
return CommentEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
return ConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
return DurationConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
return TimeConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
return IntervalConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
return InteractionConstraintEditPartCN.VISUAL_ID;
}
break;
case CollaborationCompositeCompartmentEditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property)domainElement)) {
+ if (UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property) domainElement)) {
return PropertyPartEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getCollaborationUse().isSuperTypeOf(domainElement.eClass())) {
return CollaborationUseEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
return CommentEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getConnectableElement().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getConnectableElement().isSuperTypeOf(domainElement.eClass())) {
return CollaborationRoleEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDurationConstraint().isSuperTypeOf(domainElement.eClass())) {
return DurationConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getTimeConstraint().isSuperTypeOf(domainElement.eClass())) {
return TimeConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getIntervalConstraint().isSuperTypeOf(domainElement.eClass())) {
return IntervalConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInteractionConstraint().isSuperTypeOf(domainElement.eClass())) {
return InteractionConstraintEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
return ConstraintEditPartCN.VISUAL_ID;
}
break;
case PropertyPartCompartmentEditPartCN.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property)domainElement)) {
+ if (UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass()) && isProperty_3070(containerView, (Property) domainElement)) {
return PropertyPartEditPartCN.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
return CommentEditPartCN.VISUAL_ID;
}
break;
@@ -2596,3296 +2596,3296 @@ public class UMLVisualIDRegistry {
*/
public static boolean canCreateNode(View containerView, int nodeVisualID) {
String containerModelID = org.eclipse.papyrus.uml.diagram.composite.part.UMLVisualIDRegistry.getModelID(containerView);
- if(!CompositeStructureDiagramEditPart.MODEL_ID.equals(containerModelID)) {
+ if (!CompositeStructureDiagramEditPart.MODEL_ID.equals(containerModelID)) {
return false;
}
int containerVisualID;
- if(CompositeStructureDiagramEditPart.MODEL_ID.equals(containerModelID)) {
+ if (CompositeStructureDiagramEditPart.MODEL_ID.equals(containerModelID)) {
containerVisualID = org.eclipse.papyrus.uml.diagram.composite.part.UMLVisualIDRegistry.getVisualID(containerView);
} else {
- if(containerView instanceof Diagram) {
+ if (containerView instanceof Diagram) {
containerVisualID = CompositeStructureDiagramEditPart.VISUAL_ID;
} else {
return false;
}
}
- switch(containerVisualID) {
+ switch (containerVisualID) {
case CompositeStructureDiagramEditPart.VISUAL_ID:
- if(ActivityCompositeEditPart.VISUAL_ID == nodeVisualID) {
+ if (ActivityCompositeEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionCompositeEditPart.VISUAL_ID == nodeVisualID) {
+ if (InteractionCompositeEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ProtocolStateMachineCompositeEditPart.VISUAL_ID == nodeVisualID) {
+ if (ProtocolStateMachineCompositeEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(StateMachineCompositeEditPart.VISUAL_ID == nodeVisualID) {
+ if (StateMachineCompositeEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(FunctionBehaviorCompositeEditPart.VISUAL_ID == nodeVisualID) {
+ if (FunctionBehaviorCompositeEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(OpaqueBehaviorCompositeEditPart.VISUAL_ID == nodeVisualID) {
+ if (OpaqueBehaviorCompositeEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ComponentCompositeEditPart.VISUAL_ID == nodeVisualID) {
+ if (ComponentCompositeEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeviceCompositeEditPart.VISUAL_ID == nodeVisualID) {
+ if (DeviceCompositeEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ExecutionEnvironmentCompositeEditPart.VISUAL_ID == nodeVisualID) {
+ if (ExecutionEnvironmentCompositeEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(NodeCompositeEditPart.VISUAL_ID == nodeVisualID) {
+ if (NodeCompositeEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ClassCompositeEditPart.VISUAL_ID == nodeVisualID) {
+ if (ClassCompositeEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationCompositeEditPart.VISUAL_ID == nodeVisualID) {
+ if (CollaborationCompositeEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InterfaceEditPart.VISUAL_ID == nodeVisualID) {
+ if (InterfaceEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PrimitiveTypeEditPart.VISUAL_ID == nodeVisualID) {
+ if (PrimitiveTypeEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(EnumerationEditPart.VISUAL_ID == nodeVisualID) {
+ if (EnumerationEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DataTypeEditPart.VISUAL_ID == nodeVisualID) {
+ if (DataTypeEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActorEditPart.VISUAL_ID == nodeVisualID) {
+ if (ActorEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeploymentSpecificationEditPart.VISUAL_ID == nodeVisualID) {
+ if (DeploymentSpecificationEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ArtifactEditPart.VISUAL_ID == nodeVisualID) {
+ if (ArtifactEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InformationItemEditPart.VISUAL_ID == nodeVisualID) {
+ if (InformationItemEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(SignalEditPart.VISUAL_ID == nodeVisualID) {
+ if (SignalEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(UseCaseEditPart.VISUAL_ID == nodeVisualID) {
+ if (UseCaseEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(SignalEventEditPart.VISUAL_ID == nodeVisualID) {
+ if (SignalEventEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CallEventEditPart.VISUAL_ID == nodeVisualID) {
+ if (CallEventEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(AnyReceiveEventEditPart.VISUAL_ID == nodeVisualID) {
+ if (AnyReceiveEventEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ChangeEventEditPart.VISUAL_ID == nodeVisualID) {
+ if (ChangeEventEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(TimeEventEditPart.VISUAL_ID == nodeVisualID) {
+ if (TimeEventEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DurationObservationEditPart.VISUAL_ID == nodeVisualID) {
+ if (DurationObservationEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(TimeObservationEditPart.VISUAL_ID == nodeVisualID) {
+ if (TimeObservationEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(LiteralBooleanEditPart.VISUAL_ID == nodeVisualID) {
+ if (LiteralBooleanEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(LiteralIntegerEditPart.VISUAL_ID == nodeVisualID) {
+ if (LiteralIntegerEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(LiteralNullEditPart.VISUAL_ID == nodeVisualID) {
+ if (LiteralNullEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(LiteralStringEditPart.VISUAL_ID == nodeVisualID) {
+ if (LiteralStringEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(LiteralUnlimitedNaturalEditPart.VISUAL_ID == nodeVisualID) {
+ if (LiteralUnlimitedNaturalEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(StringExpressionEditPart.VISUAL_ID == nodeVisualID) {
+ if (StringExpressionEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(OpaqueExpressionEditPart.VISUAL_ID == nodeVisualID) {
+ if (OpaqueExpressionEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(TimeExpressionEditPart.VISUAL_ID == nodeVisualID) {
+ if (TimeExpressionEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ExpressionEditPart.VISUAL_ID == nodeVisualID) {
+ if (ExpressionEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DurationEditPart.VISUAL_ID == nodeVisualID) {
+ if (DurationEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(TimeIntervalEditPart.VISUAL_ID == nodeVisualID) {
+ if (TimeIntervalEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DurationIntervalEditPart.VISUAL_ID == nodeVisualID) {
+ if (DurationIntervalEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(IntervalEditPart.VISUAL_ID == nodeVisualID) {
+ if (IntervalEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InstanceValueEditPart.VISUAL_ID == nodeVisualID) {
+ if (InstanceValueEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CommentEditPart.VISUAL_ID == nodeVisualID) {
+ if (CommentEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DurationConstraintEditPart.VISUAL_ID == nodeVisualID) {
+ if (DurationConstraintEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(TimeConstraintEditPart.VISUAL_ID == nodeVisualID) {
+ if (TimeConstraintEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(IntervalConstraintEditPart.VISUAL_ID == nodeVisualID) {
+ if (IntervalConstraintEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionConstraintEditPart.VISUAL_ID == nodeVisualID) {
+ if (InteractionConstraintEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ConstraintEditPart.VISUAL_ID == nodeVisualID) {
+ if (ConstraintEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case ActivityCompositeEditPart.VISUAL_ID:
- if(ActivityCompositeNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (ActivityCompositeNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActivityCompositeFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (ActivityCompositeFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActivityCompositeCompartmentEditPart.VISUAL_ID == nodeVisualID) {
+ if (ActivityCompositeCompartmentEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PortEditPart.VISUAL_ID == nodeVisualID) {
+ if (PortEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ParameterEditPart.VISUAL_ID == nodeVisualID) {
+ if (ParameterEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case InteractionCompositeEditPart.VISUAL_ID:
- if(InteractionCompositeNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (InteractionCompositeNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionCompositeFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (InteractionCompositeFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionCompositeCompartmentEditPart.VISUAL_ID == nodeVisualID) {
+ if (InteractionCompositeCompartmentEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PortEditPart.VISUAL_ID == nodeVisualID) {
+ if (PortEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ParameterEditPart.VISUAL_ID == nodeVisualID) {
+ if (ParameterEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case ProtocolStateMachineCompositeEditPart.VISUAL_ID:
- if(ProtocolStateMachineCompositeNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (ProtocolStateMachineCompositeNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ProtocolStateMachineCompositeFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (ProtocolStateMachineCompositeFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ProtocolStateMachineCompositeCompartmentEditPart.VISUAL_ID == nodeVisualID) {
+ if (ProtocolStateMachineCompositeCompartmentEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PortEditPart.VISUAL_ID == nodeVisualID) {
+ if (PortEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ParameterEditPart.VISUAL_ID == nodeVisualID) {
+ if (ParameterEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case StateMachineCompositeEditPart.VISUAL_ID:
- if(StateMachineCompositeNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (StateMachineCompositeNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(StateMachineCompositeFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (StateMachineCompositeFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(StateMachineCompositeCompartmentEditPart.VISUAL_ID == nodeVisualID) {
+ if (StateMachineCompositeCompartmentEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PortEditPart.VISUAL_ID == nodeVisualID) {
+ if (PortEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ParameterEditPart.VISUAL_ID == nodeVisualID) {
+ if (ParameterEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case FunctionBehaviorCompositeEditPart.VISUAL_ID:
- if(FunctionBehaviorCompositeNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (FunctionBehaviorCompositeNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(FunctionBehaviorCompositeFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (FunctionBehaviorCompositeFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(FunctionBehaviorCompositeCompartmentEditPart.VISUAL_ID == nodeVisualID) {
+ if (FunctionBehaviorCompositeCompartmentEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PortEditPart.VISUAL_ID == nodeVisualID) {
+ if (PortEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ParameterEditPart.VISUAL_ID == nodeVisualID) {
+ if (ParameterEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case OpaqueBehaviorCompositeEditPart.VISUAL_ID:
- if(OpaqueBehaviorCompositeNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (OpaqueBehaviorCompositeNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(OpaqueBehaviorCompositeFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (OpaqueBehaviorCompositeFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(OpaqueBehaviorCompositeCompartmentEditPart.VISUAL_ID == nodeVisualID) {
+ if (OpaqueBehaviorCompositeCompartmentEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PortEditPart.VISUAL_ID == nodeVisualID) {
+ if (PortEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ParameterEditPart.VISUAL_ID == nodeVisualID) {
+ if (ParameterEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case ComponentCompositeEditPart.VISUAL_ID:
- if(ComponentCompositeNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (ComponentCompositeNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ComponentCompositeFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (ComponentCompositeFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ComponentCompositeCompartmentEditPart.VISUAL_ID == nodeVisualID) {
+ if (ComponentCompositeCompartmentEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PortEditPart.VISUAL_ID == nodeVisualID) {
+ if (PortEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case DeviceCompositeEditPart.VISUAL_ID:
- if(DeviceCompositeNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (DeviceCompositeNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeviceCompositeFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (DeviceCompositeFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeviceCompositeCompartmentEditPart.VISUAL_ID == nodeVisualID) {
+ if (DeviceCompositeCompartmentEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PortEditPart.VISUAL_ID == nodeVisualID) {
+ if (PortEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case ExecutionEnvironmentCompositeEditPart.VISUAL_ID:
- if(ExecutionEnvironmentCompositeNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (ExecutionEnvironmentCompositeNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ExecutionEnvironmentCompositeFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (ExecutionEnvironmentCompositeFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ExecutionEnvironmentCompositeCompartmentEditPart.VISUAL_ID == nodeVisualID) {
+ if (ExecutionEnvironmentCompositeCompartmentEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PortEditPart.VISUAL_ID == nodeVisualID) {
+ if (PortEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case NodeCompositeEditPart.VISUAL_ID:
- if(NodeCompositeNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (NodeCompositeNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(NodeCompositeFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (NodeCompositeFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(NodeCompositeCompartmentEditPart.VISUAL_ID == nodeVisualID) {
+ if (NodeCompositeCompartmentEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PortEditPart.VISUAL_ID == nodeVisualID) {
+ if (PortEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case ClassCompositeEditPart.VISUAL_ID:
- if(ClassCompositeNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (ClassCompositeNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ClassCompositeFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (ClassCompositeFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ClassCompositeCompartmentEditPart.VISUAL_ID == nodeVisualID) {
+ if (ClassCompositeCompartmentEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PortEditPart.VISUAL_ID == nodeVisualID) {
+ if (PortEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case CollaborationCompositeEditPart.VISUAL_ID:
- if(CollaborationCompositeNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (CollaborationCompositeNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationCompositeFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (CollaborationCompositeFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationCompositeCompartmentEditPart.VISUAL_ID == nodeVisualID) {
+ if (CollaborationCompositeCompartmentEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case InterfaceEditPart.VISUAL_ID:
- if(InterfaceNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (InterfaceNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InterfaceFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (InterfaceFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case PrimitiveTypeEditPart.VISUAL_ID:
- if(PrimitiveTypeNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (PrimitiveTypeNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PrimitiveTypeFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (PrimitiveTypeFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case EnumerationEditPart.VISUAL_ID:
- if(EnumerationNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (EnumerationNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(EnumerationFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (EnumerationFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(EnumerationEnumerationLiteralCompartmentEditPart.VISUAL_ID == nodeVisualID) {
+ if (EnumerationEnumerationLiteralCompartmentEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(EnumerationLiteralEditPartCLN.VISUAL_ID == nodeVisualID) {
+ if (EnumerationLiteralEditPartCLN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case DataTypeEditPart.VISUAL_ID:
- if(DataTypeNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (DataTypeNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DataTypeFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (DataTypeFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DataTypeAttributeCompartmentEditPart.VISUAL_ID == nodeVisualID) {
+ if (DataTypeAttributeCompartmentEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DataTypeOperationCompartmentEditPart.VISUAL_ID == nodeVisualID) {
+ if (DataTypeOperationCompartmentEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case ActorEditPart.VISUAL_ID:
- if(ActorNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (ActorNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActorFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (ActorFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case DeploymentSpecificationEditPart.VISUAL_ID:
- if(DeploymentSpecificationNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (DeploymentSpecificationNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeploymentSpecificationFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (DeploymentSpecificationFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case ArtifactEditPart.VISUAL_ID:
- if(ArtifactNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (ArtifactNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ArtifactFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (ArtifactFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case InformationItemEditPart.VISUAL_ID:
- if(InformationItemNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (InformationItemNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InformationItemFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (InformationItemFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case SignalEditPart.VISUAL_ID:
- if(SignalNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (SignalNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(SignalFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (SignalFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case UseCaseEditPart.VISUAL_ID:
- if(UseCaseNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (UseCaseNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(UseCaseFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (UseCaseFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case SignalEventEditPart.VISUAL_ID:
- if(SignalEventNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (SignalEventNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(SignalEventFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (SignalEventFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case CallEventEditPart.VISUAL_ID:
- if(CallEventNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (CallEventNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CallEventFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (CallEventFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case AnyReceiveEventEditPart.VISUAL_ID:
- if(AnyReceiveEventNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (AnyReceiveEventNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(AnyReceiveEventFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (AnyReceiveEventFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case ChangeEventEditPart.VISUAL_ID:
- if(ChangeEventNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (ChangeEventNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ChangeEventFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (ChangeEventFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case TimeEventEditPart.VISUAL_ID:
- if(TimeEventNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (TimeEventNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(TimeEventFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (TimeEventFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case DurationObservationEditPart.VISUAL_ID:
- if(DurationObservationNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (DurationObservationNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DurationObservationStereotypeLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (DurationObservationStereotypeLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case TimeObservationEditPart.VISUAL_ID:
- if(TimeObservationNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (TimeObservationNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(TimeObservationStereotypeLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (TimeObservationStereotypeLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case LiteralBooleanEditPart.VISUAL_ID:
- if(LiteralBooleanNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (LiteralBooleanNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(LiteralBooleanFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (LiteralBooleanFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case LiteralIntegerEditPart.VISUAL_ID:
- if(LiteralIntegerNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (LiteralIntegerNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(LiteralIntegerFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (LiteralIntegerFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case LiteralNullEditPart.VISUAL_ID:
- if(LiteralNullNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (LiteralNullNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(LiteralNullFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (LiteralNullFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case LiteralStringEditPart.VISUAL_ID:
- if(LiteralStringNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (LiteralStringNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(LiteralStringFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (LiteralStringFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case LiteralUnlimitedNaturalEditPart.VISUAL_ID:
- if(LiteralUnlimitedNaturalNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (LiteralUnlimitedNaturalNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(LiteralUnlimitedNaturalFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (LiteralUnlimitedNaturalFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case StringExpressionEditPart.VISUAL_ID:
- if(StringExpressionNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (StringExpressionNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(StringExpressionFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (StringExpressionFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case OpaqueExpressionEditPart.VISUAL_ID:
- if(OpaqueExpressionNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (OpaqueExpressionNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(OpaqueExpressionFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (OpaqueExpressionFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case TimeExpressionEditPart.VISUAL_ID:
- if(TimeExpressionNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (TimeExpressionNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(TimeExpressionFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (TimeExpressionFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case ExpressionEditPart.VISUAL_ID:
- if(ExpressionNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (ExpressionNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ExpressionFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (ExpressionFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case DurationEditPart.VISUAL_ID:
- if(DurationNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (DurationNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DurationFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (DurationFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case TimeIntervalEditPart.VISUAL_ID:
- if(TimeIntervalNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (TimeIntervalNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(TimeIntervalFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (TimeIntervalFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case DurationIntervalEditPart.VISUAL_ID:
- if(DurationIntervalNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (DurationIntervalNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DurationIntervalFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (DurationIntervalFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case IntervalEditPart.VISUAL_ID:
- if(IntervalNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (IntervalNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(IntervalFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (IntervalFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case InstanceValueEditPart.VISUAL_ID:
- if(InstanceValueNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (InstanceValueNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InstanceValueFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (InstanceValueFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case CommentEditPart.VISUAL_ID:
- if(CommentBodyEditPart.VISUAL_ID == nodeVisualID) {
+ if (CommentBodyEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case DurationConstraintEditPart.VISUAL_ID:
- if(DurationConstraintNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (DurationConstraintNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DurationConstraintSpecificationEditPart.VISUAL_ID == nodeVisualID) {
+ if (DurationConstraintSpecificationEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case TimeConstraintEditPart.VISUAL_ID:
- if(TimeConstraintNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (TimeConstraintNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(TimeConstraintSpecificationEditPart.VISUAL_ID == nodeVisualID) {
+ if (TimeConstraintSpecificationEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case IntervalConstraintEditPart.VISUAL_ID:
- if(IntervalConstraintNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (IntervalConstraintNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(IntervalConstraintSpecificationEditPart.VISUAL_ID == nodeVisualID) {
+ if (IntervalConstraintSpecificationEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case InteractionConstraintEditPart.VISUAL_ID:
- if(InteractionConstraintNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (InteractionConstraintNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionConstraintSpecificationEditPart.VISUAL_ID == nodeVisualID) {
+ if (InteractionConstraintSpecificationEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case ConstraintEditPart.VISUAL_ID:
- if(ConstraintNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (ConstraintNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ConstraintSpecificationEditPart.VISUAL_ID == nodeVisualID) {
+ if (ConstraintSpecificationEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case BehaviorPortEditPart.VISUAL_ID:
- if(BehaviorPortFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (BehaviorPortFloatingLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case PortEditPart.VISUAL_ID:
- if(PortNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (PortNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PortAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
+ if (PortAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case ParameterEditPart.VISUAL_ID:
- if(ParameterNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (ParameterNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ParameterAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
+ if (ParameterAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case PropertyPartEditPartCN.VISUAL_ID:
- if(PropertyPartNameEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PropertyPartNameEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PropertyPartFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PropertyPartFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PropertyPartCompartmentEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PropertyPartCompartmentEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PortEditPart.VISUAL_ID == nodeVisualID) {
+ if (PortEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case CollaborationRoleEditPartCN.VISUAL_ID:
- if(CollaborationRoleNameEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationRoleNameEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationRoleFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationRoleFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case CollaborationUseEditPartCN.VISUAL_ID:
- if(CollaborationUseNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (CollaborationUseNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationUseFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationUseFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case ActivityCompositeEditPartCN.VISUAL_ID:
- if(ActivityCompositeNameEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActivityCompositeNameEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActivityCompositeFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActivityCompositeFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActivityCompositeCompartmentEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActivityCompositeCompartmentEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PortEditPart.VISUAL_ID == nodeVisualID) {
+ if (PortEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ParameterEditPart.VISUAL_ID == nodeVisualID) {
+ if (ParameterEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case InteractionCompositeEditPartCN.VISUAL_ID:
- if(InteractionCompositeNameEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionCompositeNameEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionCompositeFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionCompositeFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionCompositeCompartmentEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionCompositeCompartmentEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PortEditPart.VISUAL_ID == nodeVisualID) {
+ if (PortEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ParameterEditPart.VISUAL_ID == nodeVisualID) {
+ if (ParameterEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case ProtocolStateMachineCompositeEditPartCN.VISUAL_ID:
- if(ProtocolStateMachineCompositeNameEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ProtocolStateMachineCompositeNameEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ProtocolStateMachineCompositeFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ProtocolStateMachineCompositeFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ProtocolStateMachineCompositeCompartmentEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ProtocolStateMachineCompositeCompartmentEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PortEditPart.VISUAL_ID == nodeVisualID) {
+ if (PortEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ParameterEditPart.VISUAL_ID == nodeVisualID) {
+ if (ParameterEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case StateMachineCompositeEditPartCN.VISUAL_ID:
- if(StateMachineCompositeNameEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (StateMachineCompositeNameEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(StateMachineCompositeFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (StateMachineCompositeFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(StateMachineCompositeCompartmentEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (StateMachineCompositeCompartmentEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PortEditPart.VISUAL_ID == nodeVisualID) {
+ if (PortEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ParameterEditPart.VISUAL_ID == nodeVisualID) {
+ if (ParameterEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case FunctionBehaviorCompositeEditPartCN.VISUAL_ID:
- if(FunctionBehaviorCompositeNameEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (FunctionBehaviorCompositeNameEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(FunctionBehaviorCompositeFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (FunctionBehaviorCompositeFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(FunctionBehaviorCompositeCompartmentEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (FunctionBehaviorCompositeCompartmentEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PortEditPart.VISUAL_ID == nodeVisualID) {
+ if (PortEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ParameterEditPart.VISUAL_ID == nodeVisualID) {
+ if (ParameterEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case OpaqueBehaviorCompositeEditPartCN.VISUAL_ID:
- if(OpaqueBehaviorCompositeNameEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (OpaqueBehaviorCompositeNameEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(OpaqueBehaviorCompositeFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (OpaqueBehaviorCompositeFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(OpaqueBehaviorCompositeCompartmentEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (OpaqueBehaviorCompositeCompartmentEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PortEditPart.VISUAL_ID == nodeVisualID) {
+ if (PortEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ParameterEditPart.VISUAL_ID == nodeVisualID) {
+ if (ParameterEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case ComponentCompositeEditPartCN.VISUAL_ID:
- if(ComponentCompositeNameEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ComponentCompositeNameEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ComponentCompositeFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ComponentCompositeFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ComponentCompositeCompartmentEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ComponentCompositeCompartmentEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PortEditPart.VISUAL_ID == nodeVisualID) {
+ if (PortEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case DeviceCompositeEditPartCN.VISUAL_ID:
- if(DeviceCompositeNameEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeviceCompositeNameEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeviceCompositeFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeviceCompositeFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeviceCompositeCompartmentEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeviceCompositeCompartmentEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PortEditPart.VISUAL_ID == nodeVisualID) {
+ if (PortEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID:
- if(ExecutionEnvironmentCompositeNameEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ExecutionEnvironmentCompositeNameEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ExecutionEnvironmentCompositeFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ExecutionEnvironmentCompositeFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ExecutionEnvironmentCompositeCompartmentEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ExecutionEnvironmentCompositeCompartmentEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PortEditPart.VISUAL_ID == nodeVisualID) {
+ if (PortEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case NodeCompositeEditPartCN.VISUAL_ID:
- if(NodeCompositeNameEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (NodeCompositeNameEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(NodeCompositeFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (NodeCompositeFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(NodeCompositeCompartmentEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (NodeCompositeCompartmentEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PortEditPart.VISUAL_ID == nodeVisualID) {
+ if (PortEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case ClassCompositeEditPartCN.VISUAL_ID:
- if(ClassCompositeNameEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ClassCompositeNameEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ClassCompositeFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ClassCompositeFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ClassCompositeCompartmentEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ClassCompositeCompartmentEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PortEditPart.VISUAL_ID == nodeVisualID) {
+ if (PortEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case CollaborationCompositeEditPartCN.VISUAL_ID:
- if(CollaborationCompositeNameEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationCompositeNameEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationCompositeFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationCompositeFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationCompositeCompartmentEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationCompositeCompartmentEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case InterfaceEditPartCN.VISUAL_ID:
- if(InterfaceNameEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InterfaceNameEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InterfaceFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InterfaceFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case PrimitiveTypeEditPartCN.VISUAL_ID:
- if(PrimitiveTypeNameEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PrimitiveTypeNameEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PrimitiveTypeFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PrimitiveTypeFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case EnumerationEditPartCN.VISUAL_ID:
- if(EnumerationNameEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (EnumerationNameEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(EnumerationFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (EnumerationFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(EnumerationEnumerationLiteralCompartmentEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (EnumerationEnumerationLiteralCompartmentEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(EnumerationLiteralEditPartCLN.VISUAL_ID == nodeVisualID) {
+ if (EnumerationLiteralEditPartCLN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case DataTypeEditPartCN.VISUAL_ID:
- if(DataTypeNameEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DataTypeNameEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DataTypeFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DataTypeFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DataTypeAttributeCompartmentEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DataTypeAttributeCompartmentEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DataTypeOperationCompartmentEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DataTypeOperationCompartmentEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case ActorEditPartCN.VISUAL_ID:
- if(ActorNameEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActorNameEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActorFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActorFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case DeploymentSpecificationEditPartCN.VISUAL_ID:
- if(DeploymentSpecificationNameEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeploymentSpecificationNameEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeploymentSpecificationFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeploymentSpecificationFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case ArtifactEditPartCN.VISUAL_ID:
- if(ArtifactNameEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ArtifactNameEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ArtifactFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ArtifactFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case InformationItemEditPartCN.VISUAL_ID:
- if(InformationItemNameEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InformationItemNameEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InformationItemFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InformationItemFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case SignalEditPartCN.VISUAL_ID:
- if(SignalNameEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (SignalNameEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(SignalFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (SignalFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case UseCaseEditPartCN.VISUAL_ID:
- if(UseCaseNameEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (UseCaseNameEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(UseCaseFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (UseCaseFloatingLabelEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case CommentEditPartCN.VISUAL_ID:
- if(CommentBodyEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CommentBodyEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case DurationConstraintEditPartCN.VISUAL_ID:
- if(DurationConstraintNameEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DurationConstraintNameEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DurationConstraintSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DurationConstraintSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case TimeConstraintEditPartCN.VISUAL_ID:
- if(TimeConstraintNameEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (TimeConstraintNameEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(TimeConstraintSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (TimeConstraintSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case IntervalConstraintEditPartCN.VISUAL_ID:
- if(IntervalConstraintNameEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (IntervalConstraintNameEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(IntervalConstraintSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (IntervalConstraintSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case InteractionConstraintEditPartCN.VISUAL_ID:
- if(InteractionConstraintNameEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionConstraintNameEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionConstraintSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionConstraintSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case ConstraintEditPartCN.VISUAL_ID:
- if(ConstraintNameEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ConstraintNameEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ConstraintSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ConstraintSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case DataTypeAttributeCompartmentEditPart.VISUAL_ID:
- if(PropertyEditPartCLN.VISUAL_ID == nodeVisualID) {
+ if (PropertyEditPartCLN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case DataTypeOperationCompartmentEditPart.VISUAL_ID:
- if(OperationEditPartCLN.VISUAL_ID == nodeVisualID) {
+ if (OperationEditPartCLN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case DataTypeAttributeCompartmentEditPartCN.VISUAL_ID:
- if(PropertyEditPartCLN.VISUAL_ID == nodeVisualID) {
+ if (PropertyEditPartCLN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case DataTypeOperationCompartmentEditPartCN.VISUAL_ID:
- if(OperationEditPartCLN.VISUAL_ID == nodeVisualID) {
+ if (OperationEditPartCLN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case EnumerationEnumerationLiteralCompartmentEditPart.VISUAL_ID:
- if(EnumerationLiteralEditPartCLN.VISUAL_ID == nodeVisualID) {
+ if (EnumerationLiteralEditPartCLN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case EnumerationEnumerationLiteralCompartmentEditPartCN.VISUAL_ID:
- if(EnumerationLiteralEditPartCLN.VISUAL_ID == nodeVisualID) {
+ if (EnumerationLiteralEditPartCLN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case ActivityCompositeCompartmentEditPartCN.VISUAL_ID:
- if(ParameterEditPart.VISUAL_ID == nodeVisualID) {
+ if (ParameterEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActivityCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActivityCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ProtocolStateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ProtocolStateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(StateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (StateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(FunctionBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (FunctionBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(OpaqueBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (OpaqueBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ComponentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ComponentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeviceCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeviceCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(NodeCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (NodeCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ClassCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ClassCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InterfaceEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InterfaceEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PrimitiveTypeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PrimitiveTypeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(EnumerationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (EnumerationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DataTypeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DataTypeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActorEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActorEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeploymentSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeploymentSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InformationItemEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InformationItemEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(SignalEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (SignalEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(UseCaseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (UseCaseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CommentEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CommentEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case InteractionCompositeCompartmentEditPartCN.VISUAL_ID:
- if(ParameterEditPart.VISUAL_ID == nodeVisualID) {
+ if (ParameterEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActivityCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActivityCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ProtocolStateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ProtocolStateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(StateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (StateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(FunctionBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (FunctionBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(OpaqueBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (OpaqueBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ComponentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ComponentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeviceCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeviceCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(NodeCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (NodeCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ClassCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ClassCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InterfaceEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InterfaceEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PrimitiveTypeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PrimitiveTypeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(EnumerationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (EnumerationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DataTypeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DataTypeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActorEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActorEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeploymentSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeploymentSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InformationItemEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InformationItemEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(SignalEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (SignalEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(UseCaseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (UseCaseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CommentEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CommentEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case ProtocolStateMachineCompositeCompartmentEditPartCN.VISUAL_ID:
- if(ParameterEditPart.VISUAL_ID == nodeVisualID) {
+ if (ParameterEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActivityCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActivityCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ProtocolStateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ProtocolStateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(StateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (StateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(FunctionBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (FunctionBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(OpaqueBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (OpaqueBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ComponentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ComponentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeviceCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeviceCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(NodeCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (NodeCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ClassCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ClassCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InterfaceEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InterfaceEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PrimitiveTypeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PrimitiveTypeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(EnumerationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (EnumerationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DataTypeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DataTypeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActorEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActorEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeploymentSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeploymentSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InformationItemEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InformationItemEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(SignalEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (SignalEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(UseCaseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (UseCaseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CommentEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CommentEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case StateMachineCompositeCompartmentEditPartCN.VISUAL_ID:
- if(ParameterEditPart.VISUAL_ID == nodeVisualID) {
+ if (ParameterEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActivityCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActivityCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ProtocolStateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ProtocolStateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(StateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (StateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(FunctionBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (FunctionBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(OpaqueBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (OpaqueBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ComponentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ComponentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeviceCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeviceCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(NodeCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (NodeCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ClassCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ClassCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InterfaceEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InterfaceEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PrimitiveTypeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PrimitiveTypeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(EnumerationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (EnumerationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DataTypeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DataTypeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActorEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActorEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeploymentSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeploymentSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InformationItemEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InformationItemEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(SignalEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (SignalEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(UseCaseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (UseCaseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CommentEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CommentEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case FunctionBehaviorCompositeCompartmentEditPartCN.VISUAL_ID:
- if(ParameterEditPart.VISUAL_ID == nodeVisualID) {
+ if (ParameterEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActivityCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActivityCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ProtocolStateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ProtocolStateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(StateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (StateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(FunctionBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (FunctionBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(OpaqueBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (OpaqueBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ComponentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ComponentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeviceCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeviceCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(NodeCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (NodeCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ClassCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ClassCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InterfaceEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InterfaceEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PrimitiveTypeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PrimitiveTypeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(EnumerationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (EnumerationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DataTypeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DataTypeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActorEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActorEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeploymentSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeploymentSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InformationItemEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InformationItemEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(SignalEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (SignalEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(UseCaseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (UseCaseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CommentEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CommentEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case OpaqueBehaviorCompositeCompartmentEditPartCN.VISUAL_ID:
- if(ParameterEditPart.VISUAL_ID == nodeVisualID) {
+ if (ParameterEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActivityCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActivityCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ProtocolStateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ProtocolStateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(StateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (StateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(FunctionBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (FunctionBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(OpaqueBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (OpaqueBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ComponentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ComponentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeviceCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeviceCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(NodeCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (NodeCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ClassCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ClassCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InterfaceEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InterfaceEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PrimitiveTypeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PrimitiveTypeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(EnumerationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (EnumerationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DataTypeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DataTypeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActorEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActorEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeploymentSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeploymentSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InformationItemEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InformationItemEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(SignalEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (SignalEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(UseCaseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (UseCaseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CommentEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CommentEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case ComponentCompositeCompartmentEditPartCN.VISUAL_ID:
- if(PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActivityCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActivityCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ProtocolStateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ProtocolStateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(StateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (StateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(FunctionBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (FunctionBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(OpaqueBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (OpaqueBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ComponentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ComponentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeviceCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeviceCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(NodeCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (NodeCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ClassCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ClassCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InterfaceEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InterfaceEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PrimitiveTypeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PrimitiveTypeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(EnumerationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (EnumerationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DataTypeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DataTypeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActorEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActorEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeploymentSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeploymentSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InformationItemEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InformationItemEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(SignalEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (SignalEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(UseCaseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (UseCaseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CommentEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CommentEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case DeviceCompositeCompartmentEditPartCN.VISUAL_ID:
- if(PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActivityCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActivityCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ProtocolStateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ProtocolStateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(StateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (StateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(FunctionBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (FunctionBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(OpaqueBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (OpaqueBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ComponentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ComponentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeviceCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeviceCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(NodeCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (NodeCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ClassCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ClassCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InterfaceEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InterfaceEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PrimitiveTypeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PrimitiveTypeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(EnumerationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (EnumerationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DataTypeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DataTypeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActorEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActorEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeploymentSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeploymentSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InformationItemEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InformationItemEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(SignalEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (SignalEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(UseCaseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (UseCaseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CommentEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CommentEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case ExecutionEnvironmentCompositeCompartmentEditPartCN.VISUAL_ID:
- if(PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActivityCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActivityCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ProtocolStateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ProtocolStateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(StateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (StateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(FunctionBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (FunctionBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(OpaqueBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (OpaqueBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ComponentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ComponentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeviceCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeviceCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(NodeCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (NodeCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ClassCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ClassCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InterfaceEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InterfaceEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PrimitiveTypeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PrimitiveTypeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(EnumerationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (EnumerationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DataTypeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DataTypeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActorEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActorEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeploymentSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeploymentSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InformationItemEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InformationItemEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(SignalEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (SignalEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(UseCaseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (UseCaseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CommentEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CommentEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case NodeCompositeCompartmentEditPartCN.VISUAL_ID:
- if(PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActivityCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActivityCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ProtocolStateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ProtocolStateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(StateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (StateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(FunctionBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (FunctionBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(OpaqueBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (OpaqueBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ComponentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ComponentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeviceCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeviceCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(NodeCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (NodeCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ClassCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ClassCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InterfaceEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InterfaceEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PrimitiveTypeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PrimitiveTypeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(EnumerationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (EnumerationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DataTypeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DataTypeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActorEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActorEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeploymentSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeploymentSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InformationItemEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InformationItemEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(SignalEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (SignalEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(UseCaseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (UseCaseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CommentEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CommentEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case ClassCompositeCompartmentEditPartCN.VISUAL_ID:
- if(PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActivityCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActivityCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ProtocolStateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ProtocolStateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(StateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (StateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(FunctionBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (FunctionBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(OpaqueBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (OpaqueBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ComponentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ComponentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeviceCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeviceCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(NodeCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (NodeCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ClassCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ClassCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InterfaceEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InterfaceEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PrimitiveTypeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PrimitiveTypeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(EnumerationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (EnumerationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DataTypeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DataTypeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActorEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActorEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeploymentSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeploymentSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InformationItemEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InformationItemEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(SignalEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (SignalEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(UseCaseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (UseCaseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CommentEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CommentEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(BehaviorPortEditPart.VISUAL_ID == nodeVisualID) {
+ if (BehaviorPortEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case CollaborationCompositeCompartmentEditPartCN.VISUAL_ID:
- if(PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CommentEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CommentEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationRoleEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationRoleEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case ActivityCompositeCompartmentEditPart.VISUAL_ID:
- if(ParameterEditPart.VISUAL_ID == nodeVisualID) {
+ if (ParameterEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActivityCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActivityCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ProtocolStateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ProtocolStateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(StateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (StateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(FunctionBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (FunctionBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(OpaqueBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (OpaqueBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ComponentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ComponentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeviceCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeviceCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(NodeCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (NodeCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ClassCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ClassCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InterfaceEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InterfaceEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PrimitiveTypeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PrimitiveTypeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(EnumerationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (EnumerationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DataTypeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DataTypeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActorEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActorEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeploymentSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeploymentSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InformationItemEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InformationItemEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(SignalEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (SignalEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(UseCaseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (UseCaseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CommentEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CommentEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case InteractionCompositeCompartmentEditPart.VISUAL_ID:
- if(ParameterEditPart.VISUAL_ID == nodeVisualID) {
+ if (ParameterEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActivityCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActivityCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ProtocolStateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ProtocolStateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(StateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (StateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(FunctionBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (FunctionBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(OpaqueBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (OpaqueBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ComponentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ComponentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeviceCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeviceCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(NodeCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (NodeCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ClassCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ClassCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InterfaceEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InterfaceEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PrimitiveTypeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PrimitiveTypeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(EnumerationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (EnumerationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DataTypeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DataTypeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActorEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActorEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeploymentSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeploymentSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InformationItemEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InformationItemEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(SignalEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (SignalEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(UseCaseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (UseCaseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CommentEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CommentEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case ProtocolStateMachineCompositeCompartmentEditPart.VISUAL_ID:
- if(ParameterEditPart.VISUAL_ID == nodeVisualID) {
+ if (ParameterEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActivityCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActivityCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ProtocolStateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ProtocolStateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(StateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (StateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(FunctionBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (FunctionBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(OpaqueBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (OpaqueBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ComponentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ComponentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeviceCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeviceCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(NodeCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (NodeCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ClassCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ClassCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InterfaceEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InterfaceEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PrimitiveTypeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PrimitiveTypeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(EnumerationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (EnumerationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DataTypeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DataTypeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActorEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActorEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeploymentSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeploymentSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InformationItemEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InformationItemEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(SignalEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (SignalEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(UseCaseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (UseCaseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CommentEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CommentEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case StateMachineCompositeCompartmentEditPart.VISUAL_ID:
- if(ParameterEditPart.VISUAL_ID == nodeVisualID) {
+ if (ParameterEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActivityCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActivityCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ProtocolStateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ProtocolStateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(StateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (StateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(FunctionBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (FunctionBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(OpaqueBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (OpaqueBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ComponentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ComponentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeviceCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeviceCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(NodeCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (NodeCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ClassCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ClassCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InterfaceEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InterfaceEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PrimitiveTypeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PrimitiveTypeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(EnumerationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (EnumerationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DataTypeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DataTypeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActorEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActorEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeploymentSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeploymentSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InformationItemEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InformationItemEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(SignalEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (SignalEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(UseCaseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (UseCaseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CommentEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CommentEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case FunctionBehaviorCompositeCompartmentEditPart.VISUAL_ID:
- if(ParameterEditPart.VISUAL_ID == nodeVisualID) {
+ if (ParameterEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActivityCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActivityCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ProtocolStateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ProtocolStateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(StateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (StateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(FunctionBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (FunctionBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(OpaqueBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (OpaqueBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ComponentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ComponentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeviceCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeviceCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(NodeCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (NodeCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ClassCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ClassCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InterfaceEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InterfaceEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PrimitiveTypeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PrimitiveTypeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(EnumerationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (EnumerationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DataTypeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DataTypeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActorEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActorEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeploymentSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeploymentSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InformationItemEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InformationItemEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(SignalEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (SignalEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(UseCaseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (UseCaseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CommentEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CommentEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case OpaqueBehaviorCompositeCompartmentEditPart.VISUAL_ID:
- if(ParameterEditPart.VISUAL_ID == nodeVisualID) {
+ if (ParameterEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActivityCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActivityCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ProtocolStateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ProtocolStateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(StateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (StateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(FunctionBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (FunctionBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(OpaqueBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (OpaqueBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ComponentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ComponentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeviceCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeviceCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(NodeCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (NodeCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ClassCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ClassCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InterfaceEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InterfaceEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PrimitiveTypeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PrimitiveTypeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(EnumerationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (EnumerationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DataTypeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DataTypeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActorEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActorEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeploymentSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeploymentSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InformationItemEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InformationItemEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(SignalEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (SignalEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(UseCaseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (UseCaseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CommentEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CommentEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case ComponentCompositeCompartmentEditPart.VISUAL_ID:
- if(PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActivityCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActivityCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ProtocolStateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ProtocolStateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(StateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (StateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(FunctionBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (FunctionBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(OpaqueBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (OpaqueBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ComponentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ComponentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeviceCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeviceCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(NodeCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (NodeCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ClassCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ClassCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InterfaceEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InterfaceEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PrimitiveTypeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PrimitiveTypeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(EnumerationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (EnumerationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DataTypeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DataTypeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActorEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActorEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeploymentSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeploymentSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InformationItemEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InformationItemEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(SignalEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (SignalEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(UseCaseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (UseCaseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CommentEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CommentEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case DeviceCompositeCompartmentEditPart.VISUAL_ID:
- if(PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActivityCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActivityCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ProtocolStateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ProtocolStateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(StateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (StateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(FunctionBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (FunctionBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(OpaqueBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (OpaqueBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ComponentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ComponentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeviceCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeviceCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(NodeCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (NodeCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ClassCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ClassCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InterfaceEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InterfaceEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PrimitiveTypeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PrimitiveTypeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(EnumerationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (EnumerationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DataTypeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DataTypeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActorEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActorEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeploymentSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeploymentSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InformationItemEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InformationItemEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(SignalEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (SignalEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(UseCaseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (UseCaseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CommentEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CommentEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case ExecutionEnvironmentCompositeCompartmentEditPart.VISUAL_ID:
- if(PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActivityCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActivityCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ProtocolStateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ProtocolStateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(StateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (StateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(FunctionBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (FunctionBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(OpaqueBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (OpaqueBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ComponentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ComponentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeviceCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeviceCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(NodeCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (NodeCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ClassCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ClassCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InterfaceEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InterfaceEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PrimitiveTypeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PrimitiveTypeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(EnumerationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (EnumerationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DataTypeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DataTypeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActorEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActorEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeploymentSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeploymentSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InformationItemEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InformationItemEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(SignalEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (SignalEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(UseCaseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (UseCaseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CommentEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CommentEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case NodeCompositeCompartmentEditPart.VISUAL_ID:
- if(PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActivityCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActivityCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ProtocolStateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ProtocolStateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(StateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (StateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(FunctionBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (FunctionBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(OpaqueBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (OpaqueBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ComponentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ComponentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeviceCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeviceCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(NodeCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (NodeCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ClassCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ClassCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InterfaceEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InterfaceEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PrimitiveTypeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PrimitiveTypeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(EnumerationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (EnumerationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DataTypeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DataTypeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActorEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActorEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeploymentSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeploymentSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InformationItemEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InformationItemEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(SignalEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (SignalEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(UseCaseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (UseCaseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CommentEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CommentEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case ClassCompositeCompartmentEditPart.VISUAL_ID:
- if(PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActivityCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActivityCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ProtocolStateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ProtocolStateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(StateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (StateMachineCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(FunctionBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (FunctionBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(OpaqueBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (OpaqueBehaviorCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ComponentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ComponentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeviceCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeviceCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(NodeCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (NodeCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ClassCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ClassCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationCompositeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InterfaceEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InterfaceEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(PrimitiveTypeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PrimitiveTypeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(EnumerationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (EnumerationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DataTypeEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DataTypeEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ActorEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ActorEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeploymentSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DeploymentSpecificationEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ArtifactEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InformationItemEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InformationItemEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(SignalEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (SignalEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(UseCaseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (UseCaseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CommentEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CommentEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case CollaborationCompositeCompartmentEditPart.VISUAL_ID:
- if(PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationUseEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CommentEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CommentEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CollaborationRoleEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CollaborationRoleEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (DurationConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (TimeConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (IntervalConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (InteractionConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case PropertyPartCompartmentEditPartCN.VISUAL_ID:
- if(PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (PropertyPartEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
- if(CommentEditPartCN.VISUAL_ID == nodeVisualID) {
+ if (CommentEditPartCN.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case ComponentRealizationEditPart.VISUAL_ID:
- if(ComponentRealizationNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (ComponentRealizationNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ComponentRealizationAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
+ if (ComponentRealizationAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case InterfaceRealizationEditPart.VISUAL_ID:
- if(InterfaceRealizationNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (InterfaceRealizationNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InterfaceRealizationAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
+ if (InterfaceRealizationAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case SubstitutionEditPart.VISUAL_ID:
- if(SubstitutionNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (SubstitutionNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(SubstitutionAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
+ if (SubstitutionAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case RealizationEditPart.VISUAL_ID:
- if(RealizationNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (RealizationNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(RealizationAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
+ if (RealizationAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case ManifestationEditPart.VISUAL_ID:
- if(ManifestationNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (ManifestationNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ManifestationAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
+ if (ManifestationAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case AbstractionEditPart.VISUAL_ID:
- if(AbstractionNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (AbstractionNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(AbstractionAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
+ if (AbstractionAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case UsageEditPart.VISUAL_ID:
- if(UsageNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (UsageNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(UsageAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
+ if (UsageAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case DeploymentEditPart.VISUAL_ID:
- if(DeploymentNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (DeploymentNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DeploymentAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
+ if (DeploymentAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case RoleBindingEditPart.VISUAL_ID:
- if(RoleBindingRoleNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (RoleBindingRoleNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(RoleBindingAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
+ if (RoleBindingAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case DependencyEditPart.VISUAL_ID:
- if(DependencyNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (DependencyNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(DependencyAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
+ if (DependencyAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case ConnectorEditPart.VISUAL_ID:
- if(ConnectorAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
+ if (ConnectorAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ConnectorNameEditPart.VISUAL_ID == nodeVisualID) {
+ if (ConnectorNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ConnectorMultiplicitySourceEditPart.VISUAL_ID == nodeVisualID) {
+ if (ConnectorMultiplicitySourceEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(ConnectorMultiplicityTargetEditPart.VISUAL_ID == nodeVisualID) {
+ if (ConnectorMultiplicityTargetEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case GeneralizationEditPart.VISUAL_ID:
- if(GeneralizationAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
+ if (GeneralizationAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case RepresentationEditPart.VISUAL_ID:
- if(RepresentationTagLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (RepresentationTagLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
case InformationFlowEditPart.VISUAL_ID:
- if(InformationFlowConveyedLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (InformationFlowConveyedLabelEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
- if(InformationFlowAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
+ if (InformationFlowAppliedStereotypeEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
break;
@@ -5897,46 +5897,46 @@ public class UMLVisualIDRegistry {
* @generated
*/
public static int getLinkWithClassVisualID(EObject domainElement) {
- if(domainElement == null) {
+ if (domainElement == null) {
return -1;
}
- if(UMLPackage.eINSTANCE.getComponentRealization().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getComponentRealization().isSuperTypeOf(domainElement.eClass())) {
return ComponentRealizationEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInterfaceRealization().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInterfaceRealization().isSuperTypeOf(domainElement.eClass())) {
return InterfaceRealizationEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getSubstitution().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getSubstitution().isSuperTypeOf(domainElement.eClass())) {
return SubstitutionEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getRealization().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getRealization().isSuperTypeOf(domainElement.eClass())) {
return RealizationEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getManifestation().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getManifestation().isSuperTypeOf(domainElement.eClass())) {
return ManifestationEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getAbstraction().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getAbstraction().isSuperTypeOf(domainElement.eClass())) {
return AbstractionEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getUsage().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getUsage().isSuperTypeOf(domainElement.eClass())) {
return UsageEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDeployment().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getDeployment().isSuperTypeOf(domainElement.eClass())) {
return DeploymentEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDependency().isSuperTypeOf(domainElement.eClass()) && isDependency_4017((Dependency)domainElement)) {
+ if (UMLPackage.eINSTANCE.getDependency().isSuperTypeOf(domainElement.eClass()) && isDependency_4017((Dependency) domainElement)) {
return RoleBindingEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getDependency().isSuperTypeOf(domainElement.eClass()) && isDependency_4010((Dependency)domainElement)) {
+ if (UMLPackage.eINSTANCE.getDependency().isSuperTypeOf(domainElement.eClass()) && isDependency_4010((Dependency) domainElement)) {
return DependencyEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getConnector().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getConnector().isSuperTypeOf(domainElement.eClass())) {
return ConnectorEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getGeneralization().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getGeneralization().isSuperTypeOf(domainElement.eClass())) {
return GeneralizationEditPart.VISUAL_ID;
}
- if(UMLPackage.eINSTANCE.getInformationFlow().isSuperTypeOf(domainElement.eClass())) {
+ if (UMLPackage.eINSTANCE.getInformationFlow().isSuperTypeOf(domainElement.eClass())) {
return InformationFlowEditPart.VISUAL_ID;
}
return -1;
@@ -5956,18 +5956,19 @@ public class UMLVisualIDRegistry {
* @generated
*/
private static boolean isProperty_3070(View containerView, Property domainElement) {
- // Property / CollaborationRole constraint
+ // Property / CollaborationRole constraint
// Restriction for the case where domainElement owner is a Collaboration
// If the domainElement is not referenced as one of its owner role
// then it should be considered as a Property creation on Collaboration,
// else the test should return false and be considered as a representation of
// a collaboration role (ConnectableElement).
- if(containerView.getElement() instanceof Collaboration) {
- Collaboration graphicalParent = (Collaboration)containerView.getElement();
- if(graphicalParent.getCollaborationRoles().contains(domainElement)) {
+ if (containerView.getElement() instanceof Collaboration) {
+ Collaboration graphicalParent = (Collaboration) containerView.getElement();
+ if (graphicalParent.getCollaborationRoles().contains(domainElement)) {
return false;
}
}
+
// General case : no restriction
return true;
}
@@ -5977,9 +5978,9 @@ public class UMLVisualIDRegistry {
*/
private static boolean isDependency_4017(Dependency domainElement) {
// Test if the dependency is a RoleBinding
- if(domainElement.getOwner() instanceof CollaborationUse) {
- CollaborationUse owner = (CollaborationUse)domainElement.getOwner();
- if(owner.getRoleBindings().contains(domainElement)) {
+ if (domainElement.getOwner() instanceof CollaborationUse) {
+ CollaborationUse owner = (CollaborationUse) domainElement.getOwner();
+ if (owner.getRoleBindings().contains(domainElement)) {
return true;
}
}
@@ -5991,9 +5992,9 @@ public class UMLVisualIDRegistry {
*/
private static boolean isDependency_4010(Dependency domainElement) {
// Test if the dependency is not a RoleBinding
- if(domainElement.getOwner() instanceof CollaborationUse) {
- CollaborationUse owner = (CollaborationUse)domainElement.getOwner();
- if(owner.getRoleBindings().contains(domainElement)) {
+ if (domainElement.getOwner() instanceof CollaborationUse) {
+ CollaborationUse owner = (CollaborationUse) domainElement.getOwner();
+ if (owner.getRoleBindings().contains(domainElement)) {
return false;
}
}
@@ -6004,8 +6005,8 @@ public class UMLVisualIDRegistry {
* @generated
*/
public static boolean checkNodeVisualID(View containerView, EObject domainElement, int candidate) {
- if(candidate == -1) {
- //unrecognized id is always bad
+ if (candidate == -1) {
+ // unrecognized id is always bad
return false;
}
int basic = getNodeVisualID(containerView, domainElement);
@@ -6016,7 +6017,7 @@ public class UMLVisualIDRegistry {
* @generated
*/
public static boolean isCompartmentVisualID(int visualID) {
- switch(visualID) {
+ switch (visualID) {
case DataTypeAttributeCompartmentEditPart.VISUAL_ID:
case DataTypeOperationCompartmentEditPart.VISUAL_ID:
case DataTypeAttributeCompartmentEditPartCN.VISUAL_ID:
@@ -6059,7 +6060,7 @@ public class UMLVisualIDRegistry {
* @generated
*/
public static boolean isSemanticLeafVisualID(int visualID) {
- switch(visualID) {
+ switch (visualID) {
case CompositeStructureDiagramEditPart.VISUAL_ID:
return false;
case PrimitiveTypeEditPart.VISUAL_ID:
@@ -6130,7 +6131,6 @@ public class UMLVisualIDRegistry {
* @generated
*/
public static final DiagramStructure TYPED_INSTANCE = new DiagramStructure() {
-
/**
* @generated
*/
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/ValidateAction.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/ValidateAction.java
index 205831521a7..65fedc0a0ec 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/ValidateAction.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/part/ValidateAction.java
@@ -73,16 +73,19 @@ public class ValidateAction extends Action {
*/
public void run() {
IWorkbenchPart workbenchPart = page.getActivePart();
- if(workbenchPart instanceof IDiagramWorkbenchPart) {
- final IDiagramWorkbenchPart part = (IDiagramWorkbenchPart)workbenchPart;
+ if (workbenchPart instanceof IDiagramWorkbenchPart) {
+ final IDiagramWorkbenchPart part = (IDiagramWorkbenchPart) workbenchPart;
try {
- new WorkspaceModifyDelegatingOperation(new IRunnableWithProgress() {
+ new WorkspaceModifyDelegatingOperation(
+ new IRunnableWithProgress() {
- @Override
- public void run(IProgressMonitor monitor) throws InterruptedException, InvocationTargetException {
- runValidation(part.getDiagramEditPart(), part.getDiagram());
- }
- }).run(new NullProgressMonitor());
+ @Override
+ public void run(IProgressMonitor monitor)
+ throws InterruptedException, InvocationTargetException {
+ runValidation(part.getDiagramEditPart(), part.getDiagram());
+ }
+ })
+ .run(new NullProgressMonitor());
} catch (Exception e) {
UMLDiagramEditorPlugin.getInstance().logError("Validation action failed", e); //$NON-NLS-1$
}
@@ -94,16 +97,18 @@ public class ValidateAction extends Action {
*/
public static void runValidation(View view) {
try {
- if(UMLDiagramEditorUtil.openDiagram(view.eResource())) {
- IEditorPart editorPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- if(editorPart instanceof IDiagramWorkbenchPart) {
- runValidation(((IDiagramWorkbenchPart)editorPart).getDiagramEditPart(), view);
+ if (UMLDiagramEditorUtil.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) {
- UMLDiagramEditorPlugin.getInstance().logError("Validation action failed", e); //$NON-NLS-1$
+ UMLDiagramEditorPlugin.getInstance().logError(
+ "Validation action failed", e); //$NON-NLS-1$
}
}
@@ -112,10 +117,12 @@ public class ValidateAction extends Action {
*/
public static void runNonUIValidation(View view) {
Shell shell = Display.getCurrent().getActiveShell();
- if(shell == null) {
+ if (shell == null) {
shell = new Shell();
}
- DiagramEditPart diagramEditPart = OffscreenEditPartFactory.getInstance().createDiagramEditPart(view.getDiagram(), shell);
+
+ DiagramEditPart diagramEditPart = OffscreenEditPartFactory.getInstance().createDiagramEditPart(
+ view.getDiagram(), shell);
runValidation(diagramEditPart, view);
}
@@ -139,7 +146,7 @@ public class ValidateAction extends Action {
* @generated
*/
private static Diagnostic runEMFValidator(View target) {
- if(target.isSetElement() && target.getElement() != null) {
+ if (target.isSetElement() && target.getElement() != null) {
return new Diagnostician() {
@Override
@@ -156,14 +163,15 @@ public class ValidateAction extends Action {
*/
private static void validate(DiagramEditPart diagramEditPart, View view) {
IFile target = view.eResource() != null ? WorkspaceSynchronizer.getFile(view.eResource()) : null;
- if(target != null) {
+ if (target != null) {
UMLMarkerNavigationProvider.deleteMarkers(target);
}
Diagnostic diagnostic = runEMFValidator(view);
createMarkers(target, diagnostic, diagramEditPart);
- IBatchValidator validator = (IBatchValidator)ModelValidationService.getInstance().newValidator(EvaluationMode.BATCH);
+ IBatchValidator validator = (IBatchValidator) ModelValidationService.getInstance().newValidator(
+ EvaluationMode.BATCH);
validator.setIncludeLiveConstraints(true);
- if(view.isSetElement() && view.getElement() != null) {
+ if (view.isSetElement() && view.getElement() != null) {
IStatus status = validator.validate(view.getElement());
createMarkers(target, status, diagramEditPart);
}
@@ -173,16 +181,21 @@ public class ValidateAction extends Action {
* @generated
*/
private static void createMarkers(IFile target, IStatus validationStatus, DiagramEditPart diagramEditPart) {
- if(validationStatus.isOK()) {
+ if (validationStatus.isOK()) {
return;
}
final IStatus rootStatus = validationStatus;
List allStatuses = new ArrayList();
- UMLDiagramEditorUtil.LazyElement2ViewMap element2ViewMap = new UMLDiagramEditorUtil.LazyElement2ViewMap(diagramEditPart.getDiagramView(), collectTargetElements(rootStatus, new HashSet<EObject>(), allStatuses));
- for(Iterator it = allStatuses.iterator(); it.hasNext();) {
- IConstraintStatus nextStatus = (IConstraintStatus)it.next();
- View view = UMLDiagramEditorUtil.findView(diagramEditPart, nextStatus.getTarget(), element2ViewMap);
- addMarker(diagramEditPart.getViewer(), target, view.eResource().getURIFragment(view), EMFCoreUtil.getQualifiedName(nextStatus.getTarget(), true), nextStatus.getMessage(), nextStatus.getSeverity());
+ UMLDiagramEditorUtil.LazyElement2ViewMap element2ViewMap = new UMLDiagramEditorUtil.LazyElement2ViewMap(
+ diagramEditPart.getDiagramView(),
+ collectTargetElements(rootStatus, new HashSet<EObject>(), allStatuses));
+ for (Iterator it = allStatuses.iterator(); it.hasNext();) {
+ IConstraintStatus nextStatus = (IConstraintStatus) it.next();
+ View view = UMLDiagramEditorUtil.findView(
+ diagramEditPart, nextStatus.getTarget(), element2ViewMap);
+ addMarker(diagramEditPart.getViewer(), target, view.eResource().getURIFragment(view),
+ EMFCoreUtil.getQualifiedName(nextStatus.getTarget(), true),
+ nextStatus.getMessage(), nextStatus.getSeverity());
}
}
@@ -190,19 +203,24 @@ public class ValidateAction extends Action {
* @generated
*/
private static void createMarkers(IFile target, Diagnostic emfValidationStatus, DiagramEditPart diagramEditPart) {
- if(emfValidationStatus.getSeverity() == Diagnostic.OK) {
+ if (emfValidationStatus.getSeverity() == Diagnostic.OK) {
return;
}
final Diagnostic rootStatus = emfValidationStatus;
List<Diagnostic> allDiagnostics = new ArrayList<Diagnostic>();
- UMLDiagramEditorUtil.LazyElement2ViewMap element2ViewMap = new UMLDiagramEditorUtil.LazyElement2ViewMap(diagramEditPart.getDiagramView(), collectTargetElements(rootStatus, new HashSet<EObject>(), allDiagnostics));
- for(Iterator<Diagnostic> it = emfValidationStatus.getChildren().iterator(); it.hasNext();) {
+ UMLDiagramEditorUtil.LazyElement2ViewMap element2ViewMap = new UMLDiagramEditorUtil.LazyElement2ViewMap(
+ diagramEditPart.getDiagramView(),
+ collectTargetElements(rootStatus, new HashSet<EObject>(), allDiagnostics));
+ for (Iterator<Diagnostic> it = emfValidationStatus.getChildren().iterator(); it.hasNext();) {
Diagnostic nextDiagnostic = it.next();
List<?> data = nextDiagnostic.getData();
- if(data != null && !data.isEmpty() && data.get(0) instanceof EObject) {
- EObject element = (EObject)data.get(0);
- View view = UMLDiagramEditorUtil.findView(diagramEditPart, element, element2ViewMap);
- addMarker(diagramEditPart.getViewer(), target, view.eResource().getURIFragment(view), EMFCoreUtil.getQualifiedName(element, true), nextDiagnostic.getMessage(), diagnosticToStatusSeverity(nextDiagnostic.getSeverity()));
+ if (data != null && !data.isEmpty() && data.get(0) instanceof EObject) {
+ EObject element = (EObject) data.get(0);
+ View view = UMLDiagramEditorUtil.findView(
+ diagramEditPart, element, element2ViewMap);
+ addMarker(diagramEditPart.getViewer(), target, view.eResource().getURIFragment(view),
+ EMFCoreUtil.getQualifiedName(element, true),
+ nextDiagnostic.getMessage(), diagnosticToStatusSeverity(nextDiagnostic.getSeverity()));
}
}
}
@@ -211,23 +229,25 @@ public class ValidateAction extends Action {
* @generated
*/
private static void addMarker(EditPartViewer viewer, IFile target, String elementId, String location, String message, int statusSeverity) {
- if(target == null) {
+ if (target == null) {
return;
}
- UMLMarkerNavigationProvider.addMarker(target, elementId, location, message, statusSeverity);
+ UMLMarkerNavigationProvider.addMarker(
+ target, elementId, location, message, statusSeverity);
}
/**
* @generated
*/
private static int diagnosticToStatusSeverity(int diagnosticSeverity) {
- if(diagnosticSeverity == Diagnostic.OK) {
+ if (diagnosticSeverity == Diagnostic.OK) {
return IStatus.OK;
- } else if(diagnosticSeverity == Diagnostic.INFO) {
+ } else if (diagnosticSeverity == Diagnostic.INFO) {
return IStatus.INFO;
- } else if(diagnosticSeverity == Diagnostic.WARNING) {
+ } else if (diagnosticSeverity == Diagnostic.WARNING) {
return IStatus.WARNING;
- } else if(diagnosticSeverity == Diagnostic.ERROR || diagnosticSeverity == Diagnostic.CANCEL) {
+ } else if (diagnosticSeverity == Diagnostic.ERROR
+ || diagnosticSeverity == Diagnostic.CANCEL) {
return IStatus.ERROR;
}
return IStatus.INFO;
@@ -237,13 +257,13 @@ public class ValidateAction extends Action {
* @generated
*/
private static Set<EObject> collectTargetElements(IStatus status, Set<EObject> targetElementCollector, List<IConstraintStatus> allConstraintStatuses) {
- if(status instanceof IConstraintStatus) {
- targetElementCollector.add(((IConstraintStatus)status).getTarget());
- allConstraintStatuses.add((IConstraintStatus)status);
+ if (status instanceof IConstraintStatus) {
+ targetElementCollector.add(((IConstraintStatus) status).getTarget());
+ allConstraintStatuses.add((IConstraintStatus) status);
}
- if(status.isMultiStatus()) {
+ if (status.isMultiStatus()) {
IStatus[] children = status.getChildren();
- for(int i = 0; i < children.length; i++) {
+ for (int i = 0; i < children.length; i++) {
collectTargetElements(children[i], targetElementCollector, allConstraintStatuses);
}
}
@@ -256,13 +276,13 @@ public class ValidateAction extends Action {
private static Set<EObject> collectTargetElements(Diagnostic diagnostic, Set<EObject> targetElementCollector, List<Diagnostic> allDiagnostics) {
List<?> data = diagnostic.getData();
EObject target = null;
- if(data != null && !data.isEmpty() && data.get(0) instanceof EObject) {
- target = (EObject)data.get(0);
+ 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<Diagnostic> it = diagnostic.getChildren().iterator(); it.hasNext();) {
+ if (diagnostic.getChildren() != null && !diagnostic.getChildren().isEmpty()) {
+ for (Iterator<Diagnostic> it = diagnostic.getChildren().iterator(); it.hasNext();) {
collectTargetElements(it.next(), targetElementCollector, allDiagnostics);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/preferences/DiagramPreferenceInitializer.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/preferences/DiagramPreferenceInitializer.java
index c1212cb14e4..b10346d696c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/preferences/DiagramPreferenceInitializer.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/preferences/DiagramPreferenceInitializer.java
@@ -30,6 +30,7 @@ public class DiagramPreferenceInitializer extends AbstractPreferenceInitializer
DiagramConnectionsPreferencePage.initDefaults(store);
DiagramPrintingPreferencePage.initDefaults(store);
DiagramRulersAndGridPreferencePage.initDefaults(store);
+
}
/**
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/providers/ElementInitializers.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/providers/ElementInitializers.java
index d8b40697b31..0228122d85b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/providers/ElementInitializers.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/providers/ElementInitializers.java
@@ -99,8 +99,9 @@ public class ElementInitializers {
public void init_Activity_2060(Activity instance) {
try {
Object value_0 = name_Activity_2060(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -113,8 +114,9 @@ public class ElementInitializers {
public void init_Interaction_2061(Interaction instance) {
try {
Object value_0 = name_Interaction_2061(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -127,8 +129,9 @@ public class ElementInitializers {
public void init_ProtocolStateMachine_2062(ProtocolStateMachine instance) {
try {
Object value_0 = name_ProtocolStateMachine_2062(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -141,8 +144,9 @@ public class ElementInitializers {
public void init_StateMachine_2063(StateMachine instance) {
try {
Object value_0 = name_StateMachine_2063(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -155,8 +159,9 @@ public class ElementInitializers {
public void init_FunctionBehavior_2064(FunctionBehavior instance) {
try {
Object value_0 = name_FunctionBehavior_2064(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -169,8 +174,9 @@ public class ElementInitializers {
public void init_OpaqueBehavior_2065(OpaqueBehavior instance) {
try {
Object value_0 = name_OpaqueBehavior_2065(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -183,8 +189,9 @@ public class ElementInitializers {
public void init_Component_2069(Component instance) {
try {
Object value_0 = name_Component_2069(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -197,8 +204,9 @@ public class ElementInitializers {
public void init_Device_2070(Device instance) {
try {
Object value_0 = name_Device_2070(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -211,8 +219,9 @@ public class ElementInitializers {
public void init_ExecutionEnvironment_2071(ExecutionEnvironment instance) {
try {
Object value_0 = name_ExecutionEnvironment_2071(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -225,8 +234,9 @@ public class ElementInitializers {
public void init_Node_2072(Node instance) {
try {
Object value_0 = name_Node_2072(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -239,8 +249,9 @@ public class ElementInitializers {
public void init_Class_2073(Class instance) {
try {
Object value_0 = name_Class_2073(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -253,8 +264,9 @@ public class ElementInitializers {
public void init_Collaboration_2075(Collaboration instance) {
try {
Object value_0 = name_Collaboration_2075(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -267,8 +279,9 @@ public class ElementInitializers {
public void init_Interface_2076(Interface instance) {
try {
Object value_0 = name_Interface_2076(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -281,8 +294,9 @@ public class ElementInitializers {
public void init_PrimitiveType_2066(PrimitiveType instance) {
try {
Object value_0 = name_PrimitiveType_2066(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -295,8 +309,9 @@ public class ElementInitializers {
public void init_Enumeration_2067(Enumeration instance) {
try {
Object value_0 = name_Enumeration_2067(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -309,8 +324,9 @@ public class ElementInitializers {
public void init_DataType_2068(DataType instance) {
try {
Object value_0 = name_DataType_2068(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -323,8 +339,9 @@ public class ElementInitializers {
public void init_Actor_2077(Actor instance) {
try {
Object value_0 = name_Actor_2077(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -337,8 +354,9 @@ public class ElementInitializers {
public void init_DeploymentSpecification_2078(DeploymentSpecification instance) {
try {
Object value_0 = name_DeploymentSpecification_2078(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -351,8 +369,9 @@ public class ElementInitializers {
public void init_Artifact_2079(Artifact instance) {
try {
Object value_0 = name_Artifact_2079(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -365,12 +384,14 @@ public class ElementInitializers {
public void init_InformationItem_2080(InformationItem instance) {
try {
Object value_0 = name_InformationItem_2080(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
Object value_1 = isAbstract_InformationItem_2080(instance);
- if(value_1 != null) {
- instance.setIsAbstract(((Boolean)value_1).booleanValue());
+ if (value_1 != null) {
+ instance.setIsAbstract(
+ ((Boolean) value_1).booleanValue());
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -383,8 +404,9 @@ public class ElementInitializers {
public void init_Signal_2081(Signal instance) {
try {
Object value_0 = name_Signal_2081(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -397,8 +419,9 @@ public class ElementInitializers {
public void init_UseCase_2082(UseCase instance) {
try {
Object value_0 = name_UseCase_2082(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -411,8 +434,9 @@ public class ElementInitializers {
public void init_SignalEvent_2083(SignalEvent instance) {
try {
Object value_0 = name_SignalEvent_2083(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -425,8 +449,9 @@ public class ElementInitializers {
public void init_CallEvent_2084(CallEvent instance) {
try {
Object value_0 = name_CallEvent_2084(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -439,8 +464,9 @@ public class ElementInitializers {
public void init_AnyReceiveEvent_2085(AnyReceiveEvent instance) {
try {
Object value_0 = name_AnyReceiveEvent_2085(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -453,8 +479,9 @@ public class ElementInitializers {
public void init_ChangeEvent_2088(ChangeEvent instance) {
try {
Object value_0 = name_ChangeEvent_2088(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -467,8 +494,9 @@ public class ElementInitializers {
public void init_TimeEvent_2089(TimeEvent instance) {
try {
Object value_0 = name_TimeEvent_2089(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -481,8 +509,9 @@ public class ElementInitializers {
public void init_DurationObservation_2093(DurationObservation instance) {
try {
Object value_0 = name_DurationObservation_2093(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -495,8 +524,9 @@ public class ElementInitializers {
public void init_TimeObservation_2094(TimeObservation instance) {
try {
Object value_0 = name_TimeObservation_2094(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -509,8 +539,9 @@ public class ElementInitializers {
public void init_LiteralBoolean_2095(LiteralBoolean instance) {
try {
Object value_0 = name_LiteralBoolean_2095(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -523,8 +554,9 @@ public class ElementInitializers {
public void init_LiteralInteger_2096(LiteralInteger instance) {
try {
Object value_0 = name_LiteralInteger_2096(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -537,8 +569,9 @@ public class ElementInitializers {
public void init_LiteralNull_2097(LiteralNull instance) {
try {
Object value_0 = name_LiteralNull_2097(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -551,8 +584,9 @@ public class ElementInitializers {
public void init_LiteralString_2098(LiteralString instance) {
try {
Object value_0 = name_LiteralString_2098(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -565,8 +599,9 @@ public class ElementInitializers {
public void init_LiteralUnlimitedNatural_2099(LiteralUnlimitedNatural instance) {
try {
Object value_0 = name_LiteralUnlimitedNatural_2099(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -579,8 +614,9 @@ public class ElementInitializers {
public void init_StringExpression_2100(StringExpression instance) {
try {
Object value_0 = name_StringExpression_2100(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -593,8 +629,9 @@ public class ElementInitializers {
public void init_OpaqueExpression_2101(OpaqueExpression instance) {
try {
Object value_0 = name_OpaqueExpression_2101(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -607,8 +644,9 @@ public class ElementInitializers {
public void init_TimeExpression_2102(TimeExpression instance) {
try {
Object value_0 = name_TimeExpression_2102(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -621,8 +659,9 @@ public class ElementInitializers {
public void init_Expression_2103(Expression instance) {
try {
Object value_0 = name_Expression_2103(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -635,8 +674,9 @@ public class ElementInitializers {
public void init_Duration_2104(Duration instance) {
try {
Object value_0 = name_Duration_2104(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -649,8 +689,9 @@ public class ElementInitializers {
public void init_TimeInterval_2105(TimeInterval instance) {
try {
Object value_0 = name_TimeInterval_2105(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -663,8 +704,9 @@ public class ElementInitializers {
public void init_DurationInterval_2106(DurationInterval instance) {
try {
Object value_0 = name_DurationInterval_2106(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -677,8 +719,9 @@ public class ElementInitializers {
public void init_Interval_2107(Interval instance) {
try {
Object value_0 = name_Interval_2107(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -691,8 +734,9 @@ public class ElementInitializers {
public void init_InstanceValue_2108(InstanceValue instance) {
try {
Object value_0 = name_InstanceValue_2108(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -705,8 +749,9 @@ public class ElementInitializers {
public void init_Comment_2109(Comment instance) {
try {
Object value_0 = body_Comment_2109(instance);
- if(value_0 != null) {
- instance.setBody((String)value_0);
+ if (value_0 != null) {
+ instance.setBody(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -719,12 +764,14 @@ public class ElementInitializers {
public void init_DurationConstraint_2110(DurationConstraint instance) {
try {
Object value_0 = name_DurationConstraint_2110(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
Object value_1 = specification_DurationConstraint_2110(instance);
- if(value_1 != null) {
- instance.setSpecification((ValueSpecification)value_1);
+ if (value_1 != null) {
+ instance.setSpecification(
+ (ValueSpecification) value_1);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -737,12 +784,14 @@ public class ElementInitializers {
public void init_TimeConstraint_2111(TimeConstraint instance) {
try {
Object value_0 = name_TimeConstraint_2111(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
Object value_1 = specification_TimeConstraint_2111(instance);
- if(value_1 != null) {
- instance.setSpecification((ValueSpecification)value_1);
+ if (value_1 != null) {
+ instance.setSpecification(
+ (ValueSpecification) value_1);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -755,12 +804,14 @@ public class ElementInitializers {
public void init_IntervalConstraint_2112(IntervalConstraint instance) {
try {
Object value_0 = name_IntervalConstraint_2112(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
Object value_1 = specification_IntervalConstraint_2112(instance);
- if(value_1 != null) {
- instance.setSpecification((ValueSpecification)value_1);
+ if (value_1 != null) {
+ instance.setSpecification(
+ (ValueSpecification) value_1);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -773,12 +824,14 @@ public class ElementInitializers {
public void init_InteractionConstraint_2113(InteractionConstraint instance) {
try {
Object value_0 = name_InteractionConstraint_2113(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
Object value_1 = specification_InteractionConstraint_2113(instance);
- if(value_1 != null) {
- instance.setSpecification((ValueSpecification)value_1);
+ if (value_1 != null) {
+ instance.setSpecification(
+ (ValueSpecification) value_1);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -791,12 +844,14 @@ public class ElementInitializers {
public void init_Constraint_2114(Constraint instance) {
try {
Object value_0 = name_Constraint_2114(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
Object value_1 = specification_Constraint_2114(instance);
- if(value_1 != null) {
- instance.setSpecification((ValueSpecification)value_1);
+ if (value_1 != null) {
+ instance.setSpecification(
+ (ValueSpecification) value_1);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -809,10 +864,13 @@ public class ElementInitializers {
public void init_Port_3069(Port instance) {
try {
Object value_0 = name_Port_3069(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
- instance.setAggregation(AggregationKind.COMPOSITE_LITERAL);
+ instance.setAggregation(
+ AggregationKind.COMPOSITE_LITERAL);
+
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
}
@@ -824,8 +882,9 @@ public class ElementInitializers {
public void init_Parameter_3088(Parameter instance) {
try {
Object value_0 = name_Parameter_3088(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -838,8 +897,9 @@ public class ElementInitializers {
public void init_Property_3070(Property instance) {
try {
Object value_0 = name_Property_3070(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -852,8 +912,9 @@ public class ElementInitializers {
public void init_ConnectableElement_3115(ConnectableElement instance) {
try {
Object value_0 = name_ConnectableElement_3115(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -866,8 +927,9 @@ public class ElementInitializers {
public void init_CollaborationUse_3071(CollaborationUse instance) {
try {
Object value_0 = name_CollaborationUse_3071(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -880,8 +942,9 @@ public class ElementInitializers {
public void init_Activity_3072(Activity instance) {
try {
Object value_0 = name_Activity_3072(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -894,8 +957,9 @@ public class ElementInitializers {
public void init_Interaction_3073(Interaction instance) {
try {
Object value_0 = name_Interaction_3073(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -908,8 +972,9 @@ public class ElementInitializers {
public void init_ProtocolStateMachine_3074(ProtocolStateMachine instance) {
try {
Object value_0 = name_ProtocolStateMachine_3074(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -922,8 +987,9 @@ public class ElementInitializers {
public void init_StateMachine_3075(StateMachine instance) {
try {
Object value_0 = name_StateMachine_3075(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -936,8 +1002,9 @@ public class ElementInitializers {
public void init_FunctionBehavior_3076(FunctionBehavior instance) {
try {
Object value_0 = name_FunctionBehavior_3076(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -950,8 +1017,9 @@ public class ElementInitializers {
public void init_OpaqueBehavior_3077(OpaqueBehavior instance) {
try {
Object value_0 = name_OpaqueBehavior_3077(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -964,8 +1032,9 @@ public class ElementInitializers {
public void init_Component_3081(Component instance) {
try {
Object value_0 = name_Component_3081(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -978,8 +1047,9 @@ public class ElementInitializers {
public void init_Device_3082(Device instance) {
try {
Object value_0 = name_Device_3082(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -992,8 +1062,9 @@ public class ElementInitializers {
public void init_ExecutionEnvironment_3083(ExecutionEnvironment instance) {
try {
Object value_0 = name_ExecutionEnvironment_3083(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -1006,8 +1077,9 @@ public class ElementInitializers {
public void init_Node_3084(Node instance) {
try {
Object value_0 = name_Node_3084(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -1020,8 +1092,9 @@ public class ElementInitializers {
public void init_Class_3085(Class instance) {
try {
Object value_0 = name_Class_3085(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -1034,8 +1107,9 @@ public class ElementInitializers {
public void init_Collaboration_3086(Collaboration instance) {
try {
Object value_0 = name_Collaboration_3086(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -1048,8 +1122,9 @@ public class ElementInitializers {
public void init_Interface_3087(Interface instance) {
try {
Object value_0 = name_Interface_3087(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -1062,8 +1137,9 @@ public class ElementInitializers {
public void init_PrimitiveType_3078(PrimitiveType instance) {
try {
Object value_0 = name_PrimitiveType_3078(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -1076,8 +1152,9 @@ public class ElementInitializers {
public void init_Enumeration_3079(Enumeration instance) {
try {
Object value_0 = name_Enumeration_3079(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -1090,8 +1167,9 @@ public class ElementInitializers {
public void init_DataType_3080(DataType instance) {
try {
Object value_0 = name_DataType_3080(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -1104,8 +1182,9 @@ public class ElementInitializers {
public void init_Actor_3091(Actor instance) {
try {
Object value_0 = name_Actor_3091(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -1118,8 +1197,9 @@ public class ElementInitializers {
public void init_DeploymentSpecification_3092(DeploymentSpecification instance) {
try {
Object value_0 = name_DeploymentSpecification_3092(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -1132,8 +1212,9 @@ public class ElementInitializers {
public void init_Artifact_3093(Artifact instance) {
try {
Object value_0 = name_Artifact_3093(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -1146,12 +1227,14 @@ public class ElementInitializers {
public void init_InformationItem_3094(InformationItem instance) {
try {
Object value_0 = name_InformationItem_3094(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
Object value_1 = isAbstract_InformationItem_3094(instance);
- if(value_1 != null) {
- instance.setIsAbstract(((Boolean)value_1).booleanValue());
+ if (value_1 != null) {
+ instance.setIsAbstract(
+ ((Boolean) value_1).booleanValue());
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -1164,8 +1247,9 @@ public class ElementInitializers {
public void init_Signal_3095(Signal instance) {
try {
Object value_0 = name_Signal_3095(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -1178,8 +1262,9 @@ public class ElementInitializers {
public void init_UseCase_3096(UseCase instance) {
try {
Object value_0 = name_UseCase_3096(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -1192,8 +1277,9 @@ public class ElementInitializers {
public void init_Comment_3097(Comment instance) {
try {
Object value_0 = body_Comment_3097(instance);
- if(value_0 != null) {
- instance.setBody((String)value_0);
+ if (value_0 != null) {
+ instance.setBody(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -1206,12 +1292,14 @@ public class ElementInitializers {
public void init_DurationConstraint_3116(DurationConstraint instance) {
try {
Object value_0 = name_DurationConstraint_3116(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
Object value_1 = specification_DurationConstraint_3116(instance);
- if(value_1 != null) {
- instance.setSpecification((ValueSpecification)value_1);
+ if (value_1 != null) {
+ instance.setSpecification(
+ (ValueSpecification) value_1);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -1224,12 +1312,14 @@ public class ElementInitializers {
public void init_TimeConstraint_3117(TimeConstraint instance) {
try {
Object value_0 = name_TimeConstraint_3117(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
Object value_1 = specification_TimeConstraint_3117(instance);
- if(value_1 != null) {
- instance.setSpecification((ValueSpecification)value_1);
+ if (value_1 != null) {
+ instance.setSpecification(
+ (ValueSpecification) value_1);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -1242,12 +1332,14 @@ public class ElementInitializers {
public void init_IntervalConstraint_3118(IntervalConstraint instance) {
try {
Object value_0 = name_IntervalConstraint_3118(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
Object value_1 = specification_IntervalConstraint_3118(instance);
- if(value_1 != null) {
- instance.setSpecification((ValueSpecification)value_1);
+ if (value_1 != null) {
+ instance.setSpecification(
+ (ValueSpecification) value_1);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -1260,12 +1352,14 @@ public class ElementInitializers {
public void init_InteractionConstraint_3119(InteractionConstraint instance) {
try {
Object value_0 = name_InteractionConstraint_3119(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
Object value_1 = specification_InteractionConstraint_3119(instance);
- if(value_1 != null) {
- instance.setSpecification((ValueSpecification)value_1);
+ if (value_1 != null) {
+ instance.setSpecification(
+ (ValueSpecification) value_1);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -1278,12 +1372,14 @@ public class ElementInitializers {
public void init_Constraint_3120(Constraint instance) {
try {
Object value_0 = name_Constraint_3120(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
Object value_1 = specification_Constraint_3120(instance);
- if(value_1 != null) {
- instance.setSpecification((ValueSpecification)value_1);
+ if (value_1 != null) {
+ instance.setSpecification(
+ (ValueSpecification) value_1);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -1296,8 +1392,9 @@ public class ElementInitializers {
public void init_Property_3101(Property instance) {
try {
Object value_0 = name_Property_3101(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -1310,8 +1407,9 @@ public class ElementInitializers {
public void init_Operation_3102(Operation instance) {
try {
Object value_0 = name_Operation_3102(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -1324,8 +1422,9 @@ public class ElementInitializers {
public void init_EnumerationLiteral_3066(EnumerationLiteral instance) {
try {
Object value_0 = name_EnumerationLiteral_3066(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -1338,8 +1437,9 @@ public class ElementInitializers {
public void init_ComponentRealization_4004(ComponentRealization instance) {
try {
Object value_0 = name_ComponentRealization_4004(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -1352,8 +1452,9 @@ public class ElementInitializers {
public void init_InterfaceRealization_4005(InterfaceRealization instance) {
try {
Object value_0 = name_InterfaceRealization_4005(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -1366,8 +1467,9 @@ public class ElementInitializers {
public void init_Substitution_4011(Substitution instance) {
try {
Object value_0 = name_Substitution_4011(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -1380,8 +1482,9 @@ public class ElementInitializers {
public void init_Realization_4006(Realization instance) {
try {
Object value_0 = name_Realization_4006(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -1394,8 +1497,9 @@ public class ElementInitializers {
public void init_Manifestation_4012(Manifestation instance) {
try {
Object value_0 = name_Manifestation_4012(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -1408,8 +1512,9 @@ public class ElementInitializers {
public void init_Abstraction_4007(Abstraction instance) {
try {
Object value_0 = name_Abstraction_4007(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -1422,8 +1527,9 @@ public class ElementInitializers {
public void init_Usage_4008(Usage instance) {
try {
Object value_0 = name_Usage_4008(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -1436,8 +1542,9 @@ public class ElementInitializers {
public void init_Deployment_4009(Deployment instance) {
try {
Object value_0 = name_Deployment_4009(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -1450,8 +1557,9 @@ public class ElementInitializers {
public void init_Dependency_4010(Dependency instance) {
try {
Object value_0 = name_Dependency_4010(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -1464,8 +1572,9 @@ public class ElementInitializers {
public void init_Connector_4013(Connector instance) {
try {
Object value_0 = name_Connector_4013(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -1478,8 +1587,9 @@ public class ElementInitializers {
public void init_InformationFlow_4021(InformationFlow instance) {
try {
Object value_0 = name_InformationFlow_4021(instance);
- if(value_0 != null) {
- instance.setName((String)value_0);
+ if (value_0 != null) {
+ instance.setName(
+ (String) value_0);
}
} catch (RuntimeException e) {
UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
@@ -2275,7 +2385,7 @@ public class ElementInitializers {
*/
public static ElementInitializers getInstance() {
ElementInitializers cached = UMLDiagramEditorPlugin.getInstance().getElementInitializers();
- if(cached == null) {
+ if (cached == null) {
UMLDiagramEditorPlugin.getInstance().setElementInitializers(cached = new ElementInitializers());
}
return cached;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/providers/UMLEditPartProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/providers/UMLEditPartProvider.java
index 92f285b4f4d..5b6d4d3ed6c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/providers/UMLEditPartProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/providers/UMLEditPartProvider.java
@@ -25,6 +25,8 @@ public class UMLEditPartProvider extends DefaultEditPartProvider {
* @generated
*/
public UMLEditPartProvider() {
- super(new UMLEditPartFactory(), UMLVisualIDRegistry.TYPED_INSTANCE, CompositeStructureDiagramEditPart.MODEL_ID);
+ super(new UMLEditPartFactory(),
+ UMLVisualIDRegistry.TYPED_INSTANCE,
+ CompositeStructureDiagramEditPart.MODEL_ID);
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/providers/UMLElementTypes.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/providers/UMLElementTypes.java
index 1ef0c13234f..9a722052ab3 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/providers/UMLElementTypes.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/providers/UMLElementTypes.java
@@ -624,111 +624,313 @@ public class UMLElementTypes {
*/
public static synchronized ENamedElement getElement(IAdaptable hint) {
Object type = hint.getAdapter(IElementType.class);
- if(elements == null) {
+ if (elements == null) {
elements = new IdentityHashMap<IElementType, ENamedElement>();
+
elements.put(Package_1000, UMLPackage.eINSTANCE.getPackage());
+
+
elements.put(Activity_2060, UMLPackage.eINSTANCE.getActivity());
+
+
elements.put(Interaction_2061, UMLPackage.eINSTANCE.getInteraction());
+
+
elements.put(ProtocolStateMachine_2062, UMLPackage.eINSTANCE.getProtocolStateMachine());
+
+
elements.put(StateMachine_2063, UMLPackage.eINSTANCE.getStateMachine());
+
+
elements.put(FunctionBehavior_2064, UMLPackage.eINSTANCE.getFunctionBehavior());
+
+
elements.put(OpaqueBehavior_2065, UMLPackage.eINSTANCE.getOpaqueBehavior());
+
+
elements.put(Component_2069, UMLPackage.eINSTANCE.getComponent());
+
+
elements.put(Device_2070, UMLPackage.eINSTANCE.getDevice());
+
+
elements.put(ExecutionEnvironment_2071, UMLPackage.eINSTANCE.getExecutionEnvironment());
+
+
elements.put(Node_2072, UMLPackage.eINSTANCE.getNode());
+
+
elements.put(Class_2073, UMLPackage.eINSTANCE.getClass_());
+
+
elements.put(Collaboration_2075, UMLPackage.eINSTANCE.getCollaboration());
+
+
elements.put(Interface_2076, UMLPackage.eINSTANCE.getInterface());
+
+
elements.put(PrimitiveType_2066, UMLPackage.eINSTANCE.getPrimitiveType());
+
+
elements.put(Enumeration_2067, UMLPackage.eINSTANCE.getEnumeration());
+
+
elements.put(DataType_2068, UMLPackage.eINSTANCE.getDataType());
+
+
elements.put(Actor_2077, UMLPackage.eINSTANCE.getActor());
+
+
elements.put(DeploymentSpecification_2078, UMLPackage.eINSTANCE.getDeploymentSpecification());
+
+
elements.put(Artifact_2079, UMLPackage.eINSTANCE.getArtifact());
+
+
elements.put(InformationItem_2080, UMLPackage.eINSTANCE.getInformationItem());
+
+
elements.put(Signal_2081, UMLPackage.eINSTANCE.getSignal());
+
+
elements.put(UseCase_2082, UMLPackage.eINSTANCE.getUseCase());
+
+
elements.put(SignalEvent_2083, UMLPackage.eINSTANCE.getSignalEvent());
+
+
elements.put(CallEvent_2084, UMLPackage.eINSTANCE.getCallEvent());
+
+
elements.put(AnyReceiveEvent_2085, UMLPackage.eINSTANCE.getAnyReceiveEvent());
+
+
elements.put(ChangeEvent_2088, UMLPackage.eINSTANCE.getChangeEvent());
+
+
elements.put(TimeEvent_2089, UMLPackage.eINSTANCE.getTimeEvent());
+
+
elements.put(DurationObservation_2093, UMLPackage.eINSTANCE.getDurationObservation());
+
+
elements.put(TimeObservation_2094, UMLPackage.eINSTANCE.getTimeObservation());
+
+
elements.put(LiteralBoolean_2095, UMLPackage.eINSTANCE.getLiteralBoolean());
+
+
elements.put(LiteralInteger_2096, UMLPackage.eINSTANCE.getLiteralInteger());
+
+
elements.put(LiteralNull_2097, UMLPackage.eINSTANCE.getLiteralNull());
+
+
elements.put(LiteralString_2098, UMLPackage.eINSTANCE.getLiteralString());
+
+
elements.put(LiteralUnlimitedNatural_2099, UMLPackage.eINSTANCE.getLiteralUnlimitedNatural());
+
+
elements.put(StringExpression_2100, UMLPackage.eINSTANCE.getStringExpression());
+
+
elements.put(OpaqueExpression_2101, UMLPackage.eINSTANCE.getOpaqueExpression());
+
+
elements.put(TimeExpression_2102, UMLPackage.eINSTANCE.getTimeExpression());
+
+
elements.put(Expression_2103, UMLPackage.eINSTANCE.getExpression());
+
+
elements.put(Duration_2104, UMLPackage.eINSTANCE.getDuration());
+
+
elements.put(TimeInterval_2105, UMLPackage.eINSTANCE.getTimeInterval());
+
+
elements.put(DurationInterval_2106, UMLPackage.eINSTANCE.getDurationInterval());
+
+
elements.put(Interval_2107, UMLPackage.eINSTANCE.getInterval());
+
+
elements.put(InstanceValue_2108, UMLPackage.eINSTANCE.getInstanceValue());
+
+
elements.put(Comment_2109, UMLPackage.eINSTANCE.getComment());
+
+
elements.put(DurationConstraint_2110, UMLPackage.eINSTANCE.getDurationConstraint());
+
+
elements.put(TimeConstraint_2111, UMLPackage.eINSTANCE.getTimeConstraint());
+
+
elements.put(IntervalConstraint_2112, UMLPackage.eINSTANCE.getIntervalConstraint());
+
+
elements.put(InteractionConstraint_2113, UMLPackage.eINSTANCE.getInteractionConstraint());
+
+
elements.put(Constraint_2114, UMLPackage.eINSTANCE.getConstraint());
+
+
elements.put(Port_3069, UMLPackage.eINSTANCE.getPort());
+
+
elements.put(Parameter_3088, UMLPackage.eINSTANCE.getParameter());
+
+
elements.put(Property_3070, UMLPackage.eINSTANCE.getProperty());
+
+
elements.put(ConnectableElement_3115, UMLPackage.eINSTANCE.getConnectableElement());
+
+
elements.put(CollaborationUse_3071, UMLPackage.eINSTANCE.getCollaborationUse());
+
+
elements.put(Activity_3072, UMLPackage.eINSTANCE.getActivity());
+
+
elements.put(Interaction_3073, UMLPackage.eINSTANCE.getInteraction());
+
+
elements.put(ProtocolStateMachine_3074, UMLPackage.eINSTANCE.getProtocolStateMachine());
+
+
elements.put(StateMachine_3075, UMLPackage.eINSTANCE.getStateMachine());
+
+
elements.put(FunctionBehavior_3076, UMLPackage.eINSTANCE.getFunctionBehavior());
+
+
elements.put(OpaqueBehavior_3077, UMLPackage.eINSTANCE.getOpaqueBehavior());
+
+
elements.put(Component_3081, UMLPackage.eINSTANCE.getComponent());
+
+
elements.put(Device_3082, UMLPackage.eINSTANCE.getDevice());
+
+
elements.put(ExecutionEnvironment_3083, UMLPackage.eINSTANCE.getExecutionEnvironment());
+
+
elements.put(Node_3084, UMLPackage.eINSTANCE.getNode());
+
+
elements.put(Class_3085, UMLPackage.eINSTANCE.getClass_());
+
+
elements.put(Collaboration_3086, UMLPackage.eINSTANCE.getCollaboration());
+
+
elements.put(Interface_3087, UMLPackage.eINSTANCE.getInterface());
+
+
elements.put(PrimitiveType_3078, UMLPackage.eINSTANCE.getPrimitiveType());
+
+
elements.put(Enumeration_3079, UMLPackage.eINSTANCE.getEnumeration());
+
+
elements.put(DataType_3080, UMLPackage.eINSTANCE.getDataType());
+
+
elements.put(Actor_3091, UMLPackage.eINSTANCE.getActor());
+
+
elements.put(DeploymentSpecification_3092, UMLPackage.eINSTANCE.getDeploymentSpecification());
+
+
elements.put(Artifact_3093, UMLPackage.eINSTANCE.getArtifact());
+
+
elements.put(InformationItem_3094, UMLPackage.eINSTANCE.getInformationItem());
+
+
elements.put(Signal_3095, UMLPackage.eINSTANCE.getSignal());
+
+
elements.put(UseCase_3096, UMLPackage.eINSTANCE.getUseCase());
+
+
elements.put(Comment_3097, UMLPackage.eINSTANCE.getComment());
+
+
elements.put(DurationConstraint_3116, UMLPackage.eINSTANCE.getDurationConstraint());
+
+
elements.put(TimeConstraint_3117, UMLPackage.eINSTANCE.getTimeConstraint());
+
+
elements.put(IntervalConstraint_3118, UMLPackage.eINSTANCE.getIntervalConstraint());
+
+
elements.put(InteractionConstraint_3119, UMLPackage.eINSTANCE.getInteractionConstraint());
+
+
elements.put(Constraint_3120, UMLPackage.eINSTANCE.getConstraint());
+
+
elements.put(Property_3101, UMLPackage.eINSTANCE.getProperty());
+
+
elements.put(Operation_3102, UMLPackage.eINSTANCE.getOperation());
+
+
elements.put(EnumerationLiteral_3066, UMLPackage.eINSTANCE.getEnumerationLiteral());
+
elements.put(CommentAnnotatedElement_4002, UMLPackage.eINSTANCE.getComment_AnnotatedElement());
+
elements.put(ConstraintConstrainedElement_4003, UMLPackage.eINSTANCE.getConstraint_ConstrainedElement());
+
+
elements.put(ComponentRealization_4004, UMLPackage.eINSTANCE.getComponentRealization());
+
+
elements.put(InterfaceRealization_4005, UMLPackage.eINSTANCE.getInterfaceRealization());
+
+
elements.put(Substitution_4011, UMLPackage.eINSTANCE.getSubstitution());
+
+
elements.put(Realization_4006, UMLPackage.eINSTANCE.getRealization());
+
+
elements.put(Manifestation_4012, UMLPackage.eINSTANCE.getManifestation());
+
+
elements.put(Abstraction_4007, UMLPackage.eINSTANCE.getAbstraction());
+
+
elements.put(Usage_4008, UMLPackage.eINSTANCE.getUsage());
+
+
elements.put(Deployment_4009, UMLPackage.eINSTANCE.getDeployment());
+
+
elements.put(Dependency_4017, UMLPackage.eINSTANCE.getDependency());
+
+
elements.put(Dependency_4010, UMLPackage.eINSTANCE.getDependency());
+
+
elements.put(Connector_4013, UMLPackage.eINSTANCE.getConnector());
+
+
elements.put(Generalization_4015, UMLPackage.eINSTANCE.getGeneralization());
+
elements.put(TimeObservationEvent_4018, UMLPackage.eINSTANCE.getTimeObservation_Event());
+
elements.put(DurationObservationEvent_4019, UMLPackage.eINSTANCE.getDurationObservation_Event());
+
elements.put(InformationItemRepresented_4020, UMLPackage.eINSTANCE.getInformationItem_Represented());
+
+
elements.put(InformationFlow_4021, UMLPackage.eINSTANCE.getInformationFlow());
}
return elements.get(type);
@@ -745,7 +947,7 @@ public class UMLElementTypes {
* @generated
*/
public static synchronized boolean isKnownElementType(IElementType elementType) {
- if(KNOWN_ELEMENT_TYPES == null) {
+ if (KNOWN_ELEMENT_TYPES == null) {
KNOWN_ELEMENT_TYPES = new HashSet<IElementType>();
KNOWN_ELEMENT_TYPES.add(Package_1000);
KNOWN_ELEMENT_TYPES.add(Activity_2060);
@@ -855,13 +1057,16 @@ public class UMLElementTypes {
KNOWN_ELEMENT_TYPES.add(InformationItemRepresented_4020);
KNOWN_ELEMENT_TYPES.add(InformationFlow_4021);
}
+
boolean result = KNOWN_ELEMENT_TYPES.contains(elementType);
- if(!result) {
+
+ if (!result) {
IElementType[] supertypes = elementType.getAllSuperTypes();
- for(int i = 0; !result && (i < supertypes.length); i++) {
+ for (int i = 0; !result && (i < supertypes.length); i++) {
result = KNOWN_ELEMENT_TYPES.contains(supertypes[i]);
}
}
+
return result;
}
@@ -869,7 +1074,7 @@ public class UMLElementTypes {
* @generated
*/
public static IElementType getElementType(int visualID) {
- switch(visualID) {
+ switch (visualID) {
case CompositeStructureDiagramEditPart.VISUAL_ID:
return Package_1000;
case ActivityCompositeEditPart.VISUAL_ID:
@@ -1123,12 +1328,14 @@ public class UMLElementTypes {
*/
public static boolean isKindOf(IElementType subtype, IElementType supertype) {
boolean result = subtype == supertype;
- if(!result) {
+
+ if (!result) {
IElementType[] supertypes = subtype.getAllSuperTypes();
- for(int i = 0; !result && (i < supertypes.length); i++) {
+ for (int i = 0; !result && (i < supertypes.length); i++) {
result = supertype == supertypes[i];
}
}
+
return result;
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/providers/UMLMarkerNavigationProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/providers/UMLMarkerNavigationProvider.java
index eb6b08dbd36..663af5a6b50 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/providers/UMLMarkerNavigationProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/providers/UMLMarkerNavigationProvider.java
@@ -41,18 +41,19 @@ public class UMLMarkerNavigationProvider extends AbstractModelMarkerNavigationPr
*/
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)) {
+ if (elementId == null || !(getEditor() instanceof DiagramEditor)) {
return;
}
- DiagramEditor editor = (DiagramEditor)getEditor();
+ DiagramEditor editor = (DiagramEditor) getEditor();
Map<?, ?> editPartRegistry = editor.getDiagramGraphicalViewer().getEditPartRegistry();
EObject targetView = editor.getDiagram().eResource().getEObject(elementId);
- if(targetView == null) {
+ if (targetView == null) {
return;
}
- EditPart targetEditPart = (EditPart)editPartRegistry.get(targetView);
- if(targetEditPart != null) {
- UMLDiagramEditorUtil.selectElementsInDiagram(editor, Arrays.asList(new EditPart[]{ targetEditPart }));
+ EditPart targetEditPart = (EditPart) editPartRegistry.get(targetView);
+ if (targetEditPart != null) {
+ UMLDiagramEditorUtil.selectElementsInDiagram(
+ editor, Arrays.asList(new EditPart[] { targetEditPart }));
}
}
@@ -63,7 +64,8 @@ public class UMLMarkerNavigationProvider extends AbstractModelMarkerNavigationPr
try {
resource.deleteMarkers(MARKER_TYPE, true, IResource.DEPTH_ZERO);
} catch (CoreException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Failed to delete validation markers", e); //$NON-NLS-1$
+ UMLDiagramEditorPlugin.getInstance().logError(
+ "Failed to delete validation markers", e); //$NON-NLS-1$
}
}
@@ -78,14 +80,15 @@ public class UMLMarkerNavigationProvider extends AbstractModelMarkerNavigationPr
marker.setAttribute(IMarker.LOCATION, location);
marker.setAttribute(org.eclipse.gmf.runtime.common.core.resources.IMarker.ELEMENT_ID, elementId);
int markerSeverity = IMarker.SEVERITY_INFO;
- if(statusSeverity == IStatus.WARNING) {
+ if (statusSeverity == IStatus.WARNING) {
markerSeverity = IMarker.SEVERITY_WARNING;
- } else if(statusSeverity == IStatus.ERROR || statusSeverity == IStatus.CANCEL) {
+ } else if (statusSeverity == IStatus.ERROR || statusSeverity == IStatus.CANCEL) {
markerSeverity = IMarker.SEVERITY_ERROR;
}
marker.setAttribute(IMarker.SEVERITY, markerSeverity);
} catch (CoreException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Failed to create validation marker", e); //$NON-NLS-1$
+ UMLDiagramEditorPlugin.getInstance().logError(
+ "Failed to create validation marker", e); //$NON-NLS-1$
}
return marker;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/providers/UMLParserProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/providers/UMLParserProvider.java
index b23bb35a62c..be48b1a12d2 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/providers/UMLParserProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/providers/UMLParserProvider.java
@@ -46,8 +46,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getActivityName_5112Parser() {
- if(activityName_5112Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (activityName_5112Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -66,8 +67,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getActivityName_6079Parser() {
- if(activityName_6079Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (activityName_6079Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
activityName_6079Parser = parser;
}
@@ -83,8 +85,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getInteractionName_5113Parser() {
- if(interactionName_5113Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (interactionName_5113Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -103,8 +106,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getInteractionName_6080Parser() {
- if(interactionName_6080Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (interactionName_6080Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
interactionName_6080Parser = parser;
}
@@ -120,8 +124,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getProtocolStateMachineName_5114Parser() {
- if(protocolStateMachineName_5114Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (protocolStateMachineName_5114Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -140,8 +145,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getProtocolStateMachineName_6081Parser() {
- if(protocolStateMachineName_6081Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (protocolStateMachineName_6081Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
protocolStateMachineName_6081Parser = parser;
}
@@ -157,8 +163,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getStateMachineName_5115Parser() {
- if(stateMachineName_5115Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (stateMachineName_5115Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -177,8 +184,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getStateMachineName_6082Parser() {
- if(stateMachineName_6082Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (stateMachineName_6082Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
stateMachineName_6082Parser = parser;
}
@@ -194,8 +202,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getFunctionBehaviorName_5116Parser() {
- if(functionBehaviorName_5116Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (functionBehaviorName_5116Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -214,8 +223,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getFunctionBehaviorName_6083Parser() {
- if(functionBehaviorName_6083Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (functionBehaviorName_6083Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
functionBehaviorName_6083Parser = parser;
}
@@ -231,8 +241,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getOpaqueBehaviorName_5117Parser() {
- if(opaqueBehaviorName_5117Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (opaqueBehaviorName_5117Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -251,8 +262,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getOpaqueBehaviorName_6084Parser() {
- if(opaqueBehaviorName_6084Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (opaqueBehaviorName_6084Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
opaqueBehaviorName_6084Parser = parser;
}
@@ -268,8 +280,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getComponentName_5121Parser() {
- if(componentName_5121Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (componentName_5121Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -288,8 +301,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getComponentName_6085Parser() {
- if(componentName_6085Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (componentName_6085Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
componentName_6085Parser = parser;
}
@@ -305,8 +319,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getDeviceName_5122Parser() {
- if(deviceName_5122Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (deviceName_5122Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -325,8 +340,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getDeviceName_6086Parser() {
- if(deviceName_6086Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (deviceName_6086Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
deviceName_6086Parser = parser;
}
@@ -342,8 +358,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getExecutionEnvironmentName_5123Parser() {
- if(executionEnvironmentName_5123Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (executionEnvironmentName_5123Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -362,8 +379,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getExecutionEnvironmentName_6087Parser() {
- if(executionEnvironmentName_6087Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (executionEnvironmentName_6087Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
executionEnvironmentName_6087Parser = parser;
}
@@ -379,8 +397,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getNodeName_5124Parser() {
- if(nodeName_5124Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (nodeName_5124Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -399,8 +418,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getNodeName_6088Parser() {
- if(nodeName_6088Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (nodeName_6088Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
nodeName_6088Parser = parser;
}
@@ -416,8 +436,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getClassName_5156Parser() {
- if(className_5156Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (className_5156Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -436,8 +457,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getClassName_6089Parser() {
- if(className_6089Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (className_6089Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
className_6089Parser = parser;
}
@@ -453,8 +475,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getCollaborationName_5158Parser() {
- if(collaborationName_5158Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (collaborationName_5158Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -473,8 +496,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getCollaborationName_6090Parser() {
- if(collaborationName_6090Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (collaborationName_6090Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
collaborationName_6090Parser = parser;
}
@@ -490,8 +514,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getInterfaceName_5159Parser() {
- if(interfaceName_5159Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (interfaceName_5159Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -510,8 +535,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getInterfaceName_6091Parser() {
- if(interfaceName_6091Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (interfaceName_6091Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
interfaceName_6091Parser = parser;
}
@@ -527,8 +553,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getPrimitiveTypeName_5118Parser() {
- if(primitiveTypeName_5118Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (primitiveTypeName_5118Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -547,8 +574,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getPrimitiveTypeName_6092Parser() {
- if(primitiveTypeName_6092Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (primitiveTypeName_6092Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
primitiveTypeName_6092Parser = parser;
}
@@ -564,8 +592,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getEnumerationName_5119Parser() {
- if(enumerationName_5119Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (enumerationName_5119Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -584,8 +613,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getEnumerationName_6093Parser() {
- if(enumerationName_6093Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (enumerationName_6093Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
enumerationName_6093Parser = parser;
}
@@ -601,8 +631,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getDataTypeName_5120Parser() {
- if(dataTypeName_5120Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (dataTypeName_5120Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -621,8 +652,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getDataTypeName_6094Parser() {
- if(dataTypeName_6094Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (dataTypeName_6094Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
dataTypeName_6094Parser = parser;
}
@@ -638,8 +670,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getActorName_5160Parser() {
- if(actorName_5160Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (actorName_5160Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -658,8 +691,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getActorName_6095Parser() {
- if(actorName_6095Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (actorName_6095Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
actorName_6095Parser = parser;
}
@@ -675,8 +709,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getDeploymentSpecificationName_5161Parser() {
- if(deploymentSpecificationName_5161Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (deploymentSpecificationName_5161Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -695,8 +730,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getDeploymentSpecificationName_6096Parser() {
- if(deploymentSpecificationName_6096Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (deploymentSpecificationName_6096Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
deploymentSpecificationName_6096Parser = parser;
}
@@ -712,8 +748,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getArtifactName_5162Parser() {
- if(artifactName_5162Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (artifactName_5162Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -732,8 +769,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getArtifactName_6097Parser() {
- if(artifactName_6097Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (artifactName_6097Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
artifactName_6097Parser = parser;
}
@@ -749,8 +787,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getInformationItemName_5163Parser() {
- if(informationItemName_5163Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (informationItemName_5163Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -769,8 +808,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getInformationItemName_6098Parser() {
- if(informationItemName_6098Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (informationItemName_6098Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
informationItemName_6098Parser = parser;
}
@@ -786,8 +826,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getSignalName_5164Parser() {
- if(signalName_5164Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (signalName_5164Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -806,8 +847,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getSignalName_6099Parser() {
- if(signalName_6099Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (signalName_6099Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
signalName_6099Parser = parser;
}
@@ -823,8 +865,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getUseCaseName_5165Parser() {
- if(useCaseName_5165Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (useCaseName_5165Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -843,8 +886,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getUseCaseName_6100Parser() {
- if(useCaseName_6100Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (useCaseName_6100Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
useCaseName_6100Parser = parser;
}
@@ -860,8 +904,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getSignalEventName_5166Parser() {
- if(signalEventName_5166Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (signalEventName_5166Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -880,8 +925,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getSignalEventName_6101Parser() {
- if(signalEventName_6101Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (signalEventName_6101Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
signalEventName_6101Parser = parser;
}
@@ -897,8 +943,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getCallEventName_5167Parser() {
- if(callEventName_5167Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (callEventName_5167Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -917,8 +964,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getCallEventName_6102Parser() {
- if(callEventName_6102Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (callEventName_6102Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
callEventName_6102Parser = parser;
}
@@ -934,8 +982,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getAnyReceiveEventName_5168Parser() {
- if(anyReceiveEventName_5168Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (anyReceiveEventName_5168Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -954,8 +1003,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getAnyReceiveEventName_6103Parser() {
- if(anyReceiveEventName_6103Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (anyReceiveEventName_6103Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
anyReceiveEventName_6103Parser = parser;
}
@@ -971,8 +1021,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getChangeEventName_5171Parser() {
- if(changeEventName_5171Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (changeEventName_5171Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -991,8 +1042,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getChangeEventName_6104Parser() {
- if(changeEventName_6104Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (changeEventName_6104Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
changeEventName_6104Parser = parser;
}
@@ -1008,8 +1060,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getTimeEventName_5172Parser() {
- if(timeEventName_5172Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (timeEventName_5172Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -1028,8 +1081,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getTimeEventName_6105Parser() {
- if(timeEventName_6105Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (timeEventName_6105Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
timeEventName_6105Parser = parser;
}
@@ -1045,8 +1099,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getDurationObservationName_5151Parser() {
- if(durationObservationName_5151Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (durationObservationName_5151Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
durationObservationName_5151Parser = parser;
}
@@ -1062,7 +1117,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getDurationObservationName_5152Parser() {
- if(durationObservationName_5152Parser == null) {
+ if (durationObservationName_5152Parser == null) {
durationObservationName_5152Parser = new AppliedStereotypeParser();
}
return durationObservationName_5152Parser;
@@ -1077,8 +1132,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getTimeObservationName_5142Parser() {
- if(timeObservationName_5142Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (timeObservationName_5142Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
timeObservationName_5142Parser = parser;
}
@@ -1094,7 +1150,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getTimeObservationName_5143Parser() {
- if(timeObservationName_5143Parser == null) {
+ if (timeObservationName_5143Parser == null) {
timeObservationName_5143Parser = new AppliedStereotypeParser();
}
return timeObservationName_5143Parser;
@@ -1109,8 +1165,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getLiteralBooleanName_5178Parser() {
- if(literalBooleanName_5178Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (literalBooleanName_5178Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -1129,8 +1186,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getLiteralBooleanName_6106Parser() {
- if(literalBooleanName_6106Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (literalBooleanName_6106Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
literalBooleanName_6106Parser = parser;
}
@@ -1146,8 +1204,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getLiteralIntegerName_5179Parser() {
- if(literalIntegerName_5179Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (literalIntegerName_5179Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -1166,8 +1225,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getLiteralIntegerName_6107Parser() {
- if(literalIntegerName_6107Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (literalIntegerName_6107Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
literalIntegerName_6107Parser = parser;
}
@@ -1183,8 +1243,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getLiteralNullName_5180Parser() {
- if(literalNullName_5180Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (literalNullName_5180Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -1203,8 +1264,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getLiteralNullName_6108Parser() {
- if(literalNullName_6108Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (literalNullName_6108Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
literalNullName_6108Parser = parser;
}
@@ -1220,8 +1282,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getLiteralStringName_5181Parser() {
- if(literalStringName_5181Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (literalStringName_5181Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -1240,8 +1303,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getLiteralStringName_6109Parser() {
- if(literalStringName_6109Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (literalStringName_6109Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
literalStringName_6109Parser = parser;
}
@@ -1257,8 +1321,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getLiteralUnlimitedNaturalName_5182Parser() {
- if(literalUnlimitedNaturalName_5182Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (literalUnlimitedNaturalName_5182Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -1277,8 +1342,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getLiteralUnlimitedNaturalName_6110Parser() {
- if(literalUnlimitedNaturalName_6110Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (literalUnlimitedNaturalName_6110Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
literalUnlimitedNaturalName_6110Parser = parser;
}
@@ -1294,8 +1360,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getStringExpressionName_5183Parser() {
- if(stringExpressionName_5183Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (stringExpressionName_5183Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -1314,8 +1381,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getStringExpressionName_6111Parser() {
- if(stringExpressionName_6111Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (stringExpressionName_6111Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
stringExpressionName_6111Parser = parser;
}
@@ -1331,8 +1399,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getOpaqueExpressionName_5184Parser() {
- if(opaqueExpressionName_5184Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (opaqueExpressionName_5184Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -1351,8 +1420,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getOpaqueExpressionName_6112Parser() {
- if(opaqueExpressionName_6112Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (opaqueExpressionName_6112Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
opaqueExpressionName_6112Parser = parser;
}
@@ -1368,8 +1438,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getTimeExpressionName_5185Parser() {
- if(timeExpressionName_5185Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (timeExpressionName_5185Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -1388,8 +1459,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getTimeExpressionName_6113Parser() {
- if(timeExpressionName_6113Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (timeExpressionName_6113Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
timeExpressionName_6113Parser = parser;
}
@@ -1405,8 +1477,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getExpressionName_5186Parser() {
- if(expressionName_5186Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (expressionName_5186Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -1425,8 +1498,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getExpressionName_6114Parser() {
- if(expressionName_6114Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (expressionName_6114Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
expressionName_6114Parser = parser;
}
@@ -1442,8 +1516,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getDurationName_5187Parser() {
- if(durationName_5187Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (durationName_5187Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -1462,8 +1537,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getDurationName_6115Parser() {
- if(durationName_6115Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (durationName_6115Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
durationName_6115Parser = parser;
}
@@ -1479,8 +1555,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getTimeIntervalName_5188Parser() {
- if(timeIntervalName_5188Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (timeIntervalName_5188Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -1499,8 +1576,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getTimeIntervalName_6116Parser() {
- if(timeIntervalName_6116Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (timeIntervalName_6116Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
timeIntervalName_6116Parser = parser;
}
@@ -1516,8 +1594,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getDurationIntervalName_5189Parser() {
- if(durationIntervalName_5189Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (durationIntervalName_5189Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -1536,8 +1615,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getDurationIntervalName_6117Parser() {
- if(durationIntervalName_6117Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (durationIntervalName_6117Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
durationIntervalName_6117Parser = parser;
}
@@ -1553,8 +1633,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getIntervalName_5190Parser() {
- if(intervalName_5190Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (intervalName_5190Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -1573,8 +1654,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getIntervalName_6118Parser() {
- if(intervalName_6118Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (intervalName_6118Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
intervalName_6118Parser = parser;
}
@@ -1590,8 +1672,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getInstanceValueName_5191Parser() {
- if(instanceValueName_5191Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (instanceValueName_5191Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -1610,8 +1693,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getInstanceValueName_6119Parser() {
- if(instanceValueName_6119Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (instanceValueName_6119Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
instanceValueName_6119Parser = parser;
}
@@ -1627,7 +1711,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getCommentBody_5192Parser() {
- if(commentBody_5192Parser == null) {
+ if (commentBody_5192Parser == null) {
commentBody_5192Parser = new CommentParser();
}
return commentBody_5192Parser;
@@ -1642,8 +1726,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getDurationConstraintName_5193Parser() {
- if(durationConstraintName_5193Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (durationConstraintName_5193Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
durationConstraintName_5193Parser = parser;
}
@@ -1659,7 +1744,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getDurationConstraintSpecification_6035Parser() {
- if(durationConstraintSpecification_6035Parser == null) {
+ if (durationConstraintSpecification_6035Parser == null) {
durationConstraintSpecification_6035Parser = new ConstraintParser();
}
return durationConstraintSpecification_6035Parser;
@@ -1674,8 +1759,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getTimeConstraintName_5194Parser() {
- if(timeConstraintName_5194Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (timeConstraintName_5194Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
timeConstraintName_5194Parser = parser;
}
@@ -1691,7 +1777,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getTimeConstraintSpecification_6036Parser() {
- if(timeConstraintSpecification_6036Parser == null) {
+ if (timeConstraintSpecification_6036Parser == null) {
timeConstraintSpecification_6036Parser = new ConstraintParser();
}
return timeConstraintSpecification_6036Parser;
@@ -1706,8 +1792,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getIntervalConstraintName_5195Parser() {
- if(intervalConstraintName_5195Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (intervalConstraintName_5195Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
intervalConstraintName_5195Parser = parser;
}
@@ -1723,7 +1810,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getIntervalConstraintSpecification_6037Parser() {
- if(intervalConstraintSpecification_6037Parser == null) {
+ if (intervalConstraintSpecification_6037Parser == null) {
intervalConstraintSpecification_6037Parser = new ConstraintParser();
}
return intervalConstraintSpecification_6037Parser;
@@ -1738,8 +1825,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getInteractionConstraintName_5196Parser() {
- if(interactionConstraintName_5196Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (interactionConstraintName_5196Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
interactionConstraintName_5196Parser = parser;
}
@@ -1755,7 +1843,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getInteractionConstraintSpecification_6038Parser() {
- if(interactionConstraintSpecification_6038Parser == null) {
+ if (interactionConstraintSpecification_6038Parser == null) {
interactionConstraintSpecification_6038Parser = new ConstraintParser();
}
return interactionConstraintSpecification_6038Parser;
@@ -1770,8 +1858,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getConstraintName_5197Parser() {
- if(constraintName_5197Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (constraintName_5197Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
constraintName_5197Parser = parser;
}
@@ -1787,7 +1876,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getConstraintSpecification_6039Parser() {
- if(constraintSpecification_6039Parser == null) {
+ if (constraintSpecification_6039Parser == null) {
constraintSpecification_6039Parser = new ConstraintParser();
}
return constraintSpecification_6039Parser;
@@ -1802,8 +1891,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getNodeName_6053Parser() {
- if(nodeName_6053Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (nodeName_6053Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
nodeName_6053Parser = parser;
}
@@ -1819,8 +1909,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getPortName_5125Parser() {
- if(portName_5125Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (portName_5125Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
portName_5125Parser = parser;
}
@@ -1836,7 +1927,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getPortName_6029Parser() {
- if(portName_6029Parser == null) {
+ if (portName_6029Parser == null) {
portName_6029Parser = new AppliedStereotypeParser();
}
return portName_6029Parser;
@@ -1851,8 +1942,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getParameterName_6033Parser() {
- if(parameterName_6033Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (parameterName_6033Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parameterName_6033Parser = parser;
}
@@ -1868,7 +1960,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getParameterName_6034Parser() {
- if(parameterName_6034Parser == null) {
+ if (parameterName_6034Parser == null) {
parameterName_6034Parser = new AppliedStereotypeParser();
}
return parameterName_6034Parser;
@@ -1883,8 +1975,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getPropertyName_5126Parser() {
- if(propertyName_5126Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (propertyName_5126Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
propertyName_5126Parser = parser;
}
@@ -1900,8 +1993,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getPropertyName_6054Parser() {
- if(propertyName_6054Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (propertyName_6054Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
propertyName_6054Parser = parser;
}
@@ -1917,8 +2011,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getConnectableElementName_5198Parser() {
- if(connectableElementName_5198Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (connectableElementName_5198Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0}"); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -1937,8 +2032,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getConnectableElementName_6055Parser() {
- if(connectableElementName_6055Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (connectableElementName_6055Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
connectableElementName_6055Parser = parser;
}
@@ -1954,8 +2050,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getCollaborationUseName_5127Parser() {
- if(collaborationUseName_5127Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (collaborationUseName_5127Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
collaborationUseName_5127Parser = parser;
}
@@ -1971,8 +2068,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getCollaborationUseName_6056Parser() {
- if(collaborationUseName_6056Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (collaborationUseName_6056Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
collaborationUseName_6056Parser = parser;
}
@@ -1988,8 +2086,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getActivityName_5128Parser() {
- if(activityName_5128Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (activityName_5128Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -2008,8 +2107,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getActivityName_6057Parser() {
- if(activityName_6057Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (activityName_6057Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
activityName_6057Parser = parser;
}
@@ -2025,8 +2125,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getInteractionName_5129Parser() {
- if(interactionName_5129Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (interactionName_5129Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -2045,8 +2146,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getInteractionName_6058Parser() {
- if(interactionName_6058Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (interactionName_6058Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
interactionName_6058Parser = parser;
}
@@ -2062,8 +2164,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getProtocolStateMachineName_5130Parser() {
- if(protocolStateMachineName_5130Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (protocolStateMachineName_5130Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -2082,8 +2185,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getProtocolStateMachineName_6059Parser() {
- if(protocolStateMachineName_6059Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (protocolStateMachineName_6059Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
protocolStateMachineName_6059Parser = parser;
}
@@ -2099,8 +2203,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getStateMachineName_5131Parser() {
- if(stateMachineName_5131Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (stateMachineName_5131Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -2119,8 +2224,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getStateMachineName_6060Parser() {
- if(stateMachineName_6060Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (stateMachineName_6060Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
stateMachineName_6060Parser = parser;
}
@@ -2136,8 +2242,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getFunctionBehaviorName_5132Parser() {
- if(functionBehaviorName_5132Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (functionBehaviorName_5132Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -2156,8 +2263,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getFunctionBehaviorName_6061Parser() {
- if(functionBehaviorName_6061Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (functionBehaviorName_6061Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
functionBehaviorName_6061Parser = parser;
}
@@ -2173,8 +2281,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getOpaqueBehaviorName_5133Parser() {
- if(opaqueBehaviorName_5133Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (opaqueBehaviorName_5133Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -2193,8 +2302,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getOpaqueBehaviorName_6062Parser() {
- if(opaqueBehaviorName_6062Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (opaqueBehaviorName_6062Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
opaqueBehaviorName_6062Parser = parser;
}
@@ -2210,8 +2320,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getComponentName_5137Parser() {
- if(componentName_5137Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (componentName_5137Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -2230,8 +2341,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getComponentName_6063Parser() {
- if(componentName_6063Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (componentName_6063Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
componentName_6063Parser = parser;
}
@@ -2247,8 +2359,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getDeviceName_5138Parser() {
- if(deviceName_5138Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (deviceName_5138Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -2267,8 +2380,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getDeviceName_6064Parser() {
- if(deviceName_6064Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (deviceName_6064Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
deviceName_6064Parser = parser;
}
@@ -2284,8 +2398,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getExecutionEnvironmentName_5139Parser() {
- if(executionEnvironmentName_5139Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (executionEnvironmentName_5139Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -2304,8 +2419,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getExecutionEnvironmentName_6065Parser() {
- if(executionEnvironmentName_6065Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (executionEnvironmentName_6065Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
executionEnvironmentName_6065Parser = parser;
}
@@ -2321,8 +2437,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getNodeName_5140Parser() {
- if(nodeName_5140Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (nodeName_5140Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -2341,8 +2458,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getNodeName_6066Parser() {
- if(nodeName_6066Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (nodeName_6066Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
nodeName_6066Parser = parser;
}
@@ -2358,8 +2476,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getClassName_5155Parser() {
- if(className_5155Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (className_5155Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -2378,8 +2497,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getClassName_6067Parser() {
- if(className_6067Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (className_6067Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
className_6067Parser = parser;
}
@@ -2395,8 +2515,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getCollaborationName_5141Parser() {
- if(collaborationName_5141Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (collaborationName_5141Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -2415,8 +2536,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getCollaborationName_6068Parser() {
- if(collaborationName_6068Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (collaborationName_6068Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
collaborationName_6068Parser = parser;
}
@@ -2432,8 +2554,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getInterfaceName_5154Parser() {
- if(interfaceName_5154Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (interfaceName_5154Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -2452,8 +2575,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getInterfaceName_6069Parser() {
- if(interfaceName_6069Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (interfaceName_6069Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
interfaceName_6069Parser = parser;
}
@@ -2469,8 +2593,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getPrimitiveTypeName_5134Parser() {
- if(primitiveTypeName_5134Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (primitiveTypeName_5134Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -2489,8 +2614,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getPrimitiveTypeName_6070Parser() {
- if(primitiveTypeName_6070Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (primitiveTypeName_6070Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
primitiveTypeName_6070Parser = parser;
}
@@ -2506,8 +2632,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getEnumerationName_5135Parser() {
- if(enumerationName_5135Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (enumerationName_5135Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -2526,8 +2653,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getEnumerationName_6071Parser() {
- if(enumerationName_6071Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (enumerationName_6071Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
enumerationName_6071Parser = parser;
}
@@ -2543,8 +2671,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getDataTypeName_5136Parser() {
- if(dataTypeName_5136Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (dataTypeName_5136Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -2563,8 +2692,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getDataTypeName_6072Parser() {
- if(dataTypeName_6072Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (dataTypeName_6072Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
dataTypeName_6072Parser = parser;
}
@@ -2580,8 +2710,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getActorName_5144Parser() {
- if(actorName_5144Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (actorName_5144Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -2600,8 +2731,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getActorName_6073Parser() {
- if(actorName_6073Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (actorName_6073Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
actorName_6073Parser = parser;
}
@@ -2617,8 +2749,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getDeploymentSpecificationName_5145Parser() {
- if(deploymentSpecificationName_5145Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (deploymentSpecificationName_5145Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -2637,8 +2770,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getDeploymentSpecificationName_6074Parser() {
- if(deploymentSpecificationName_6074Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (deploymentSpecificationName_6074Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
deploymentSpecificationName_6074Parser = parser;
}
@@ -2654,8 +2788,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getArtifactName_5146Parser() {
- if(artifactName_5146Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (artifactName_5146Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -2674,8 +2809,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getArtifactName_6075Parser() {
- if(artifactName_6075Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (artifactName_6075Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
artifactName_6075Parser = parser;
}
@@ -2691,8 +2827,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getInformationItemName_5147Parser() {
- if(informationItemName_5147Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (informationItemName_5147Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -2711,8 +2848,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getInformationItemName_6076Parser() {
- if(informationItemName_6076Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (informationItemName_6076Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
informationItemName_6076Parser = parser;
}
@@ -2728,8 +2866,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getSignalName_5148Parser() {
- if(signalName_5148Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (signalName_5148Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -2748,8 +2887,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getSignalName_6077Parser() {
- if(signalName_6077Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (signalName_6077Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
signalName_6077Parser = parser;
}
@@ -2765,8 +2905,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getUseCaseName_5149Parser() {
- if(useCaseName_5149Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (useCaseName_5149Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -2785,8 +2926,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getUseCaseName_6078Parser() {
- if(useCaseName_6078Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (useCaseName_6078Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
useCaseName_6078Parser = parser;
}
@@ -2802,7 +2944,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getCommentBody_5150Parser() {
- if(commentBody_5150Parser == null) {
+ if (commentBody_5150Parser == null) {
commentBody_5150Parser = new CommentParser();
}
return commentBody_5150Parser;
@@ -2817,8 +2959,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getDurationConstraintName_6040Parser() {
- if(durationConstraintName_6040Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (durationConstraintName_6040Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
durationConstraintName_6040Parser = parser;
}
@@ -2834,7 +2977,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getDurationConstraintSpecification_6041Parser() {
- if(durationConstraintSpecification_6041Parser == null) {
+ if (durationConstraintSpecification_6041Parser == null) {
durationConstraintSpecification_6041Parser = new ConstraintParser();
}
return durationConstraintSpecification_6041Parser;
@@ -2849,8 +2992,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getTimeConstraintName_6042Parser() {
- if(timeConstraintName_6042Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (timeConstraintName_6042Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
timeConstraintName_6042Parser = parser;
}
@@ -2866,7 +3010,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getTimeConstraintSpecification_6043Parser() {
- if(timeConstraintSpecification_6043Parser == null) {
+ if (timeConstraintSpecification_6043Parser == null) {
timeConstraintSpecification_6043Parser = new ConstraintParser();
}
return timeConstraintSpecification_6043Parser;
@@ -2881,8 +3025,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getIntervalConstraintName_6044Parser() {
- if(intervalConstraintName_6044Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (intervalConstraintName_6044Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
intervalConstraintName_6044Parser = parser;
}
@@ -2898,7 +3043,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getIntervalConstraintSpecification_6045Parser() {
- if(intervalConstraintSpecification_6045Parser == null) {
+ if (intervalConstraintSpecification_6045Parser == null) {
intervalConstraintSpecification_6045Parser = new ConstraintParser();
}
return intervalConstraintSpecification_6045Parser;
@@ -2913,8 +3058,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getInteractionConstraintName_6046Parser() {
- if(interactionConstraintName_6046Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (interactionConstraintName_6046Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
interactionConstraintName_6046Parser = parser;
}
@@ -2930,7 +3076,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getInteractionConstraintSpecification_6047Parser() {
- if(interactionConstraintSpecification_6047Parser == null) {
+ if (interactionConstraintSpecification_6047Parser == null) {
interactionConstraintSpecification_6047Parser = new ConstraintParser();
}
return interactionConstraintSpecification_6047Parser;
@@ -2945,8 +3091,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getConstraintName_6048Parser() {
- if(constraintName_6048Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (constraintName_6048Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
constraintName_6048Parser = parser;
}
@@ -2962,7 +3109,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getConstraintSpecification_6049Parser() {
- if(constraintSpecification_6049Parser == null) {
+ if (constraintSpecification_6049Parser == null) {
constraintSpecification_6049Parser = new ConstraintParser();
}
return constraintSpecification_6049Parser;
@@ -2977,8 +3124,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getProperty_3101Parser() {
- if(property_3101Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (property_3101Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -2997,8 +3145,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getOperation_3102Parser() {
- if(operation_3102Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (operation_3102Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -3017,8 +3166,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getEnumerationLiteral_3066Parser() {
- if(enumerationLiteral_3066Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (enumerationLiteral_3066Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("{0} "); //$NON-NLS-1$
parser.setEditorPattern("{0}"); //$NON-NLS-1$
@@ -3037,8 +3187,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getComponentRealizationName_6001Parser() {
- if(componentRealizationName_6001Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (componentRealizationName_6001Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
componentRealizationName_6001Parser = parser;
}
@@ -3054,7 +3205,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getComponentRealizationName_6015Parser() {
- if(componentRealizationName_6015Parser == null) {
+ if (componentRealizationName_6015Parser == null) {
componentRealizationName_6015Parser = new AppliedStereotypeParser();
}
return componentRealizationName_6015Parser;
@@ -3069,8 +3220,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getInterfaceRealizationName_6002Parser() {
- if(interfaceRealizationName_6002Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (interfaceRealizationName_6002Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
interfaceRealizationName_6002Parser = parser;
}
@@ -3086,7 +3238,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getInterfaceRealizationName_6016Parser() {
- if(interfaceRealizationName_6016Parser == null) {
+ if (interfaceRealizationName_6016Parser == null) {
interfaceRealizationName_6016Parser = new AppliedStereotypeParser();
}
return interfaceRealizationName_6016Parser;
@@ -3101,8 +3253,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getSubstitutionName_6003Parser() {
- if(substitutionName_6003Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (substitutionName_6003Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
substitutionName_6003Parser = parser;
}
@@ -3118,7 +3271,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getSubstitutionName_6017Parser() {
- if(substitutionName_6017Parser == null) {
+ if (substitutionName_6017Parser == null) {
substitutionName_6017Parser = new AppliedStereotypeParser();
}
return substitutionName_6017Parser;
@@ -3133,8 +3286,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getRealizationName_6004Parser() {
- if(realizationName_6004Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (realizationName_6004Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
realizationName_6004Parser = parser;
}
@@ -3150,7 +3304,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getRealizationName_6018Parser() {
- if(realizationName_6018Parser == null) {
+ if (realizationName_6018Parser == null) {
realizationName_6018Parser = new AppliedStereotypeParser();
}
return realizationName_6018Parser;
@@ -3165,8 +3319,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getManifestationName_6005Parser() {
- if(manifestationName_6005Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (manifestationName_6005Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
manifestationName_6005Parser = parser;
}
@@ -3182,7 +3337,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getManifestationName_6019Parser() {
- if(manifestationName_6019Parser == null) {
+ if (manifestationName_6019Parser == null) {
manifestationName_6019Parser = new AppliedStereotypeParser();
}
return manifestationName_6019Parser;
@@ -3197,8 +3352,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getAbstractionName_6006Parser() {
- if(abstractionName_6006Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (abstractionName_6006Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
abstractionName_6006Parser = parser;
}
@@ -3214,7 +3370,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getAbstractionName_6020Parser() {
- if(abstractionName_6020Parser == null) {
+ if (abstractionName_6020Parser == null) {
abstractionName_6020Parser = new AppliedStereotypeParser();
}
return abstractionName_6020Parser;
@@ -3229,8 +3385,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getUsageName_6007Parser() {
- if(usageName_6007Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (usageName_6007Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
usageName_6007Parser = parser;
}
@@ -3246,7 +3403,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getUsageName_6021Parser() {
- if(usageName_6021Parser == null) {
+ if (usageName_6021Parser == null) {
usageName_6021Parser = new AppliedStereotypeParser();
}
return usageName_6021Parser;
@@ -3261,8 +3418,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getDeploymentName_6008Parser() {
- if(deploymentName_6008Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (deploymentName_6008Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
deploymentName_6008Parser = parser;
}
@@ -3278,7 +3436,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getDeploymentName_6022Parser() {
- if(deploymentName_6022Parser == null) {
+ if (deploymentName_6022Parser == null) {
deploymentName_6022Parser = new AppliedStereotypeParser();
}
return deploymentName_6022Parser;
@@ -3293,7 +3451,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getDependencyName_6027Parser() {
- if(dependencyName_6027Parser == null) {
+ if (dependencyName_6027Parser == null) {
dependencyName_6027Parser = new RoleBindingRoleNameParser();
}
return dependencyName_6027Parser;
@@ -3308,7 +3466,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getDependencyName_6028Parser() {
- if(dependencyName_6028Parser == null) {
+ if (dependencyName_6028Parser == null) {
dependencyName_6028Parser = new AppliedStereotypeParser();
}
return dependencyName_6028Parser;
@@ -3323,8 +3481,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getDependencyName_6009Parser() {
- if(dependencyName_6009Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (dependencyName_6009Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
dependencyName_6009Parser = parser;
}
@@ -3340,7 +3499,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getDependencyName_6023Parser() {
- if(dependencyName_6023Parser == null) {
+ if (dependencyName_6023Parser == null) {
dependencyName_6023Parser = new AppliedStereotypeParser();
}
return dependencyName_6023Parser;
@@ -3355,7 +3514,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getConnectorName_6025Parser() {
- if(connectorName_6025Parser == null) {
+ if (connectorName_6025Parser == null) {
connectorName_6025Parser = new AppliedStereotypeParser();
}
return connectorName_6025Parser;
@@ -3370,8 +3529,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getConnectorName_6050Parser() {
- if(connectorName_6050Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (connectorName_6050Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
connectorName_6050Parser = parser;
}
@@ -3387,8 +3547,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getConnectorName_6051Parser() {
- if(connectorName_6051Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (connectorName_6051Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("sourceMul{0}"); //$NON-NLS-1$
parser.setEditorPattern("sourceMul{0}"); //$NON-NLS-1$
@@ -3407,8 +3568,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getConnectorName_6052Parser() {
- if(connectorName_6052Parser == null) {
- EAttribute[] features = new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() };
+ if (connectorName_6052Parser == null) {
+ EAttribute[] features = new EAttribute[] {
+ UMLPackage.eINSTANCE.getNamedElement_Name() };
MessageFormatParser parser = new MessageFormatParser(features);
parser.setViewPattern("targetMul{0}"); //$NON-NLS-1$
parser.setEditorPattern("targetMul{0}"); //$NON-NLS-1$
@@ -3427,7 +3589,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getGeneralizationIsSubstitutable_6024Parser() {
- if(generalizationIsSubstitutable_6024Parser == null) {
+ if (generalizationIsSubstitutable_6024Parser == null) {
generalizationIsSubstitutable_6024Parser = new AppliedStereotypeParser();
}
return generalizationIsSubstitutable_6024Parser;
@@ -3442,7 +3604,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
private IParser getInformationFlowName_6032Parser() {
- if(informationFlowName_6032Parser == null) {
+ if (informationFlowName_6032Parser == null) {
informationFlowName_6032Parser = new AppliedStereotypeParser();
}
return informationFlowName_6032Parser;
@@ -3452,379 +3614,476 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
protected IParser getParser(int visualID) {
- switch(visualID) {
+ switch (visualID) {
case ActivityCompositeNameEditPart.VISUAL_ID:
return getActivityName_5112Parser();
case ActivityCompositeFloatingLabelEditPart.VISUAL_ID:
return getActivityName_6079Parser();
+
case InteractionCompositeNameEditPart.VISUAL_ID:
return getInteractionName_5113Parser();
case InteractionCompositeFloatingLabelEditPart.VISUAL_ID:
return getInteractionName_6080Parser();
+
case ProtocolStateMachineCompositeNameEditPart.VISUAL_ID:
return getProtocolStateMachineName_5114Parser();
case ProtocolStateMachineCompositeFloatingLabelEditPart.VISUAL_ID:
return getProtocolStateMachineName_6081Parser();
+
case StateMachineCompositeNameEditPart.VISUAL_ID:
return getStateMachineName_5115Parser();
case StateMachineCompositeFloatingLabelEditPart.VISUAL_ID:
return getStateMachineName_6082Parser();
+
case FunctionBehaviorCompositeNameEditPart.VISUAL_ID:
return getFunctionBehaviorName_5116Parser();
case FunctionBehaviorCompositeFloatingLabelEditPart.VISUAL_ID:
return getFunctionBehaviorName_6083Parser();
+
case OpaqueBehaviorCompositeNameEditPart.VISUAL_ID:
return getOpaqueBehaviorName_5117Parser();
case OpaqueBehaviorCompositeFloatingLabelEditPart.VISUAL_ID:
return getOpaqueBehaviorName_6084Parser();
+
case ComponentCompositeNameEditPart.VISUAL_ID:
return getComponentName_5121Parser();
case ComponentCompositeFloatingLabelEditPart.VISUAL_ID:
return getComponentName_6085Parser();
+
case DeviceCompositeNameEditPart.VISUAL_ID:
return getDeviceName_5122Parser();
case DeviceCompositeFloatingLabelEditPart.VISUAL_ID:
return getDeviceName_6086Parser();
+
case ExecutionEnvironmentCompositeNameEditPart.VISUAL_ID:
return getExecutionEnvironmentName_5123Parser();
case ExecutionEnvironmentCompositeFloatingLabelEditPart.VISUAL_ID:
return getExecutionEnvironmentName_6087Parser();
+
case NodeCompositeNameEditPart.VISUAL_ID:
return getNodeName_5124Parser();
case NodeCompositeFloatingLabelEditPart.VISUAL_ID:
return getNodeName_6088Parser();
+
case ClassCompositeNameEditPart.VISUAL_ID:
return getClassName_5156Parser();
case ClassCompositeFloatingLabelEditPart.VISUAL_ID:
return getClassName_6089Parser();
+
case CollaborationCompositeNameEditPart.VISUAL_ID:
return getCollaborationName_5158Parser();
case CollaborationCompositeFloatingLabelEditPart.VISUAL_ID:
return getCollaborationName_6090Parser();
+
case InterfaceNameEditPart.VISUAL_ID:
return getInterfaceName_5159Parser();
case InterfaceFloatingLabelEditPart.VISUAL_ID:
return getInterfaceName_6091Parser();
+
case PrimitiveTypeNameEditPart.VISUAL_ID:
return getPrimitiveTypeName_5118Parser();
case PrimitiveTypeFloatingLabelEditPart.VISUAL_ID:
return getPrimitiveTypeName_6092Parser();
+
case EnumerationNameEditPart.VISUAL_ID:
return getEnumerationName_5119Parser();
case EnumerationFloatingLabelEditPart.VISUAL_ID:
return getEnumerationName_6093Parser();
+
case DataTypeNameEditPart.VISUAL_ID:
return getDataTypeName_5120Parser();
case DataTypeFloatingLabelEditPart.VISUAL_ID:
return getDataTypeName_6094Parser();
+
case ActorNameEditPart.VISUAL_ID:
return getActorName_5160Parser();
case ActorFloatingLabelEditPart.VISUAL_ID:
return getActorName_6095Parser();
+
case DeploymentSpecificationNameEditPart.VISUAL_ID:
return getDeploymentSpecificationName_5161Parser();
case DeploymentSpecificationFloatingLabelEditPart.VISUAL_ID:
return getDeploymentSpecificationName_6096Parser();
+
case ArtifactNameEditPart.VISUAL_ID:
return getArtifactName_5162Parser();
case ArtifactFloatingLabelEditPart.VISUAL_ID:
return getArtifactName_6097Parser();
+
case InformationItemNameEditPart.VISUAL_ID:
return getInformationItemName_5163Parser();
case InformationItemFloatingLabelEditPart.VISUAL_ID:
return getInformationItemName_6098Parser();
+
case SignalNameEditPart.VISUAL_ID:
return getSignalName_5164Parser();
case SignalFloatingLabelEditPart.VISUAL_ID:
return getSignalName_6099Parser();
+
case UseCaseNameEditPart.VISUAL_ID:
return getUseCaseName_5165Parser();
case UseCaseFloatingLabelEditPart.VISUAL_ID:
return getUseCaseName_6100Parser();
+
case SignalEventNameEditPart.VISUAL_ID:
return getSignalEventName_5166Parser();
case SignalEventFloatingLabelEditPart.VISUAL_ID:
return getSignalEventName_6101Parser();
+
case CallEventNameEditPart.VISUAL_ID:
return getCallEventName_5167Parser();
case CallEventFloatingLabelEditPart.VISUAL_ID:
return getCallEventName_6102Parser();
+
case AnyReceiveEventNameEditPart.VISUAL_ID:
return getAnyReceiveEventName_5168Parser();
case AnyReceiveEventFloatingLabelEditPart.VISUAL_ID:
return getAnyReceiveEventName_6103Parser();
+
case ChangeEventNameEditPart.VISUAL_ID:
return getChangeEventName_5171Parser();
case ChangeEventFloatingLabelEditPart.VISUAL_ID:
return getChangeEventName_6104Parser();
+
case TimeEventNameEditPart.VISUAL_ID:
return getTimeEventName_5172Parser();
case TimeEventFloatingLabelEditPart.VISUAL_ID:
return getTimeEventName_6105Parser();
+
case DurationObservationNameEditPart.VISUAL_ID:
return getDurationObservationName_5151Parser();
case DurationObservationStereotypeLabelEditPart.VISUAL_ID:
return getDurationObservationName_5152Parser();
+
case TimeObservationNameEditPart.VISUAL_ID:
return getTimeObservationName_5142Parser();
case TimeObservationStereotypeLabelEditPart.VISUAL_ID:
return getTimeObservationName_5143Parser();
+
case LiteralBooleanNameEditPart.VISUAL_ID:
return getLiteralBooleanName_5178Parser();
case LiteralBooleanFloatingLabelEditPart.VISUAL_ID:
return getLiteralBooleanName_6106Parser();
+
case LiteralIntegerNameEditPart.VISUAL_ID:
return getLiteralIntegerName_5179Parser();
case LiteralIntegerFloatingLabelEditPart.VISUAL_ID:
return getLiteralIntegerName_6107Parser();
+
case LiteralNullNameEditPart.VISUAL_ID:
return getLiteralNullName_5180Parser();
case LiteralNullFloatingLabelEditPart.VISUAL_ID:
return getLiteralNullName_6108Parser();
+
case LiteralStringNameEditPart.VISUAL_ID:
return getLiteralStringName_5181Parser();
case LiteralStringFloatingLabelEditPart.VISUAL_ID:
return getLiteralStringName_6109Parser();
+
case LiteralUnlimitedNaturalNameEditPart.VISUAL_ID:
return getLiteralUnlimitedNaturalName_5182Parser();
case LiteralUnlimitedNaturalFloatingLabelEditPart.VISUAL_ID:
return getLiteralUnlimitedNaturalName_6110Parser();
+
case StringExpressionNameEditPart.VISUAL_ID:
return getStringExpressionName_5183Parser();
case StringExpressionFloatingLabelEditPart.VISUAL_ID:
return getStringExpressionName_6111Parser();
+
case OpaqueExpressionNameEditPart.VISUAL_ID:
return getOpaqueExpressionName_5184Parser();
case OpaqueExpressionFloatingLabelEditPart.VISUAL_ID:
return getOpaqueExpressionName_6112Parser();
+
case TimeExpressionNameEditPart.VISUAL_ID:
return getTimeExpressionName_5185Parser();
case TimeExpressionFloatingLabelEditPart.VISUAL_ID:
return getTimeExpressionName_6113Parser();
+
case ExpressionNameEditPart.VISUAL_ID:
return getExpressionName_5186Parser();
case ExpressionFloatingLabelEditPart.VISUAL_ID:
return getExpressionName_6114Parser();
+
case DurationNameEditPart.VISUAL_ID:
return getDurationName_5187Parser();
case DurationFloatingLabelEditPart.VISUAL_ID:
return getDurationName_6115Parser();
+
case TimeIntervalNameEditPart.VISUAL_ID:
return getTimeIntervalName_5188Parser();
case TimeIntervalFloatingLabelEditPart.VISUAL_ID:
return getTimeIntervalName_6116Parser();
+
case DurationIntervalNameEditPart.VISUAL_ID:
return getDurationIntervalName_5189Parser();
case DurationIntervalFloatingLabelEditPart.VISUAL_ID:
return getDurationIntervalName_6117Parser();
+
case IntervalNameEditPart.VISUAL_ID:
return getIntervalName_5190Parser();
case IntervalFloatingLabelEditPart.VISUAL_ID:
return getIntervalName_6118Parser();
+
case InstanceValueNameEditPart.VISUAL_ID:
return getInstanceValueName_5191Parser();
case InstanceValueFloatingLabelEditPart.VISUAL_ID:
return getInstanceValueName_6119Parser();
+
case CommentBodyEditPart.VISUAL_ID:
return getCommentBody_5192Parser();
+
case DurationConstraintNameEditPart.VISUAL_ID:
return getDurationConstraintName_5193Parser();
case DurationConstraintSpecificationEditPart.VISUAL_ID:
return getDurationConstraintSpecification_6035Parser();
+
case TimeConstraintNameEditPart.VISUAL_ID:
return getTimeConstraintName_5194Parser();
case TimeConstraintSpecificationEditPart.VISUAL_ID:
return getTimeConstraintSpecification_6036Parser();
+
case IntervalConstraintNameEditPart.VISUAL_ID:
return getIntervalConstraintName_5195Parser();
case IntervalConstraintSpecificationEditPart.VISUAL_ID:
return getIntervalConstraintSpecification_6037Parser();
+
case InteractionConstraintNameEditPart.VISUAL_ID:
return getInteractionConstraintName_5196Parser();
case InteractionConstraintSpecificationEditPart.VISUAL_ID:
return getInteractionConstraintSpecification_6038Parser();
+
case ConstraintNameEditPart.VISUAL_ID:
return getConstraintName_5197Parser();
case ConstraintSpecificationEditPart.VISUAL_ID:
return getConstraintSpecification_6039Parser();
+
case BehaviorPortFloatingLabelEditPart.VISUAL_ID:
return getNodeName_6053Parser();
+
case PortNameEditPart.VISUAL_ID:
return getPortName_5125Parser();
case PortAppliedStereotypeEditPart.VISUAL_ID:
return getPortName_6029Parser();
+
case ParameterNameEditPart.VISUAL_ID:
return getParameterName_6033Parser();
case ParameterAppliedStereotypeEditPart.VISUAL_ID:
return getParameterName_6034Parser();
+
case PropertyPartNameEditPartCN.VISUAL_ID:
return getPropertyName_5126Parser();
case PropertyPartFloatingLabelEditPartCN.VISUAL_ID:
return getPropertyName_6054Parser();
+
case CollaborationRoleNameEditPartCN.VISUAL_ID:
return getConnectableElementName_5198Parser();
case CollaborationRoleFloatingLabelEditPartCN.VISUAL_ID:
return getConnectableElementName_6055Parser();
+
case CollaborationUseNameEditPart.VISUAL_ID:
return getCollaborationUseName_5127Parser();
case CollaborationUseFloatingLabelEditPartCN.VISUAL_ID:
return getCollaborationUseName_6056Parser();
+
case ActivityCompositeNameEditPartCN.VISUAL_ID:
return getActivityName_5128Parser();
case ActivityCompositeFloatingLabelEditPartCN.VISUAL_ID:
return getActivityName_6057Parser();
+
case InteractionCompositeNameEditPartCN.VISUAL_ID:
return getInteractionName_5129Parser();
case InteractionCompositeFloatingLabelEditPartCN.VISUAL_ID:
return getInteractionName_6058Parser();
+
case ProtocolStateMachineCompositeNameEditPartCN.VISUAL_ID:
return getProtocolStateMachineName_5130Parser();
case ProtocolStateMachineCompositeFloatingLabelEditPartCN.VISUAL_ID:
return getProtocolStateMachineName_6059Parser();
+
case StateMachineCompositeNameEditPartCN.VISUAL_ID:
return getStateMachineName_5131Parser();
case StateMachineCompositeFloatingLabelEditPartCN.VISUAL_ID:
return getStateMachineName_6060Parser();
+
case FunctionBehaviorCompositeNameEditPartCN.VISUAL_ID:
return getFunctionBehaviorName_5132Parser();
case FunctionBehaviorCompositeFloatingLabelEditPartCN.VISUAL_ID:
return getFunctionBehaviorName_6061Parser();
+
case OpaqueBehaviorCompositeNameEditPartCN.VISUAL_ID:
return getOpaqueBehaviorName_5133Parser();
case OpaqueBehaviorCompositeFloatingLabelEditPartCN.VISUAL_ID:
return getOpaqueBehaviorName_6062Parser();
+
case ComponentCompositeNameEditPartCN.VISUAL_ID:
return getComponentName_5137Parser();
case ComponentCompositeFloatingLabelEditPartCN.VISUAL_ID:
return getComponentName_6063Parser();
+
case DeviceCompositeNameEditPartCN.VISUAL_ID:
return getDeviceName_5138Parser();
case DeviceCompositeFloatingLabelEditPartCN.VISUAL_ID:
return getDeviceName_6064Parser();
+
case ExecutionEnvironmentCompositeNameEditPartCN.VISUAL_ID:
return getExecutionEnvironmentName_5139Parser();
case ExecutionEnvironmentCompositeFloatingLabelEditPartCN.VISUAL_ID:
return getExecutionEnvironmentName_6065Parser();
+
case NodeCompositeNameEditPartCN.VISUAL_ID:
return getNodeName_5140Parser();
case NodeCompositeFloatingLabelEditPartCN.VISUAL_ID:
return getNodeName_6066Parser();
+
case ClassCompositeNameEditPartCN.VISUAL_ID:
return getClassName_5155Parser();
case ClassCompositeFloatingLabelEditPartCN.VISUAL_ID:
return getClassName_6067Parser();
+
case CollaborationCompositeNameEditPartCN.VISUAL_ID:
return getCollaborationName_5141Parser();
case CollaborationCompositeFloatingLabelEditPartCN.VISUAL_ID:
return getCollaborationName_6068Parser();
+
case InterfaceNameEditPartCN.VISUAL_ID:
return getInterfaceName_5154Parser();
case InterfaceFloatingLabelEditPartCN.VISUAL_ID:
return getInterfaceName_6069Parser();
+
case PrimitiveTypeNameEditPartCN.VISUAL_ID:
return getPrimitiveTypeName_5134Parser();
case PrimitiveTypeFloatingLabelEditPartCN.VISUAL_ID:
return getPrimitiveTypeName_6070Parser();
+
case EnumerationNameEditPartCN.VISUAL_ID:
return getEnumerationName_5135Parser();
case EnumerationFloatingLabelEditPartCN.VISUAL_ID:
return getEnumerationName_6071Parser();
+
case DataTypeNameEditPartCN.VISUAL_ID:
return getDataTypeName_5136Parser();
case DataTypeFloatingLabelEditPartCN.VISUAL_ID:
return getDataTypeName_6072Parser();
+
case ActorNameEditPartCN.VISUAL_ID:
return getActorName_5144Parser();
case ActorFloatingLabelEditPartCN.VISUAL_ID:
return getActorName_6073Parser();
+
case DeploymentSpecificationNameEditPartCN.VISUAL_ID:
return getDeploymentSpecificationName_5145Parser();
case DeploymentSpecificationFloatingLabelEditPartCN.VISUAL_ID:
return getDeploymentSpecificationName_6074Parser();
+
case ArtifactNameEditPartCN.VISUAL_ID:
return getArtifactName_5146Parser();
case ArtifactFloatingLabelEditPartCN.VISUAL_ID:
return getArtifactName_6075Parser();
+
case InformationItemNameEditPartCN.VISUAL_ID:
return getInformationItemName_5147Parser();
case InformationItemFloatingLabelEditPartCN.VISUAL_ID:
return getInformationItemName_6076Parser();
+
case SignalNameEditPartCN.VISUAL_ID:
return getSignalName_5148Parser();
case SignalFloatingLabelEditPartCN.VISUAL_ID:
return getSignalName_6077Parser();
+
case UseCaseNameEditPartCN.VISUAL_ID:
return getUseCaseName_5149Parser();
case UseCaseFloatingLabelEditPartCN.VISUAL_ID:
return getUseCaseName_6078Parser();
+
case CommentBodyEditPartCN.VISUAL_ID:
return getCommentBody_5150Parser();
+
case DurationConstraintNameEditPartCN.VISUAL_ID:
return getDurationConstraintName_6040Parser();
case DurationConstraintSpecificationEditPartCN.VISUAL_ID:
return getDurationConstraintSpecification_6041Parser();
+
case TimeConstraintNameEditPartCN.VISUAL_ID:
return getTimeConstraintName_6042Parser();
case TimeConstraintSpecificationEditPartCN.VISUAL_ID:
return getTimeConstraintSpecification_6043Parser();
+
case IntervalConstraintNameEditPartCN.VISUAL_ID:
return getIntervalConstraintName_6044Parser();
case IntervalConstraintSpecificationEditPartCN.VISUAL_ID:
return getIntervalConstraintSpecification_6045Parser();
+
case InteractionConstraintNameEditPartCN.VISUAL_ID:
return getInteractionConstraintName_6046Parser();
case InteractionConstraintSpecificationEditPartCN.VISUAL_ID:
return getInteractionConstraintSpecification_6047Parser();
+
case ConstraintNameEditPartCN.VISUAL_ID:
return getConstraintName_6048Parser();
case ConstraintSpecificationEditPartCN.VISUAL_ID:
return getConstraintSpecification_6049Parser();
+
case PropertyEditPartCLN.VISUAL_ID:
return getProperty_3101Parser();
case OperationEditPartCLN.VISUAL_ID:
return getOperation_3102Parser();
case EnumerationLiteralEditPartCLN.VISUAL_ID:
return getEnumerationLiteral_3066Parser();
+
+
+
+
case ComponentRealizationNameEditPart.VISUAL_ID:
return getComponentRealizationName_6001Parser();
case ComponentRealizationAppliedStereotypeEditPart.VISUAL_ID:
return getComponentRealizationName_6015Parser();
+
case InterfaceRealizationNameEditPart.VISUAL_ID:
return getInterfaceRealizationName_6002Parser();
case InterfaceRealizationAppliedStereotypeEditPart.VISUAL_ID:
return getInterfaceRealizationName_6016Parser();
+
case SubstitutionNameEditPart.VISUAL_ID:
return getSubstitutionName_6003Parser();
case SubstitutionAppliedStereotypeEditPart.VISUAL_ID:
return getSubstitutionName_6017Parser();
+
case RealizationNameEditPart.VISUAL_ID:
return getRealizationName_6004Parser();
case RealizationAppliedStereotypeEditPart.VISUAL_ID:
return getRealizationName_6018Parser();
+
case ManifestationNameEditPart.VISUAL_ID:
return getManifestationName_6005Parser();
case ManifestationAppliedStereotypeEditPart.VISUAL_ID:
return getManifestationName_6019Parser();
+
case AbstractionNameEditPart.VISUAL_ID:
return getAbstractionName_6006Parser();
case AbstractionAppliedStereotypeEditPart.VISUAL_ID:
return getAbstractionName_6020Parser();
+
case UsageNameEditPart.VISUAL_ID:
return getUsageName_6007Parser();
case UsageAppliedStereotypeEditPart.VISUAL_ID:
return getUsageName_6021Parser();
+
case DeploymentNameEditPart.VISUAL_ID:
return getDeploymentName_6008Parser();
case DeploymentAppliedStereotypeEditPart.VISUAL_ID:
return getDeploymentName_6022Parser();
+
case RoleBindingRoleNameEditPart.VISUAL_ID:
return getDependencyName_6027Parser();
case RoleBindingAppliedStereotypeEditPart.VISUAL_ID:
return getDependencyName_6028Parser();
+
case DependencyNameEditPart.VISUAL_ID:
return getDependencyName_6009Parser();
case DependencyAppliedStereotypeEditPart.VISUAL_ID:
return getDependencyName_6023Parser();
+
case ConnectorAppliedStereotypeEditPart.VISUAL_ID:
return getConnectorName_6025Parser();
case ConnectorNameEditPart.VISUAL_ID:
@@ -3833,16 +4092,23 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
return getConnectorName_6051Parser();
case ConnectorMultiplicityTargetEditPart.VISUAL_ID:
return getConnectorName_6052Parser();
+
case GeneralizationAppliedStereotypeEditPart.VISUAL_ID:
return getGeneralizationIsSubstitutable_6024Parser();
+
+
+
+
case InformationFlowAppliedStereotypeEditPart.VISUAL_ID:
return getInformationFlowName_6032Parser();
+
}
return null;
}
/**
* Utility method that consults ParserService
+ *
* @generated
*/
public static IParser getParser(IElementType type, EObject object, String parserHint) {
@@ -3853,12 +4119,12 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
public IParser getParser(IAdaptable hint) {
- String vid = (String)hint.getAdapter(String.class);
- if(vid != null) {
+ String vid = (String) hint.getAdapter(String.class);
+ if (vid != null) {
return getParser(UMLVisualIDRegistry.getVisualID(vid));
}
- View view = (View)hint.getAdapter(View.class);
- if(view != null) {
+ View view = (View) hint.getAdapter(View.class);
+ if (view != null) {
return getParser(UMLVisualIDRegistry.getVisualID(view));
}
return null;
@@ -3868,9 +4134,9 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
public boolean provides(IOperation operation) {
- if(operation instanceof GetParserOperation) {
- IAdaptable hint = ((GetParserOperation)operation).getHint();
- if(UMLElementTypes.getElement(hint) == null) {
+ if (operation instanceof GetParserOperation) {
+ IAdaptable hint = ((GetParserOperation) operation).getHint();
+ if (UMLElementTypes.getElement(hint) == null) {
return false;
}
return getParser(hint) != null;
@@ -3901,7 +4167,7 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
* @generated
*/
public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) {
- if(IElementType.class.equals(adapter)) {
+ if (IElementType.class.equals(adapter)) {
return elementType;
}
return super.getAdapter(adapter);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/providers/UMLValidationDecoratorProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/providers/UMLValidationDecoratorProvider.java
index a941cce9379..1c109056a8b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/providers/UMLValidationDecoratorProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/providers/UMLValidationDecoratorProvider.java
@@ -36,20 +36,20 @@ public class UMLValidationDecoratorProvider extends ValidationDecoratorProvider
* @generated
*/
public void createDecorators(IDecoratorTarget decoratorTarget) {
- EditPart editPart = (EditPart)decoratorTarget.getAdapter(EditPart.class);
- if(editPart instanceof GraphicalEditPart || editPart instanceof AbstractConnectionEditPart) {
+ EditPart editPart = (EditPart) decoratorTarget.getAdapter(EditPart.class);
+ if (editPart instanceof GraphicalEditPart || editPart instanceof AbstractConnectionEditPart) {
Object model = editPart.getModel();
- if((model instanceof View)) {
- View view = (View)model;
- if(!(view instanceof Edge) && !view.isSetElement()) {
+ if ((model instanceof View)) {
+ View view = (View) model;
+ if (!(view instanceof Edge) && !view.isSetElement()) {
return;
}
}
EditDomain ed = editPart.getViewer().getEditDomain();
- if(!(ed instanceof DiagramEditDomain)) {
+ if (!(ed instanceof DiagramEditDomain)) {
return;
}
- if(((DiagramEditDomain)ed).getEditorPart() instanceof UMLDiagramEditor) {
+ if (((DiagramEditDomain) ed).getEditorPart() instanceof UMLDiagramEditor) {
decoratorTarget.installDecorator(KEY, new StatusDecorator(decoratorTarget));
}
}
@@ -59,11 +59,12 @@ public class UMLValidationDecoratorProvider extends ValidationDecoratorProvider
* @generated
*/
public boolean provides(IOperation operation) {
- if(!(operation instanceof CreateDecoratorsOperation)) {
+ if (!(operation instanceof CreateDecoratorsOperation)) {
return false;
}
- IDecoratorTarget decoratorTarget = ((CreateDecoratorsOperation)operation).getDecoratorTarget();
- View view = (View)decoratorTarget.getAdapter(View.class);
+ IDecoratorTarget decoratorTarget = ((CreateDecoratorsOperation) operation).getDecoratorTarget();
+ View view = (View) decoratorTarget.getAdapter(
+ View.class);
return view != null && CompositeStructureDiagramEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(view));
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/providers/UMLValidationProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/providers/UMLValidationProvider.java
index 3b97299ede0..a62e09a0be9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/providers/UMLValidationProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/providers/UMLValidationProvider.java
@@ -40,7 +40,6 @@ public class UMLValidationProvider {
public static void runWithConstraints(TransactionalEditingDomain editingDomain, Runnable operation) {
final Runnable op = operation;
Runnable task = new Runnable() {
-
@Override
public void run() {
try {
@@ -51,7 +50,7 @@ public class UMLValidationProvider {
}
}
};
- if(editingDomain != null) {
+ if (editingDomain != null) {
try {
editingDomain.runExclusive(task);
} catch (Exception e) {
@@ -66,11 +65,11 @@ public class UMLValidationProvider {
* @generated
*/
static boolean isInDefaultEditorContext(Object object) {
- if(shouldConstraintsBePrivate() && !constraintsActive) {
+ if (shouldConstraintsBePrivate() && !constraintsActive) {
return false;
}
- if(object instanceof View) {
- return constraintsActive && CompositeStructureDiagramEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID((View)object));
+ if (object instanceof View) {
+ return constraintsActive && CompositeStructureDiagramEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID((View) object));
}
return true;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/providers/UMLViewProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/providers/UMLViewProvider.java
index 717f958945d..129d05c4b79 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/providers/UMLViewProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/providers/UMLViewProvider.java
@@ -72,16 +72,16 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
* @generated
*/
public final boolean provides(IOperation operation) {
- if(operation instanceof CreateViewForKindOperation) {
- return provides((CreateViewForKindOperation)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);
+ 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;
}
@@ -91,20 +91,23 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
*/
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;
+ * 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 = UMLVisualIDRegistry.getModelID(op.getContainerView());
- if(!getDiagramProvidedId().equals(modelID)) {
+ if (!getDiagramProvidedId().equals(modelID)) {
return false;
}
+
int visualID = UMLVisualIDRegistry.getVisualID(op.getSemanticHint());
- if(Node.class.isAssignableFrom(op.getViewKind())) {
+ if (Node.class.isAssignableFrom(op.getViewKind())) {
return UMLVisualIDRegistry.canCreateNode(op.getContainerView(), visualID);
}
+
return true;
}
@@ -134,38 +137,40 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
* @generated
*/
protected boolean provides(CreateNodeViewOperation op) {
- if(op.getContainerView() == null) {
+ if (op.getContainerView() == null) {
return false;
}
IElementType elementType = getSemanticElementType(op.getSemanticAdapter());
EObject domainElement = getSemanticElement(op.getSemanticAdapter());
int visualID;
- if(op.getSemanticHint() == null) {
+ 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) {
+ if (elementType != null || domainElement == null) {
return false;
}
visualID = UMLVisualIDRegistry.getNodeVisualID(op.getContainerView(), domainElement);
} else {
visualID = UMLVisualIDRegistry.getVisualID(op.getSemanticHint());
- if(elementType != null) {
- if(!UMLElementTypes.isKnownElementType(elementType) || (!(elementType instanceof IHintedType))) {
+ if (elementType != null) {
+
+ if (!UMLElementTypes.isKnownElementType(elementType) || (!(elementType instanceof IHintedType))) {
return false; // foreign element type
}
- String elementTypeHint = ((IHintedType)elementType).getSemanticHint();
- if(!op.getSemanticHint().equals(elementTypeHint)) {
+
+ 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 != org.eclipse.papyrus.uml.diagram.composite.part.UMLVisualIDRegistry.getNodeVisualID(op.getContainerView(), domainElement)) {
- // return false; // visual id for node EClass should match visual id from element type
- //}
+ // if (domainElement != null && visualID != org.eclipse.papyrus.uml.diagram.composite.part.UMLVisualIDRegistry.getNodeVisualID(op.getContainerView(), domainElement)) {
+ // return false; // visual id for node EClass should match visual id from element type
+ // }
} else {
- if(!CompositeStructureDiagramEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(op.getContainerView()))) {
+ if (!CompositeStructureDiagramEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(op.getContainerView()))) {
return false; // foreign diagram
}
- switch(visualID) {
+ switch (visualID) {
case BehaviorPortEditPart.VISUAL_ID:
break; // pure design element
case ActivityCompositeEditPart.VISUAL_ID:
@@ -253,7 +258,7 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
case ConstraintEditPartCN.VISUAL_ID:
case PropertyEditPartCLN.VISUAL_ID:
case OperationEditPartCLN.VISUAL_ID:
- if(domainElement == null || visualID != UMLVisualIDRegistry.getNodeVisualID(op.getContainerView(), domainElement)) {
+ if (domainElement == null || visualID != UMLVisualIDRegistry.getNodeVisualID(op.getContainerView(), domainElement)) {
return false; // visual id in semantic hint should match visual id for domain element
}
break;
@@ -262,6 +267,7 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
}
}
}
+
return UMLVisualIDRegistry.canCreateNode(op.getContainerView(), visualID);
}
@@ -270,30 +276,30 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
*/
protected boolean provides(CreateEdgeViewOperation op) {
IElementType elementType = getSemanticElementType(op.getSemanticAdapter());
- //RS: add code for extended types creation
- if(elementType instanceof IExtendedHintedElementType) {
+ // RS: add code for extended types creation
+ if (elementType instanceof IExtendedHintedElementType) {
IElementType closestNonExtendedType = ElementTypeUtils.getClosestDiagramType(elementType);
- if(!UMLElementTypes.isKnownElementType(closestNonExtendedType) || (!(closestNonExtendedType instanceof IHintedType))) {
+ if (!UMLElementTypes.isKnownElementType(closestNonExtendedType) || (!(closestNonExtendedType instanceof IHintedType))) {
return false; // foreign element type.
}
} else {
- if(!UMLElementTypes.isKnownElementType(elementType) || (!(elementType instanceof IHintedType))) {
+ if (!UMLElementTypes.isKnownElementType(elementType) || (!(elementType instanceof IHintedType))) {
return false; // foreign element type
}
}
- //if (!org.eclipse.papyrus.uml.diagram.composite.providers.UMLElementTypes.isKnownElementType(elementType) || (!(elementType instanceof org.eclipse.gmf.runtime.emf.type.core.IHintedType))) {
- // return false; // foreign element type
- //}
+ // if (!org.eclipse.papyrus.uml.diagram.composite.providers.UMLElementTypes.isKnownElementType(elementType) || (!(elementType instanceof org.eclipse.gmf.runtime.emf.type.core.IHintedType))) {
+ // return false; // foreign element type
+ // }
// END R.S.
- String elementTypeHint = ((IHintedType)elementType).getSemanticHint();
- if(elementTypeHint == null || (op.getSemanticHint() != null && !elementTypeHint.equals(op.getSemanticHint()))) {
+ 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 = org.eclipse.papyrus.uml.diagram.composite.part.UMLVisualIDRegistry.getVisualID(elementTypeHint);
- //org.eclipse.emf.ecore.EObject domainElement = getSemanticElement(op.getSemanticAdapter());
- //if (domainElement != null && visualID != org.eclipse.papyrus.uml.diagram.composite.part.UMLVisualIDRegistry.getLinkWithClassVisualID(domainElement)) {
- // return false; // visual id for link EClass should match visual id from element type
- //}
+ // int visualID = org.eclipse.papyrus.uml.diagram.composite.part.UMLVisualIDRegistry.getVisualID(elementTypeHint);
+ // org.eclipse.emf.ecore.EObject domainElement = getSemanticElement(op.getSemanticAdapter());
+ // if (domainElement != null && visualID != org.eclipse.papyrus.uml.diagram.composite.part.UMLVisualIDRegistry.getLinkWithClassVisualID(domainElement)) {
+ // return false; // visual id for link EClass should match visual id from element type
+ // }
return true;
}
@@ -317,12 +323,12 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
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) {
+ if (semanticHint == null) {
visualID = UMLVisualIDRegistry.getNodeVisualID(containerView, domainElement);
} else {
visualID = UMLVisualIDRegistry.getVisualID(semanticHint);
}
- switch(visualID) {
+ switch (visualID) {
case ActivityCompositeEditPart.VISUAL_ID:
return createActivity_2060(domainElement, containerView, index, persisted, preferencesHint);
case InteractionCompositeEditPart.VISUAL_ID:
@@ -505,8 +511,8 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
*/
public Edge createEdge(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint) {
IElementType elementType = getSemanticElementType(semanticAdapter);
- String elementTypeHint = ((IHintedType)elementType).getSemanticHint();
- switch(UMLVisualIDRegistry.getVisualID(elementTypeHint)) {
+ String elementTypeHint = ((IHintedType) elementType).getSemanticHint();
+ switch (UMLVisualIDRegistry.getVisualID(elementTypeHint)) {
case BehaviorPortLinkEditPart.VISUAL_ID:
return createLink_4022(containerView, index, persisted, preferencesHint);
case LinkDescriptorEditPart.VISUAL_ID:
@@ -562,13 +568,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Activity");
Node label5112 = createLabel(node, UMLVisualIDRegistry.getType(ActivityCompositeNameEditPart.VISUAL_ID));
Node label6079 = createLabel(node, UMLVisualIDRegistry.getType(ActivityCompositeFloatingLabelEditPart.VISUAL_ID));
label6079.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6079 = (Location)label6079.getLayoutConstraint();
+ Location location6079 = (Location) label6079.getLayoutConstraint();
location6079.setX(0);
location6079.setY(5);
createCompartment(node, UMLVisualIDRegistry.getType(ActivityCompositeCompartmentEditPart.VISUAL_ID), true, true, false, false);
@@ -586,13 +593,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Interaction");
Node label5113 = createLabel(node, UMLVisualIDRegistry.getType(InteractionCompositeNameEditPart.VISUAL_ID));
Node label6080 = createLabel(node, UMLVisualIDRegistry.getType(InteractionCompositeFloatingLabelEditPart.VISUAL_ID));
label6080.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6080 = (Location)label6080.getLayoutConstraint();
+ Location location6080 = (Location) label6080.getLayoutConstraint();
location6080.setX(0);
location6080.setY(5);
createCompartment(node, UMLVisualIDRegistry.getType(InteractionCompositeCompartmentEditPart.VISUAL_ID), true, true, false, false);
@@ -610,13 +618,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "ProtocolStateMachine");
Node label5114 = createLabel(node, UMLVisualIDRegistry.getType(ProtocolStateMachineCompositeNameEditPart.VISUAL_ID));
Node label6081 = createLabel(node, UMLVisualIDRegistry.getType(ProtocolStateMachineCompositeFloatingLabelEditPart.VISUAL_ID));
label6081.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6081 = (Location)label6081.getLayoutConstraint();
+ Location location6081 = (Location) label6081.getLayoutConstraint();
location6081.setX(0);
location6081.setY(5);
createCompartment(node, UMLVisualIDRegistry.getType(ProtocolStateMachineCompositeCompartmentEditPart.VISUAL_ID), true, true, false, false);
@@ -634,13 +643,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "StateMachine");
Node label5115 = createLabel(node, UMLVisualIDRegistry.getType(StateMachineCompositeNameEditPart.VISUAL_ID));
Node label6082 = createLabel(node, UMLVisualIDRegistry.getType(StateMachineCompositeFloatingLabelEditPart.VISUAL_ID));
label6082.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6082 = (Location)label6082.getLayoutConstraint();
+ Location location6082 = (Location) label6082.getLayoutConstraint();
location6082.setX(0);
location6082.setY(5);
createCompartment(node, UMLVisualIDRegistry.getType(StateMachineCompositeCompartmentEditPart.VISUAL_ID), true, true, false, false);
@@ -658,13 +668,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "FunctionBehavior");
Node label5116 = createLabel(node, UMLVisualIDRegistry.getType(FunctionBehaviorCompositeNameEditPart.VISUAL_ID));
Node label6083 = createLabel(node, UMLVisualIDRegistry.getType(FunctionBehaviorCompositeFloatingLabelEditPart.VISUAL_ID));
label6083.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6083 = (Location)label6083.getLayoutConstraint();
+ Location location6083 = (Location) label6083.getLayoutConstraint();
location6083.setX(0);
location6083.setY(5);
createCompartment(node, UMLVisualIDRegistry.getType(FunctionBehaviorCompositeCompartmentEditPart.VISUAL_ID), true, true, false, false);
@@ -682,13 +693,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "OpaqueBehavior");
Node label5117 = createLabel(node, UMLVisualIDRegistry.getType(OpaqueBehaviorCompositeNameEditPart.VISUAL_ID));
Node label6084 = createLabel(node, UMLVisualIDRegistry.getType(OpaqueBehaviorCompositeFloatingLabelEditPart.VISUAL_ID));
label6084.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6084 = (Location)label6084.getLayoutConstraint();
+ Location location6084 = (Location) label6084.getLayoutConstraint();
location6084.setX(0);
location6084.setY(5);
createCompartment(node, UMLVisualIDRegistry.getType(OpaqueBehaviorCompositeCompartmentEditPart.VISUAL_ID), true, true, false, false);
@@ -706,13 +718,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Component");
Node label5121 = createLabel(node, UMLVisualIDRegistry.getType(ComponentCompositeNameEditPart.VISUAL_ID));
Node label6085 = createLabel(node, UMLVisualIDRegistry.getType(ComponentCompositeFloatingLabelEditPart.VISUAL_ID));
label6085.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6085 = (Location)label6085.getLayoutConstraint();
+ Location location6085 = (Location) label6085.getLayoutConstraint();
location6085.setX(0);
location6085.setY(5);
createCompartment(node, UMLVisualIDRegistry.getType(ComponentCompositeCompartmentEditPart.VISUAL_ID), true, true, false, false);
@@ -730,13 +743,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Device");
Node label5122 = createLabel(node, UMLVisualIDRegistry.getType(DeviceCompositeNameEditPart.VISUAL_ID));
Node label6086 = createLabel(node, UMLVisualIDRegistry.getType(DeviceCompositeFloatingLabelEditPart.VISUAL_ID));
label6086.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6086 = (Location)label6086.getLayoutConstraint();
+ Location location6086 = (Location) label6086.getLayoutConstraint();
location6086.setX(0);
location6086.setY(5);
createCompartment(node, UMLVisualIDRegistry.getType(DeviceCompositeCompartmentEditPart.VISUAL_ID), true, true, false, false);
@@ -754,13 +768,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "ExecutionEnvironment");
Node label5123 = createLabel(node, UMLVisualIDRegistry.getType(ExecutionEnvironmentCompositeNameEditPart.VISUAL_ID));
Node label6087 = createLabel(node, UMLVisualIDRegistry.getType(ExecutionEnvironmentCompositeFloatingLabelEditPart.VISUAL_ID));
label6087.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6087 = (Location)label6087.getLayoutConstraint();
+ Location location6087 = (Location) label6087.getLayoutConstraint();
location6087.setX(0);
location6087.setY(5);
createCompartment(node, UMLVisualIDRegistry.getType(ExecutionEnvironmentCompositeCompartmentEditPart.VISUAL_ID), true, true, false, false);
@@ -778,13 +793,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Node");
Node label5124 = createLabel(node, UMLVisualIDRegistry.getType(NodeCompositeNameEditPart.VISUAL_ID));
Node label6088 = createLabel(node, UMLVisualIDRegistry.getType(NodeCompositeFloatingLabelEditPart.VISUAL_ID));
label6088.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6088 = (Location)label6088.getLayoutConstraint();
+ Location location6088 = (Location) label6088.getLayoutConstraint();
location6088.setX(0);
location6088.setY(5);
createCompartment(node, UMLVisualIDRegistry.getType(NodeCompositeCompartmentEditPart.VISUAL_ID), true, true, false, false);
@@ -802,13 +818,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Class");
Node label5156 = createLabel(node, UMLVisualIDRegistry.getType(ClassCompositeNameEditPart.VISUAL_ID));
Node label6089 = createLabel(node, UMLVisualIDRegistry.getType(ClassCompositeFloatingLabelEditPart.VISUAL_ID));
label6089.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6089 = (Location)label6089.getLayoutConstraint();
+ Location location6089 = (Location) label6089.getLayoutConstraint();
location6089.setX(0);
location6089.setY(5);
createCompartment(node, UMLVisualIDRegistry.getType(ClassCompositeCompartmentEditPart.VISUAL_ID), true, true, false, false);
@@ -826,13 +843,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Collaboration");
Node label5158 = createLabel(node, UMLVisualIDRegistry.getType(CollaborationCompositeNameEditPart.VISUAL_ID));
Node label6090 = createLabel(node, UMLVisualIDRegistry.getType(CollaborationCompositeFloatingLabelEditPart.VISUAL_ID));
label6090.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6090 = (Location)label6090.getLayoutConstraint();
+ Location location6090 = (Location) label6090.getLayoutConstraint();
location6090.setX(0);
location6090.setY(5);
createCompartment(node, UMLVisualIDRegistry.getType(CollaborationCompositeCompartmentEditPart.VISUAL_ID), true, true, false, false);
@@ -850,13 +868,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Interface");
Node label5159 = createLabel(node, UMLVisualIDRegistry.getType(InterfaceNameEditPart.VISUAL_ID));
Node label6091 = createLabel(node, UMLVisualIDRegistry.getType(InterfaceFloatingLabelEditPart.VISUAL_ID));
label6091.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6091 = (Location)label6091.getLayoutConstraint();
+ Location location6091 = (Location) label6091.getLayoutConstraint();
location6091.setX(0);
location6091.setY(5);
return node;
@@ -872,13 +891,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "PrimitiveType");
Node label5118 = createLabel(node, UMLVisualIDRegistry.getType(PrimitiveTypeNameEditPart.VISUAL_ID));
Node label6092 = createLabel(node, UMLVisualIDRegistry.getType(PrimitiveTypeFloatingLabelEditPart.VISUAL_ID));
label6092.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6092 = (Location)label6092.getLayoutConstraint();
+ Location location6092 = (Location) label6092.getLayoutConstraint();
location6092.setX(0);
location6092.setY(5);
return node;
@@ -894,13 +914,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Enumeration");
Node label5119 = createLabel(node, UMLVisualIDRegistry.getType(EnumerationNameEditPart.VISUAL_ID));
Node label6093 = createLabel(node, UMLVisualIDRegistry.getType(EnumerationFloatingLabelEditPart.VISUAL_ID));
label6093.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6093 = (Location)label6093.getLayoutConstraint();
+ Location location6093 = (Location) label6093.getLayoutConstraint();
location6093.setX(0);
location6093.setY(5);
createCompartment(node, UMLVisualIDRegistry.getType(EnumerationEnumerationLiteralCompartmentEditPart.VISUAL_ID), true, true, true, true);
@@ -918,13 +939,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "DataType");
Node label5120 = createLabel(node, UMLVisualIDRegistry.getType(DataTypeNameEditPart.VISUAL_ID));
Node label6094 = createLabel(node, UMLVisualIDRegistry.getType(DataTypeFloatingLabelEditPart.VISUAL_ID));
label6094.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6094 = (Location)label6094.getLayoutConstraint();
+ Location location6094 = (Location) label6094.getLayoutConstraint();
location6094.setX(0);
location6094.setY(5);
createCompartment(node, UMLVisualIDRegistry.getType(DataTypeAttributeCompartmentEditPart.VISUAL_ID), true, true, true, true);
@@ -943,13 +965,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Actor");
Node label5160 = createLabel(node, UMLVisualIDRegistry.getType(ActorNameEditPart.VISUAL_ID));
Node label6095 = createLabel(node, UMLVisualIDRegistry.getType(ActorFloatingLabelEditPart.VISUAL_ID));
label6095.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6095 = (Location)label6095.getLayoutConstraint();
+ Location location6095 = (Location) label6095.getLayoutConstraint();
location6095.setX(0);
location6095.setY(5);
return node;
@@ -965,13 +988,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "DeploymentSpecification");
Node label5161 = createLabel(node, UMLVisualIDRegistry.getType(DeploymentSpecificationNameEditPart.VISUAL_ID));
Node label6096 = createLabel(node, UMLVisualIDRegistry.getType(DeploymentSpecificationFloatingLabelEditPart.VISUAL_ID));
label6096.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6096 = (Location)label6096.getLayoutConstraint();
+ Location location6096 = (Location) label6096.getLayoutConstraint();
location6096.setX(0);
location6096.setY(5);
return node;
@@ -987,13 +1011,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Artifact");
Node label5162 = createLabel(node, UMLVisualIDRegistry.getType(ArtifactNameEditPart.VISUAL_ID));
Node label6097 = createLabel(node, UMLVisualIDRegistry.getType(ArtifactFloatingLabelEditPart.VISUAL_ID));
label6097.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6097 = (Location)label6097.getLayoutConstraint();
+ Location location6097 = (Location) label6097.getLayoutConstraint();
location6097.setX(0);
location6097.setY(5);
return node;
@@ -1009,13 +1034,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "InformationItem");
Node label5163 = createLabel(node, UMLVisualIDRegistry.getType(InformationItemNameEditPart.VISUAL_ID));
Node label6098 = createLabel(node, UMLVisualIDRegistry.getType(InformationItemFloatingLabelEditPart.VISUAL_ID));
label6098.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6098 = (Location)label6098.getLayoutConstraint();
+ Location location6098 = (Location) label6098.getLayoutConstraint();
location6098.setX(0);
location6098.setY(5);
return node;
@@ -1031,13 +1057,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Signal");
Node label5164 = createLabel(node, UMLVisualIDRegistry.getType(SignalNameEditPart.VISUAL_ID));
Node label6099 = createLabel(node, UMLVisualIDRegistry.getType(SignalFloatingLabelEditPart.VISUAL_ID));
label6099.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6099 = (Location)label6099.getLayoutConstraint();
+ Location location6099 = (Location) label6099.getLayoutConstraint();
location6099.setX(0);
location6099.setY(5);
return node;
@@ -1053,13 +1080,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "UseCase");
Node label5165 = createLabel(node, UMLVisualIDRegistry.getType(UseCaseNameEditPart.VISUAL_ID));
Node label6100 = createLabel(node, UMLVisualIDRegistry.getType(UseCaseFloatingLabelEditPart.VISUAL_ID));
label6100.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6100 = (Location)label6100.getLayoutConstraint();
+ Location location6100 = (Location) label6100.getLayoutConstraint();
location6100.setX(0);
location6100.setY(5);
return node;
@@ -1075,13 +1103,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "SignalEvent");
Node label5166 = createLabel(node, UMLVisualIDRegistry.getType(SignalEventNameEditPart.VISUAL_ID));
Node label6101 = createLabel(node, UMLVisualIDRegistry.getType(SignalEventFloatingLabelEditPart.VISUAL_ID));
label6101.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6101 = (Location)label6101.getLayoutConstraint();
+ Location location6101 = (Location) label6101.getLayoutConstraint();
location6101.setX(0);
location6101.setY(5);
return node;
@@ -1097,13 +1126,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "CallEvent");
Node label5167 = createLabel(node, UMLVisualIDRegistry.getType(CallEventNameEditPart.VISUAL_ID));
Node label6102 = createLabel(node, UMLVisualIDRegistry.getType(CallEventFloatingLabelEditPart.VISUAL_ID));
label6102.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6102 = (Location)label6102.getLayoutConstraint();
+ Location location6102 = (Location) label6102.getLayoutConstraint();
location6102.setX(0);
location6102.setY(5);
return node;
@@ -1119,13 +1149,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "AnyReceiveEvent");
Node label5168 = createLabel(node, UMLVisualIDRegistry.getType(AnyReceiveEventNameEditPart.VISUAL_ID));
Node label6103 = createLabel(node, UMLVisualIDRegistry.getType(AnyReceiveEventFloatingLabelEditPart.VISUAL_ID));
label6103.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6103 = (Location)label6103.getLayoutConstraint();
+ Location location6103 = (Location) label6103.getLayoutConstraint();
location6103.setX(0);
location6103.setY(5);
return node;
@@ -1141,13 +1172,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "ChangeEvent");
Node label5171 = createLabel(node, UMLVisualIDRegistry.getType(ChangeEventNameEditPart.VISUAL_ID));
Node label6104 = createLabel(node, UMLVisualIDRegistry.getType(ChangeEventFloatingLabelEditPart.VISUAL_ID));
label6104.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6104 = (Location)label6104.getLayoutConstraint();
+ Location location6104 = (Location) label6104.getLayoutConstraint();
location6104.setX(0);
location6104.setY(5);
return node;
@@ -1163,13 +1195,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "TimeEvent");
Node label5172 = createLabel(node, UMLVisualIDRegistry.getType(TimeEventNameEditPart.VISUAL_ID));
Node label6105 = createLabel(node, UMLVisualIDRegistry.getType(TimeEventFloatingLabelEditPart.VISUAL_ID));
label6105.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6105 = (Location)label6105.getLayoutConstraint();
+ Location location6105 = (Location) label6105.getLayoutConstraint();
location6105.setX(0);
location6105.setY(5);
return node;
@@ -1185,17 +1218,18 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "DurationObservation");
Node label5151 = createLabel(node, UMLVisualIDRegistry.getType(DurationObservationNameEditPart.VISUAL_ID));
label5151.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location5151 = (Location)label5151.getLayoutConstraint();
+ Location location5151 = (Location) label5151.getLayoutConstraint();
location5151.setX(25);
location5151.setY(3);
Node label5152 = createLabel(node, UMLVisualIDRegistry.getType(DurationObservationStereotypeLabelEditPart.VISUAL_ID));
label5152.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location5152 = (Location)label5152.getLayoutConstraint();
+ Location location5152 = (Location) label5152.getLayoutConstraint();
location5152.setX(25);
location5152.setY(-10);
return node;
@@ -1211,17 +1245,18 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "TimeObservation");
Node label5142 = createLabel(node, UMLVisualIDRegistry.getType(TimeObservationNameEditPart.VISUAL_ID));
label5142.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location5142 = (Location)label5142.getLayoutConstraint();
+ Location location5142 = (Location) label5142.getLayoutConstraint();
location5142.setX(25);
location5142.setY(3);
Node label5143 = createLabel(node, UMLVisualIDRegistry.getType(TimeObservationStereotypeLabelEditPart.VISUAL_ID));
label5143.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location5143 = (Location)label5143.getLayoutConstraint();
+ Location location5143 = (Location) label5143.getLayoutConstraint();
location5143.setX(25);
location5143.setY(-10);
return node;
@@ -1237,13 +1272,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "LiteralBoolean");
Node label5178 = createLabel(node, UMLVisualIDRegistry.getType(LiteralBooleanNameEditPart.VISUAL_ID));
Node label6106 = createLabel(node, UMLVisualIDRegistry.getType(LiteralBooleanFloatingLabelEditPart.VISUAL_ID));
label6106.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6106 = (Location)label6106.getLayoutConstraint();
+ Location location6106 = (Location) label6106.getLayoutConstraint();
location6106.setX(0);
location6106.setY(5);
return node;
@@ -1259,13 +1295,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "LiteralInteger");
Node label5179 = createLabel(node, UMLVisualIDRegistry.getType(LiteralIntegerNameEditPart.VISUAL_ID));
Node label6107 = createLabel(node, UMLVisualIDRegistry.getType(LiteralIntegerFloatingLabelEditPart.VISUAL_ID));
label6107.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6107 = (Location)label6107.getLayoutConstraint();
+ Location location6107 = (Location) label6107.getLayoutConstraint();
location6107.setX(0);
location6107.setY(5);
return node;
@@ -1281,13 +1318,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "LiteralNull");
Node label5180 = createLabel(node, UMLVisualIDRegistry.getType(LiteralNullNameEditPart.VISUAL_ID));
Node label6108 = createLabel(node, UMLVisualIDRegistry.getType(LiteralNullFloatingLabelEditPart.VISUAL_ID));
label6108.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6108 = (Location)label6108.getLayoutConstraint();
+ Location location6108 = (Location) label6108.getLayoutConstraint();
location6108.setX(0);
location6108.setY(5);
return node;
@@ -1303,13 +1341,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "LiteralString");
Node label5181 = createLabel(node, UMLVisualIDRegistry.getType(LiteralStringNameEditPart.VISUAL_ID));
Node label6109 = createLabel(node, UMLVisualIDRegistry.getType(LiteralStringFloatingLabelEditPart.VISUAL_ID));
label6109.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6109 = (Location)label6109.getLayoutConstraint();
+ Location location6109 = (Location) label6109.getLayoutConstraint();
location6109.setX(0);
location6109.setY(5);
return node;
@@ -1325,13 +1364,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "LiteralUnlimitedNatural");
Node label5182 = createLabel(node, UMLVisualIDRegistry.getType(LiteralUnlimitedNaturalNameEditPart.VISUAL_ID));
Node label6110 = createLabel(node, UMLVisualIDRegistry.getType(LiteralUnlimitedNaturalFloatingLabelEditPart.VISUAL_ID));
label6110.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6110 = (Location)label6110.getLayoutConstraint();
+ Location location6110 = (Location) label6110.getLayoutConstraint();
location6110.setX(0);
location6110.setY(5);
return node;
@@ -1347,13 +1387,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "StringExpression");
Node label5183 = createLabel(node, UMLVisualIDRegistry.getType(StringExpressionNameEditPart.VISUAL_ID));
Node label6111 = createLabel(node, UMLVisualIDRegistry.getType(StringExpressionFloatingLabelEditPart.VISUAL_ID));
label6111.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6111 = (Location)label6111.getLayoutConstraint();
+ Location location6111 = (Location) label6111.getLayoutConstraint();
location6111.setX(0);
location6111.setY(5);
return node;
@@ -1369,13 +1410,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "OpaqueExpression");
Node label5184 = createLabel(node, UMLVisualIDRegistry.getType(OpaqueExpressionNameEditPart.VISUAL_ID));
Node label6112 = createLabel(node, UMLVisualIDRegistry.getType(OpaqueExpressionFloatingLabelEditPart.VISUAL_ID));
label6112.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6112 = (Location)label6112.getLayoutConstraint();
+ Location location6112 = (Location) label6112.getLayoutConstraint();
location6112.setX(0);
location6112.setY(5);
return node;
@@ -1391,13 +1433,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "TimeExpression");
Node label5185 = createLabel(node, UMLVisualIDRegistry.getType(TimeExpressionNameEditPart.VISUAL_ID));
Node label6113 = createLabel(node, UMLVisualIDRegistry.getType(TimeExpressionFloatingLabelEditPart.VISUAL_ID));
label6113.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6113 = (Location)label6113.getLayoutConstraint();
+ Location location6113 = (Location) label6113.getLayoutConstraint();
location6113.setX(0);
location6113.setY(5);
return node;
@@ -1413,13 +1456,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Expression");
Node label5186 = createLabel(node, UMLVisualIDRegistry.getType(ExpressionNameEditPart.VISUAL_ID));
Node label6114 = createLabel(node, UMLVisualIDRegistry.getType(ExpressionFloatingLabelEditPart.VISUAL_ID));
label6114.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6114 = (Location)label6114.getLayoutConstraint();
+ Location location6114 = (Location) label6114.getLayoutConstraint();
location6114.setX(0);
location6114.setY(5);
return node;
@@ -1435,13 +1479,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Duration");
Node label5187 = createLabel(node, UMLVisualIDRegistry.getType(DurationNameEditPart.VISUAL_ID));
Node label6115 = createLabel(node, UMLVisualIDRegistry.getType(DurationFloatingLabelEditPart.VISUAL_ID));
label6115.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6115 = (Location)label6115.getLayoutConstraint();
+ Location location6115 = (Location) label6115.getLayoutConstraint();
location6115.setX(0);
location6115.setY(5);
return node;
@@ -1457,13 +1502,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "TimeInterval");
Node label5188 = createLabel(node, UMLVisualIDRegistry.getType(TimeIntervalNameEditPart.VISUAL_ID));
Node label6116 = createLabel(node, UMLVisualIDRegistry.getType(TimeIntervalFloatingLabelEditPart.VISUAL_ID));
label6116.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6116 = (Location)label6116.getLayoutConstraint();
+ Location location6116 = (Location) label6116.getLayoutConstraint();
location6116.setX(0);
location6116.setY(5);
return node;
@@ -1479,13 +1525,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "DurationInterval");
Node label5189 = createLabel(node, UMLVisualIDRegistry.getType(DurationIntervalNameEditPart.VISUAL_ID));
Node label6117 = createLabel(node, UMLVisualIDRegistry.getType(DurationIntervalFloatingLabelEditPart.VISUAL_ID));
label6117.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6117 = (Location)label6117.getLayoutConstraint();
+ Location location6117 = (Location) label6117.getLayoutConstraint();
location6117.setX(0);
location6117.setY(5);
return node;
@@ -1501,13 +1548,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Interval");
Node label5190 = createLabel(node, UMLVisualIDRegistry.getType(IntervalNameEditPart.VISUAL_ID));
Node label6118 = createLabel(node, UMLVisualIDRegistry.getType(IntervalFloatingLabelEditPart.VISUAL_ID));
label6118.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6118 = (Location)label6118.getLayoutConstraint();
+ Location location6118 = (Location) label6118.getLayoutConstraint();
location6118.setX(0);
location6118.setY(5);
return node;
@@ -1523,13 +1571,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "InstanceValue");
Node label5191 = createLabel(node, UMLVisualIDRegistry.getType(InstanceValueNameEditPart.VISUAL_ID));
Node label6119 = createLabel(node, UMLVisualIDRegistry.getType(InstanceValueFloatingLabelEditPart.VISUAL_ID));
label6119.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6119 = (Location)label6119.getLayoutConstraint();
+ Location location6119 = (Location) label6119.getLayoutConstraint();
location6119.setX(0);
location6119.setY(5);
return node;
@@ -1545,8 +1594,9 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Comment");
Node label5192 = createLabel(node, UMLVisualIDRegistry.getType(CommentBodyEditPart.VISUAL_ID));
return node;
@@ -1562,8 +1612,9 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "DurationConstraint");
Node label5193 = createLabel(node, UMLVisualIDRegistry.getType(DurationConstraintNameEditPart.VISUAL_ID));
Node label6035 = createLabel(node, UMLVisualIDRegistry.getType(DurationConstraintSpecificationEditPart.VISUAL_ID));
@@ -1580,8 +1631,9 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "TimeConstraint");
Node label5194 = createLabel(node, UMLVisualIDRegistry.getType(TimeConstraintNameEditPart.VISUAL_ID));
Node label6036 = createLabel(node, UMLVisualIDRegistry.getType(TimeConstraintSpecificationEditPart.VISUAL_ID));
@@ -1598,8 +1650,9 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "IntervalConstraint");
Node label5195 = createLabel(node, UMLVisualIDRegistry.getType(IntervalConstraintNameEditPart.VISUAL_ID));
Node label6037 = createLabel(node, UMLVisualIDRegistry.getType(IntervalConstraintSpecificationEditPart.VISUAL_ID));
@@ -1616,8 +1669,9 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "InteractionConstraint");
Node label5196 = createLabel(node, UMLVisualIDRegistry.getType(InteractionConstraintNameEditPart.VISUAL_ID));
Node label6038 = createLabel(node, UMLVisualIDRegistry.getType(InteractionConstraintSpecificationEditPart.VISUAL_ID));
@@ -1634,8 +1688,9 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Constraint");
Node label5197 = createLabel(node, UMLVisualIDRegistry.getType(ConstraintNameEditPart.VISUAL_ID));
Node label6039 = createLabel(node, UMLVisualIDRegistry.getType(ConstraintSpecificationEditPart.VISUAL_ID));
@@ -1651,11 +1706,12 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(BehaviorPortEditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
Node label6053 = createLabel(node, UMLVisualIDRegistry.getType(BehaviorPortFloatingLabelEditPart.VISUAL_ID));
label6053.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6053 = (Location)label6053.getLayoutConstraint();
+ Location location6053 = (Location) label6053.getLayoutConstraint();
location6053.setX(0);
location6053.setY(5);
return node;
@@ -1670,17 +1726,18 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(PortEditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Port");
Node label5125 = createLabel(node, UMLVisualIDRegistry.getType(PortNameEditPart.VISUAL_ID));
label5125.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location5125 = (Location)label5125.getLayoutConstraint();
+ Location location5125 = (Location) label5125.getLayoutConstraint();
location5125.setX(25);
location5125.setY(3);
Node label6029 = createLabel(node, UMLVisualIDRegistry.getType(PortAppliedStereotypeEditPart.VISUAL_ID));
label6029.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6029 = (Location)label6029.getLayoutConstraint();
+ Location location6029 = (Location) label6029.getLayoutConstraint();
location6029.setX(25);
location6029.setY(-10);
return node;
@@ -1695,17 +1752,18 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(ParameterEditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Parameter");
Node label6033 = createLabel(node, UMLVisualIDRegistry.getType(ParameterNameEditPart.VISUAL_ID));
label6033.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6033 = (Location)label6033.getLayoutConstraint();
+ Location location6033 = (Location) label6033.getLayoutConstraint();
location6033.setX(25);
location6033.setY(3);
Node label6034 = createLabel(node, UMLVisualIDRegistry.getType(ParameterAppliedStereotypeEditPart.VISUAL_ID));
label6034.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6034 = (Location)label6034.getLayoutConstraint();
+ Location location6034 = (Location) label6034.getLayoutConstraint();
location6034.setX(25);
location6034.setY(-10);
return node;
@@ -1720,13 +1778,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(PropertyPartEditPartCN.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Property");
Node label5126 = createLabel(node, UMLVisualIDRegistry.getType(PropertyPartNameEditPartCN.VISUAL_ID));
Node label6054 = createLabel(node, UMLVisualIDRegistry.getType(PropertyPartFloatingLabelEditPartCN.VISUAL_ID));
label6054.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6054 = (Location)label6054.getLayoutConstraint();
+ Location location6054 = (Location) label6054.getLayoutConstraint();
location6054.setX(0);
location6054.setY(5);
createCompartment(node, UMLVisualIDRegistry.getType(PropertyPartCompartmentEditPartCN.VISUAL_ID), true, true, false, false);
@@ -1743,13 +1802,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(CollaborationRoleEditPartCN.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "CollaborationRole");
Node label5198 = createLabel(node, UMLVisualIDRegistry.getType(CollaborationRoleNameEditPartCN.VISUAL_ID));
Node label6055 = createLabel(node, UMLVisualIDRegistry.getType(CollaborationRoleFloatingLabelEditPartCN.VISUAL_ID));
label6055.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6055 = (Location)label6055.getLayoutConstraint();
+ Location location6055 = (Location) label6055.getLayoutConstraint();
location6055.setX(0);
location6055.setY(5);
return node;
@@ -1764,13 +1824,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(CollaborationUseEditPartCN.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "CollaborationUse");
Node label5127 = createLabel(node, UMLVisualIDRegistry.getType(CollaborationUseNameEditPart.VISUAL_ID));
Node label6056 = createLabel(node, UMLVisualIDRegistry.getType(CollaborationUseFloatingLabelEditPartCN.VISUAL_ID));
label6056.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6056 = (Location)label6056.getLayoutConstraint();
+ Location location6056 = (Location) label6056.getLayoutConstraint();
location6056.setX(0);
location6056.setY(5);
return node;
@@ -1785,13 +1846,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(ActivityCompositeEditPartCN.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Activity");
Node label5128 = createLabel(node, UMLVisualIDRegistry.getType(ActivityCompositeNameEditPartCN.VISUAL_ID));
Node label6057 = createLabel(node, UMLVisualIDRegistry.getType(ActivityCompositeFloatingLabelEditPartCN.VISUAL_ID));
label6057.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6057 = (Location)label6057.getLayoutConstraint();
+ Location location6057 = (Location) label6057.getLayoutConstraint();
location6057.setX(0);
location6057.setY(5);
createCompartment(node, UMLVisualIDRegistry.getType(ActivityCompositeCompartmentEditPartCN.VISUAL_ID), true, true, false, false);
@@ -1808,13 +1870,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(InteractionCompositeEditPartCN.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Interaction");
Node label5129 = createLabel(node, UMLVisualIDRegistry.getType(InteractionCompositeNameEditPartCN.VISUAL_ID));
Node label6058 = createLabel(node, UMLVisualIDRegistry.getType(InteractionCompositeFloatingLabelEditPartCN.VISUAL_ID));
label6058.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6058 = (Location)label6058.getLayoutConstraint();
+ Location location6058 = (Location) label6058.getLayoutConstraint();
location6058.setX(0);
location6058.setY(5);
createCompartment(node, UMLVisualIDRegistry.getType(InteractionCompositeCompartmentEditPartCN.VISUAL_ID), true, true, false, false);
@@ -1831,13 +1894,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(ProtocolStateMachineCompositeEditPartCN.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "ProtocolStateMachine");
Node label5130 = createLabel(node, UMLVisualIDRegistry.getType(ProtocolStateMachineCompositeNameEditPartCN.VISUAL_ID));
Node label6059 = createLabel(node, UMLVisualIDRegistry.getType(ProtocolStateMachineCompositeFloatingLabelEditPartCN.VISUAL_ID));
label6059.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6059 = (Location)label6059.getLayoutConstraint();
+ Location location6059 = (Location) label6059.getLayoutConstraint();
location6059.setX(0);
location6059.setY(5);
createCompartment(node, UMLVisualIDRegistry.getType(ProtocolStateMachineCompositeCompartmentEditPartCN.VISUAL_ID), true, true, false, false);
@@ -1854,13 +1918,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(StateMachineCompositeEditPartCN.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "StateMachine");
Node label5131 = createLabel(node, UMLVisualIDRegistry.getType(StateMachineCompositeNameEditPartCN.VISUAL_ID));
Node label6060 = createLabel(node, UMLVisualIDRegistry.getType(StateMachineCompositeFloatingLabelEditPartCN.VISUAL_ID));
label6060.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6060 = (Location)label6060.getLayoutConstraint();
+ Location location6060 = (Location) label6060.getLayoutConstraint();
location6060.setX(0);
location6060.setY(5);
createCompartment(node, UMLVisualIDRegistry.getType(StateMachineCompositeCompartmentEditPartCN.VISUAL_ID), true, true, false, false);
@@ -1877,13 +1942,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(FunctionBehaviorCompositeEditPartCN.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "FunctionBehavior");
Node label5132 = createLabel(node, UMLVisualIDRegistry.getType(FunctionBehaviorCompositeNameEditPartCN.VISUAL_ID));
Node label6061 = createLabel(node, UMLVisualIDRegistry.getType(FunctionBehaviorCompositeFloatingLabelEditPartCN.VISUAL_ID));
label6061.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6061 = (Location)label6061.getLayoutConstraint();
+ Location location6061 = (Location) label6061.getLayoutConstraint();
location6061.setX(0);
location6061.setY(5);
createCompartment(node, UMLVisualIDRegistry.getType(FunctionBehaviorCompositeCompartmentEditPartCN.VISUAL_ID), true, true, false, false);
@@ -1900,13 +1966,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(OpaqueBehaviorCompositeEditPartCN.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "OpaqueBehavior");
Node label5133 = createLabel(node, UMLVisualIDRegistry.getType(OpaqueBehaviorCompositeNameEditPartCN.VISUAL_ID));
Node label6062 = createLabel(node, UMLVisualIDRegistry.getType(OpaqueBehaviorCompositeFloatingLabelEditPartCN.VISUAL_ID));
label6062.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6062 = (Location)label6062.getLayoutConstraint();
+ Location location6062 = (Location) label6062.getLayoutConstraint();
location6062.setX(0);
location6062.setY(5);
createCompartment(node, UMLVisualIDRegistry.getType(OpaqueBehaviorCompositeCompartmentEditPartCN.VISUAL_ID), true, true, false, false);
@@ -1923,13 +1990,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(ComponentCompositeEditPartCN.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Component");
Node label5137 = createLabel(node, UMLVisualIDRegistry.getType(ComponentCompositeNameEditPartCN.VISUAL_ID));
Node label6063 = createLabel(node, UMLVisualIDRegistry.getType(ComponentCompositeFloatingLabelEditPartCN.VISUAL_ID));
label6063.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6063 = (Location)label6063.getLayoutConstraint();
+ Location location6063 = (Location) label6063.getLayoutConstraint();
location6063.setX(0);
location6063.setY(5);
createCompartment(node, UMLVisualIDRegistry.getType(ComponentCompositeCompartmentEditPartCN.VISUAL_ID), true, true, false, false);
@@ -1946,13 +2014,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(DeviceCompositeEditPartCN.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Device");
Node label5138 = createLabel(node, UMLVisualIDRegistry.getType(DeviceCompositeNameEditPartCN.VISUAL_ID));
Node label6064 = createLabel(node, UMLVisualIDRegistry.getType(DeviceCompositeFloatingLabelEditPartCN.VISUAL_ID));
label6064.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6064 = (Location)label6064.getLayoutConstraint();
+ Location location6064 = (Location) label6064.getLayoutConstraint();
location6064.setX(0);
location6064.setY(5);
createCompartment(node, UMLVisualIDRegistry.getType(DeviceCompositeCompartmentEditPartCN.VISUAL_ID), true, true, false, false);
@@ -1969,13 +2038,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(ExecutionEnvironmentCompositeEditPartCN.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "ExecutionEnvironment");
Node label5139 = createLabel(node, UMLVisualIDRegistry.getType(ExecutionEnvironmentCompositeNameEditPartCN.VISUAL_ID));
Node label6065 = createLabel(node, UMLVisualIDRegistry.getType(ExecutionEnvironmentCompositeFloatingLabelEditPartCN.VISUAL_ID));
label6065.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6065 = (Location)label6065.getLayoutConstraint();
+ Location location6065 = (Location) label6065.getLayoutConstraint();
location6065.setX(0);
location6065.setY(5);
createCompartment(node, UMLVisualIDRegistry.getType(ExecutionEnvironmentCompositeCompartmentEditPartCN.VISUAL_ID), true, true, false, false);
@@ -1992,13 +2062,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(NodeCompositeEditPartCN.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Node");
Node label5140 = createLabel(node, UMLVisualIDRegistry.getType(NodeCompositeNameEditPartCN.VISUAL_ID));
Node label6066 = createLabel(node, UMLVisualIDRegistry.getType(NodeCompositeFloatingLabelEditPartCN.VISUAL_ID));
label6066.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6066 = (Location)label6066.getLayoutConstraint();
+ Location location6066 = (Location) label6066.getLayoutConstraint();
location6066.setX(0);
location6066.setY(5);
createCompartment(node, UMLVisualIDRegistry.getType(NodeCompositeCompartmentEditPartCN.VISUAL_ID), true, true, false, false);
@@ -2015,13 +2086,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(ClassCompositeEditPartCN.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Class");
Node label5155 = createLabel(node, UMLVisualIDRegistry.getType(ClassCompositeNameEditPartCN.VISUAL_ID));
Node label6067 = createLabel(node, UMLVisualIDRegistry.getType(ClassCompositeFloatingLabelEditPartCN.VISUAL_ID));
label6067.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6067 = (Location)label6067.getLayoutConstraint();
+ Location location6067 = (Location) label6067.getLayoutConstraint();
location6067.setX(0);
location6067.setY(5);
createCompartment(node, UMLVisualIDRegistry.getType(ClassCompositeCompartmentEditPartCN.VISUAL_ID), true, true, false, false);
@@ -2038,13 +2110,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(CollaborationCompositeEditPartCN.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Collaboration");
Node label5141 = createLabel(node, UMLVisualIDRegistry.getType(CollaborationCompositeNameEditPartCN.VISUAL_ID));
Node label6068 = createLabel(node, UMLVisualIDRegistry.getType(CollaborationCompositeFloatingLabelEditPartCN.VISUAL_ID));
label6068.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6068 = (Location)label6068.getLayoutConstraint();
+ Location location6068 = (Location) label6068.getLayoutConstraint();
location6068.setX(0);
location6068.setY(5);
createCompartment(node, UMLVisualIDRegistry.getType(CollaborationCompositeCompartmentEditPartCN.VISUAL_ID), true, true, false, false);
@@ -2061,13 +2134,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(InterfaceEditPartCN.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Interface");
Node label5154 = createLabel(node, UMLVisualIDRegistry.getType(InterfaceNameEditPartCN.VISUAL_ID));
Node label6069 = createLabel(node, UMLVisualIDRegistry.getType(InterfaceFloatingLabelEditPartCN.VISUAL_ID));
label6069.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6069 = (Location)label6069.getLayoutConstraint();
+ Location location6069 = (Location) label6069.getLayoutConstraint();
location6069.setX(0);
location6069.setY(5);
return node;
@@ -2082,13 +2156,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(PrimitiveTypeEditPartCN.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "PrimitiveType");
Node label5134 = createLabel(node, UMLVisualIDRegistry.getType(PrimitiveTypeNameEditPartCN.VISUAL_ID));
Node label6070 = createLabel(node, UMLVisualIDRegistry.getType(PrimitiveTypeFloatingLabelEditPartCN.VISUAL_ID));
label6070.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6070 = (Location)label6070.getLayoutConstraint();
+ Location location6070 = (Location) label6070.getLayoutConstraint();
location6070.setX(0);
location6070.setY(5);
return node;
@@ -2103,13 +2178,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(EnumerationEditPartCN.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Enumeration");
Node label5135 = createLabel(node, UMLVisualIDRegistry.getType(EnumerationNameEditPartCN.VISUAL_ID));
Node label6071 = createLabel(node, UMLVisualIDRegistry.getType(EnumerationFloatingLabelEditPartCN.VISUAL_ID));
label6071.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6071 = (Location)label6071.getLayoutConstraint();
+ Location location6071 = (Location) label6071.getLayoutConstraint();
location6071.setX(0);
location6071.setY(5);
createCompartment(node, UMLVisualIDRegistry.getType(EnumerationEnumerationLiteralCompartmentEditPartCN.VISUAL_ID), true, true, true, true);
@@ -2126,13 +2202,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(DataTypeEditPartCN.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "DataType");
Node label5136 = createLabel(node, UMLVisualIDRegistry.getType(DataTypeNameEditPartCN.VISUAL_ID));
Node label6072 = createLabel(node, UMLVisualIDRegistry.getType(DataTypeFloatingLabelEditPartCN.VISUAL_ID));
label6072.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6072 = (Location)label6072.getLayoutConstraint();
+ Location location6072 = (Location) label6072.getLayoutConstraint();
location6072.setX(0);
location6072.setY(5);
createCompartment(node, UMLVisualIDRegistry.getType(DataTypeAttributeCompartmentEditPartCN.VISUAL_ID), true, true, true, true);
@@ -2150,13 +2227,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(ActorEditPartCN.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Actor");
Node label5144 = createLabel(node, UMLVisualIDRegistry.getType(ActorNameEditPartCN.VISUAL_ID));
Node label6073 = createLabel(node, UMLVisualIDRegistry.getType(ActorFloatingLabelEditPartCN.VISUAL_ID));
label6073.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6073 = (Location)label6073.getLayoutConstraint();
+ Location location6073 = (Location) label6073.getLayoutConstraint();
location6073.setX(0);
location6073.setY(5);
return node;
@@ -2171,13 +2249,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(DeploymentSpecificationEditPartCN.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "DeploymentSpecification");
Node label5145 = createLabel(node, UMLVisualIDRegistry.getType(DeploymentSpecificationNameEditPartCN.VISUAL_ID));
Node label6074 = createLabel(node, UMLVisualIDRegistry.getType(DeploymentSpecificationFloatingLabelEditPartCN.VISUAL_ID));
label6074.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6074 = (Location)label6074.getLayoutConstraint();
+ Location location6074 = (Location) label6074.getLayoutConstraint();
location6074.setX(0);
location6074.setY(5);
return node;
@@ -2192,13 +2271,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(ArtifactEditPartCN.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Artifact");
Node label5146 = createLabel(node, UMLVisualIDRegistry.getType(ArtifactNameEditPartCN.VISUAL_ID));
Node label6075 = createLabel(node, UMLVisualIDRegistry.getType(ArtifactFloatingLabelEditPartCN.VISUAL_ID));
label6075.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6075 = (Location)label6075.getLayoutConstraint();
+ Location location6075 = (Location) label6075.getLayoutConstraint();
location6075.setX(0);
location6075.setY(5);
return node;
@@ -2213,13 +2293,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(InformationItemEditPartCN.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "InformationItem");
Node label5147 = createLabel(node, UMLVisualIDRegistry.getType(InformationItemNameEditPartCN.VISUAL_ID));
Node label6076 = createLabel(node, UMLVisualIDRegistry.getType(InformationItemFloatingLabelEditPartCN.VISUAL_ID));
label6076.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6076 = (Location)label6076.getLayoutConstraint();
+ Location location6076 = (Location) label6076.getLayoutConstraint();
location6076.setX(0);
location6076.setY(5);
return node;
@@ -2234,13 +2315,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(SignalEditPartCN.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Signal");
Node label5148 = createLabel(node, UMLVisualIDRegistry.getType(SignalNameEditPartCN.VISUAL_ID));
Node label6077 = createLabel(node, UMLVisualIDRegistry.getType(SignalFloatingLabelEditPartCN.VISUAL_ID));
label6077.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6077 = (Location)label6077.getLayoutConstraint();
+ Location location6077 = (Location) label6077.getLayoutConstraint();
location6077.setX(0);
location6077.setY(5);
return node;
@@ -2255,13 +2337,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(UseCaseEditPartCN.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "UseCase");
Node label5149 = createLabel(node, UMLVisualIDRegistry.getType(UseCaseNameEditPartCN.VISUAL_ID));
Node label6078 = createLabel(node, UMLVisualIDRegistry.getType(UseCaseFloatingLabelEditPartCN.VISUAL_ID));
label6078.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6078 = (Location)label6078.getLayoutConstraint();
+ Location location6078 = (Location) label6078.getLayoutConstraint();
location6078.setX(0);
location6078.setY(5);
return node;
@@ -2276,8 +2359,9 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(CommentEditPartCN.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Comment");
Node label5150 = createLabel(node, UMLVisualIDRegistry.getType(CommentBodyEditPartCN.VISUAL_ID));
return node;
@@ -2292,8 +2376,9 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(DurationConstraintEditPartCN.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "DurationConstraint");
Node label6040 = createLabel(node, UMLVisualIDRegistry.getType(DurationConstraintNameEditPartCN.VISUAL_ID));
Node label6041 = createLabel(node, UMLVisualIDRegistry.getType(DurationConstraintSpecificationEditPartCN.VISUAL_ID));
@@ -2309,8 +2394,9 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(TimeConstraintEditPartCN.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "TimeConstraint");
Node label6042 = createLabel(node, UMLVisualIDRegistry.getType(TimeConstraintNameEditPartCN.VISUAL_ID));
Node label6043 = createLabel(node, UMLVisualIDRegistry.getType(TimeConstraintSpecificationEditPartCN.VISUAL_ID));
@@ -2326,8 +2412,9 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(IntervalConstraintEditPartCN.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "IntervalConstraint");
Node label6044 = createLabel(node, UMLVisualIDRegistry.getType(IntervalConstraintNameEditPartCN.VISUAL_ID));
Node label6045 = createLabel(node, UMLVisualIDRegistry.getType(IntervalConstraintSpecificationEditPartCN.VISUAL_ID));
@@ -2343,8 +2430,9 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(InteractionConstraintEditPartCN.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "InteractionConstraint");
Node label6046 = createLabel(node, UMLVisualIDRegistry.getType(InteractionConstraintNameEditPartCN.VISUAL_ID));
Node label6047 = createLabel(node, UMLVisualIDRegistry.getType(InteractionConstraintSpecificationEditPartCN.VISUAL_ID));
@@ -2360,8 +2448,9 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(ConstraintEditPartCN.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ // initializeFromPreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Constraint");
Node label6048 = createLabel(node, UMLVisualIDRegistry.getType(ConstraintNameEditPartCN.VISUAL_ID));
Node label6049 = createLabel(node, UMLVisualIDRegistry.getType(ConstraintSpecificationEditPartCN.VISUAL_ID));
@@ -2377,7 +2466,8 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(PropertyEditPartCLN.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Property");
return node;
}
@@ -2391,7 +2481,8 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(OperationEditPartCLN.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Operation");
return node;
}
@@ -2405,7 +2496,8 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
node.setType(UMLVisualIDRegistry.getType(EnumerationLiteralEditPartCLN.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "EnumerationLiteral");
return node;
}
@@ -2426,11 +2518,13 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
edge.setType(UMLVisualIDRegistry.getType(BehaviorPortLinkEditPart.VISUAL_ID));
edge.setElement(null);
// initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
- //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);
- //}
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
+ // 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);
+ // }
+
return edge;
}
@@ -2450,11 +2544,13 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
edge.setType(UMLVisualIDRegistry.getType(LinkDescriptorEditPart.VISUAL_ID));
edge.setElement(null);
// initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
- //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);
- //}
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
+ // 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);
+ // }
+
return edge;
}
@@ -2474,12 +2570,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
edge.setType(UMLVisualIDRegistry.getType(CommentAnnotatedElementEditPart.VISUAL_ID));
edge.setElement(null);
// initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "CommentAnnotatedElement");
- //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
- //if (routing != null) {
- // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
- //}
+ // 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);
+ // }
+
return edge;
}
@@ -2499,12 +2597,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
edge.setType(UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID));
edge.setElement(null);
// initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "ConstraintConstrainedElement");
- //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
- //if (routing != null) {
- // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
- //}
+ // 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);
+ // }
+
return edge;
}
@@ -2524,22 +2624,25 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
edge.setType(UMLVisualIDRegistry.getType(ComponentRealizationEditPart.VISUAL_ID));
edge.setElement(domainElement);
// initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "ComponentRealization");
- //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
- //if (routing != null) {
- // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
- //}
+ // 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);
+ // }
Node label6001 = createLabel(edge, UMLVisualIDRegistry.getType(ComponentRealizationNameEditPart.VISUAL_ID));
label6001.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6001 = (Location)label6001.getLayoutConstraint();
+ Location location6001 = (Location) label6001.getLayoutConstraint();
location6001.setX(0);
location6001.setY(60);
Node label6015 = createLabel(edge, UMLVisualIDRegistry.getType(ComponentRealizationAppliedStereotypeEditPart.VISUAL_ID));
label6015.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6015 = (Location)label6015.getLayoutConstraint();
+ Location location6015 = (Location) label6015.getLayoutConstraint();
location6015.setX(0);
location6015.setY(30);
+
+ PreferenceInitializerForElementHelper.initLabelVisibilityFromPrefs(edge, prefStore, "ComponentRealization");
return edge;
}
@@ -2559,22 +2662,25 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
edge.setType(UMLVisualIDRegistry.getType(InterfaceRealizationEditPart.VISUAL_ID));
edge.setElement(domainElement);
// initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "InterfaceRealization");
- //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
- //if (routing != null) {
- // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
- //}
+ // 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);
+ // }
Node label6002 = createLabel(edge, UMLVisualIDRegistry.getType(InterfaceRealizationNameEditPart.VISUAL_ID));
label6002.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6002 = (Location)label6002.getLayoutConstraint();
+ Location location6002 = (Location) label6002.getLayoutConstraint();
location6002.setX(0);
location6002.setY(60);
Node label6016 = createLabel(edge, UMLVisualIDRegistry.getType(InterfaceRealizationAppliedStereotypeEditPart.VISUAL_ID));
label6016.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6016 = (Location)label6016.getLayoutConstraint();
+ Location location6016 = (Location) label6016.getLayoutConstraint();
location6016.setX(0);
location6016.setY(30);
+
+ PreferenceInitializerForElementHelper.initLabelVisibilityFromPrefs(edge, prefStore, "InterfaceRealization");
return edge;
}
@@ -2594,22 +2700,25 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
edge.setType(UMLVisualIDRegistry.getType(SubstitutionEditPart.VISUAL_ID));
edge.setElement(domainElement);
// initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "Substitution");
- //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
- //if (routing != null) {
- // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
- //}
+ // 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);
+ // }
Node label6003 = createLabel(edge, UMLVisualIDRegistry.getType(SubstitutionNameEditPart.VISUAL_ID));
label6003.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6003 = (Location)label6003.getLayoutConstraint();
+ Location location6003 = (Location) label6003.getLayoutConstraint();
location6003.setX(0);
location6003.setY(60);
Node label6017 = createLabel(edge, UMLVisualIDRegistry.getType(SubstitutionAppliedStereotypeEditPart.VISUAL_ID));
label6017.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6017 = (Location)label6017.getLayoutConstraint();
+ Location location6017 = (Location) label6017.getLayoutConstraint();
location6017.setX(0);
location6017.setY(30);
+
+ PreferenceInitializerForElementHelper.initLabelVisibilityFromPrefs(edge, prefStore, "Substitution");
return edge;
}
@@ -2629,22 +2738,25 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
edge.setType(UMLVisualIDRegistry.getType(RealizationEditPart.VISUAL_ID));
edge.setElement(domainElement);
// initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "Realization");
- //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);
- //}
+ // 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);
+ // }
Node label6004 = createLabel(edge, UMLVisualIDRegistry.getType(RealizationNameEditPart.VISUAL_ID));
label6004.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6004 = (Location)label6004.getLayoutConstraint();
+ Location location6004 = (Location) label6004.getLayoutConstraint();
location6004.setX(0);
location6004.setY(60);
Node label6018 = createLabel(edge, UMLVisualIDRegistry.getType(RealizationAppliedStereotypeEditPart.VISUAL_ID));
label6018.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6018 = (Location)label6018.getLayoutConstraint();
+ Location location6018 = (Location) label6018.getLayoutConstraint();
location6018.setX(0);
location6018.setY(30);
+
+ PreferenceInitializerForElementHelper.initLabelVisibilityFromPrefs(edge, prefStore, "Realization");
return edge;
}
@@ -2664,22 +2776,25 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
edge.setType(UMLVisualIDRegistry.getType(ManifestationEditPart.VISUAL_ID));
edge.setElement(domainElement);
// initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "Manifestation");
- //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
- //if (routing != null) {
- // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
- //}
+ // 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);
+ // }
Node label6005 = createLabel(edge, UMLVisualIDRegistry.getType(ManifestationNameEditPart.VISUAL_ID));
label6005.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6005 = (Location)label6005.getLayoutConstraint();
+ Location location6005 = (Location) label6005.getLayoutConstraint();
location6005.setX(0);
location6005.setY(60);
Node label6019 = createLabel(edge, UMLVisualIDRegistry.getType(ManifestationAppliedStereotypeEditPart.VISUAL_ID));
label6019.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6019 = (Location)label6019.getLayoutConstraint();
+ Location location6019 = (Location) label6019.getLayoutConstraint();
location6019.setX(0);
location6019.setY(30);
+
+ PreferenceInitializerForElementHelper.initLabelVisibilityFromPrefs(edge, prefStore, "Manifestation");
return edge;
}
@@ -2699,22 +2814,25 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
edge.setType(UMLVisualIDRegistry.getType(AbstractionEditPart.VISUAL_ID));
edge.setElement(domainElement);
// initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "Abstraction");
- //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
- //if (routing != null) {
- // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
- //}
+ // 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);
+ // }
Node label6006 = createLabel(edge, UMLVisualIDRegistry.getType(AbstractionNameEditPart.VISUAL_ID));
label6006.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6006 = (Location)label6006.getLayoutConstraint();
+ Location location6006 = (Location) label6006.getLayoutConstraint();
location6006.setX(0);
location6006.setY(60);
Node label6020 = createLabel(edge, UMLVisualIDRegistry.getType(AbstractionAppliedStereotypeEditPart.VISUAL_ID));
label6020.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6020 = (Location)label6020.getLayoutConstraint();
+ Location location6020 = (Location) label6020.getLayoutConstraint();
location6020.setX(0);
location6020.setY(30);
+
+ PreferenceInitializerForElementHelper.initLabelVisibilityFromPrefs(edge, prefStore, "Abstraction");
return edge;
}
@@ -2734,22 +2852,25 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
edge.setType(UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID));
edge.setElement(domainElement);
// initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "Usage");
- //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
- //if (routing != null) {
- // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
- //}
+ // 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);
+ // }
Node label6007 = createLabel(edge, UMLVisualIDRegistry.getType(UsageNameEditPart.VISUAL_ID));
label6007.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6007 = (Location)label6007.getLayoutConstraint();
+ Location location6007 = (Location) label6007.getLayoutConstraint();
location6007.setX(0);
location6007.setY(60);
Node label6021 = createLabel(edge, UMLVisualIDRegistry.getType(UsageAppliedStereotypeEditPart.VISUAL_ID));
label6021.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6021 = (Location)label6021.getLayoutConstraint();
+ Location location6021 = (Location) label6021.getLayoutConstraint();
location6021.setX(0);
location6021.setY(30);
+
+ PreferenceInitializerForElementHelper.initLabelVisibilityFromPrefs(edge, prefStore, "Usage");
return edge;
}
@@ -2769,22 +2890,25 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
edge.setType(UMLVisualIDRegistry.getType(DeploymentEditPart.VISUAL_ID));
edge.setElement(domainElement);
// initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "Deployment");
- //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
- //if (routing != null) {
- // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
- //}
+ // 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);
+ // }
Node label6008 = createLabel(edge, UMLVisualIDRegistry.getType(DeploymentNameEditPart.VISUAL_ID));
label6008.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6008 = (Location)label6008.getLayoutConstraint();
+ Location location6008 = (Location) label6008.getLayoutConstraint();
location6008.setX(0);
location6008.setY(60);
Node label6022 = createLabel(edge, UMLVisualIDRegistry.getType(DeploymentAppliedStereotypeEditPart.VISUAL_ID));
label6022.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6022 = (Location)label6022.getLayoutConstraint();
+ Location location6022 = (Location) label6022.getLayoutConstraint();
location6022.setX(0);
location6022.setY(30);
+
+ PreferenceInitializerForElementHelper.initLabelVisibilityFromPrefs(edge, prefStore, "Deployment");
return edge;
}
@@ -2804,22 +2928,25 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
edge.setType(UMLVisualIDRegistry.getType(RoleBindingEditPart.VISUAL_ID));
edge.setElement(domainElement);
// initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "RoleBinding");
- //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);
- //}
+ // 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);
+ // }
Node label6027 = createLabel(edge, UMLVisualIDRegistry.getType(RoleBindingRoleNameEditPart.VISUAL_ID));
label6027.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6027 = (Location)label6027.getLayoutConstraint();
+ Location location6027 = (Location) label6027.getLayoutConstraint();
location6027.setX(0);
location6027.setY(20);
Node label6028 = createLabel(edge, UMLVisualIDRegistry.getType(RoleBindingAppliedStereotypeEditPart.VISUAL_ID));
label6028.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6028 = (Location)label6028.getLayoutConstraint();
+ Location location6028 = (Location) label6028.getLayoutConstraint();
location6028.setX(0);
location6028.setY(60);
+
+ PreferenceInitializerForElementHelper.initLabelVisibilityFromPrefs(edge, prefStore, "RoleBinding");
return edge;
}
@@ -2839,22 +2966,25 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
edge.setType(UMLVisualIDRegistry.getType(DependencyEditPart.VISUAL_ID));
edge.setElement(domainElement);
// initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "Dependency");
- //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
- //if (routing != null) {
- // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
- //}
+ // 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);
+ // }
Node label6009 = createLabel(edge, UMLVisualIDRegistry.getType(DependencyNameEditPart.VISUAL_ID));
label6009.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6009 = (Location)label6009.getLayoutConstraint();
+ Location location6009 = (Location) label6009.getLayoutConstraint();
location6009.setX(0);
location6009.setY(60);
Node label6023 = createLabel(edge, UMLVisualIDRegistry.getType(DependencyAppliedStereotypeEditPart.VISUAL_ID));
label6023.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6023 = (Location)label6023.getLayoutConstraint();
+ Location location6023 = (Location) label6023.getLayoutConstraint();
location6023.setX(0);
location6023.setY(60);
+
+ PreferenceInitializerForElementHelper.initLabelVisibilityFromPrefs(edge, prefStore, "Dependency");
return edge;
}
@@ -2874,32 +3004,35 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
edge.setType(UMLVisualIDRegistry.getType(ConnectorEditPart.VISUAL_ID));
edge.setElement(domainElement);
// initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
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);
- //}
+ // 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);
+ // }
Node label6025 = createLabel(edge, UMLVisualIDRegistry.getType(ConnectorAppliedStereotypeEditPart.VISUAL_ID));
label6025.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6025 = (Location)label6025.getLayoutConstraint();
+ Location location6025 = (Location) label6025.getLayoutConstraint();
location6025.setX(0);
location6025.setY(60);
Node label6050 = createLabel(edge, UMLVisualIDRegistry.getType(ConnectorNameEditPart.VISUAL_ID));
label6050.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6050 = (Location)label6050.getLayoutConstraint();
+ Location location6050 = (Location) label6050.getLayoutConstraint();
location6050.setX(0);
location6050.setY(-20);
Node label6051 = createLabel(edge, UMLVisualIDRegistry.getType(ConnectorMultiplicitySourceEditPart.VISUAL_ID));
label6051.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6051 = (Location)label6051.getLayoutConstraint();
+ Location location6051 = (Location) label6051.getLayoutConstraint();
location6051.setX(0);
location6051.setY(20);
Node label6052 = createLabel(edge, UMLVisualIDRegistry.getType(ConnectorMultiplicityTargetEditPart.VISUAL_ID));
label6052.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6052 = (Location)label6052.getLayoutConstraint();
+ Location location6052 = (Location) label6052.getLayoutConstraint();
location6052.setX(0);
location6052.setY(20);
+
+ PreferenceInitializerForElementHelper.initLabelVisibilityFromPrefs(edge, prefStore, "Connector");
return edge;
}
@@ -2919,17 +3052,20 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
edge.setType(UMLVisualIDRegistry.getType(GeneralizationEditPart.VISUAL_ID));
edge.setElement(domainElement);
// initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "Generalization");
- //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
- //if (routing != null) {
- // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
- //}
+ // 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);
+ // }
Node label6024 = createLabel(edge, UMLVisualIDRegistry.getType(GeneralizationAppliedStereotypeEditPart.VISUAL_ID));
label6024.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6024 = (Location)label6024.getLayoutConstraint();
+ Location location6024 = (Location) label6024.getLayoutConstraint();
location6024.setX(0);
location6024.setY(60);
+
+ PreferenceInitializerForElementHelper.initLabelVisibilityFromPrefs(edge, prefStore, "Generalization");
return edge;
}
@@ -2949,12 +3085,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
edge.setType(UMLVisualIDRegistry.getType(TimeObservationEventEditPart.VISUAL_ID));
edge.setElement(null);
// initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "TimeObservationEvent");
- //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);
- //}
+ // 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);
+ // }
+
return edge;
}
@@ -2974,12 +3112,14 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
edge.setType(UMLVisualIDRegistry.getType(DurationObservationEventEditPart.VISUAL_ID));
edge.setElement(null);
// initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "DurationObservationEvent");
- //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);
- //}
+ // 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);
+ // }
+
return edge;
}
@@ -2999,17 +3139,20 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
edge.setType(UMLVisualIDRegistry.getType(RepresentationEditPart.VISUAL_ID));
edge.setElement(null);
// initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.colorToInteger(ColorConstants.black));
- //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);
- //}
+ // 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);
+ // }
Node label6030 = createLabel(edge, UMLVisualIDRegistry.getType(RepresentationTagLabelEditPart.VISUAL_ID));
label6030.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6030 = (Location)label6030.getLayoutConstraint();
+ Location location6030 = (Location) label6030.getLayoutConstraint();
location6030.setX(0);
location6030.setY(15);
+
+ PreferenceInitializerForElementHelper.initLabelVisibilityFromPrefs(edge, prefStore, "Undefined");
return edge;
}
@@ -3029,22 +3172,25 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
edge.setType(UMLVisualIDRegistry.getType(InformationFlowEditPart.VISUAL_ID));
edge.setElement(domainElement);
// initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+
PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "InformationFlow");
- //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);
- //}
+ // 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);
+ // }
Node label6031 = createLabel(edge, UMLVisualIDRegistry.getType(InformationFlowConveyedLabelEditPart.VISUAL_ID));
label6031.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6031 = (Location)label6031.getLayoutConstraint();
+ Location location6031 = (Location) label6031.getLayoutConstraint();
location6031.setX(0);
location6031.setY(30);
Node label6032 = createLabel(edge, UMLVisualIDRegistry.getType(InformationFlowAppliedStereotypeEditPart.VISUAL_ID));
label6032.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6032 = (Location)label6032.getLayoutConstraint();
+ Location location6032 = (Location) label6032.getLayoutConstraint();
location6032.setX(0);
location6032.setY(15);
+
+ PreferenceInitializerForElementHelper.initLabelVisibilityFromPrefs(edge, prefStore, "InformationFlow");
return edge;
}
@@ -3052,7 +3198,7 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
* @generated
*/
protected void stampShortcut(View containerView, Node target) {
- if(!CompositeStructureDiagramEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
+ if (!CompositeStructureDiagramEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
shortcutAnnotation.getDetails().put("modelID", CompositeStructureDiagramEditPart.MODEL_ID); //$NON-NLS-1$
@@ -3074,24 +3220,26 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
* @generated
*/
protected Node createCompartment(View owner, String hint, boolean canCollapse, boolean hasTitle, boolean canSort, boolean canFilter) {
- //SemanticListCompartment rv = NotationFactory.eINSTANCE.createSemanticListCompartment();
- //rv.setShowTitle(showTitle);
- //rv.setCollapsed(isCollapsed);
+ // SemanticListCompartment rv = NotationFactory.eINSTANCE.createSemanticListCompartment();
+ // rv.setShowTitle(showTitle);
+ // rv.setCollapsed(isCollapsed);
Node rv;
- if(canCollapse) {
+ if (canCollapse) {
rv = NotationFactory.eINSTANCE.createBasicCompartment();
} else {
rv = NotationFactory.eINSTANCE.createDecorationNode();
}
+
rv.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
- if(hasTitle) {
+
+ if (hasTitle) {
TitleStyle ts = NotationFactory.eINSTANCE.createTitleStyle();
rv.getStyles().add(ts);
}
- if(canSort) {
+ if (canSort) {
rv.getStyles().add(NotationFactory.eINSTANCE.createSortingStyle());
}
- if(canFilter) {
+ if (canFilter) {
rv.getStyles().add(NotationFactory.eINSTANCE.createFilteringStyle());
}
rv.setType(hint);
@@ -3103,11 +3251,11 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
* @generated
*/
protected EObject getSemanticElement(IAdaptable semanticAdapter) {
- if(semanticAdapter == null) {
+ if (semanticAdapter == null) {
return null;
}
- EObject eObject = (EObject)semanticAdapter.getAdapter(EObject.class);
- if(eObject != null) {
+ EObject eObject = (EObject) semanticAdapter.getAdapter(EObject.class);
+ if (eObject != null) {
return EMFCoreUtil.resolve(TransactionUtil.getEditingDomain(eObject), eObject);
}
return null;
@@ -3117,10 +3265,10 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
* @generated
*/
protected IElementType getSemanticElementType(IAdaptable semanticAdapter) {
- if(semanticAdapter == null) {
+ if (semanticAdapter == null) {
return null;
}
- return (IElementType)semanticAdapter.getAdapter(IElementType.class);
+ return (IElementType) semanticAdapter.getAdapter(IElementType.class);
}
/**
@@ -3129,13 +3277,15 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
private void initFontStyleFromPrefs(View view, final IPreferenceStore store, String elementName) {
String fontConstant = PreferencesConstantsHelper.getElementConstant(elementName, PreferencesConstantsHelper.FONT);
String fontColorConstant = PreferencesConstantsHelper.getElementConstant(elementName, PreferencesConstantsHelper.COLOR_FONT);
- FontStyle viewFontStyle = (FontStyle)view.getStyle(NotationPackage.Literals.FONT_STYLE);
- if(viewFontStyle != null) {
+
+ 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());
}
@@ -3157,14 +3307,24 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
String fillColorConstant = PreferencesConstantsHelper.getElementConstant(elementName, PreferencesConstantsHelper.COLOR_FILL);
String gradientColorConstant = PreferencesConstantsHelper.getElementConstant(elementName, PreferencesConstantsHelper.COLOR_GRADIENT);
String gradientPolicyConstant = PreferencesConstantsHelper.getElementConstant(elementName, PreferencesConstantsHelper.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 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());
+ fillStyle
+ .setTransparency(gradientPreferenceConverter.getTransparency());
}
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/sheet/UMLPropertySection.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/sheet/UMLPropertySection.java
index 4ec7a5400bc..07ebef74d34 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/sheet/UMLPropertySection.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/sheet/UMLPropertySection.java
@@ -21,11 +21,12 @@ public class UMLPropertySection extends DefaultPropertySection implements IPrope
/**
* Modify/unwrap selection.
+ *
* @generated
*/
@Override
protected Object transformSelection(Object selected) {
- selected = /*super.*/transformSelectionToDomain(selected);
+ selected = /* super. */transformSelectionToDomain(selected);
return selected;
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/sheet/UMLSheetLabelProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/sheet/UMLSheetLabelProvider.java
index 3a38ba42304..212ad5f2960 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/sheet/UMLSheetLabelProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/sheet/UMLSheetLabelProvider.java
@@ -47,8 +47,8 @@ public class UMLSheetLabelProvider extends BaseLabelProvider implements ILabelPr
* @generated
*/
private Object unwrap(Object element) {
- if(element instanceof IStructuredSelection) {
- return ((IStructuredSelection)element).getFirstElement();
+ if (element instanceof IStructuredSelection) {
+ return ((IStructuredSelection) element).getFirstElement();
}
return element;
}
@@ -57,11 +57,11 @@ public class UMLSheetLabelProvider extends BaseLabelProvider implements ILabelPr
* @generated
*/
private View getView(Object element) {
- if(element instanceof View) {
- return (View)element;
+ if (element instanceof View) {
+ return (View) element;
}
- if(element instanceof IAdaptable) {
- return (View)((IAdaptable)element).getAdapter(View.class);
+ if (element instanceof IAdaptable) {
+ return (View) ((IAdaptable) element).getAdapter(View.class);
}
return null;
}
@@ -71,13 +71,13 @@ public class UMLSheetLabelProvider extends BaseLabelProvider implements ILabelPr
*/
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) {
+ while (view != null) {
int vid = UMLVisualIDRegistry.getVisualID(view);
IElementType etype = UMLElementTypes.getElementType(vid);
- if(etype != null) {
+ if (etype != null) {
return etype;
}
- view = view.eContainer() instanceof View ? (View)view.eContainer() : null;
+ view = view.eContainer() instanceof View ? (View) view.eContainer() : null;
}
return null;
}

Back to the top