diff options
273 files changed, 24787 insertions, 25693 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/model/activityDiagram.gmfgen b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/model/activityDiagram.gmfgen index 93c0edd2b58..5b65ba4c736 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/model/activityDiagram.gmfgen +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/model/activityDiagram.gmfgen @@ -1360,8 +1360,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.papyrus.uml.diagram.common.editpolicies.ChangeStereotypedShapeEditPolicy.CHANGE_SHAPE_POLICY" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.ActivityDiagramChangeStereotypedShapeEditpolicy"/> @@ -1455,8 +1453,6 @@ height="20"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.papyrus.uml.diagram.common.editpolicies.ChangeStereotypedShapeEditPolicy.CHANGE_SHAPE_POLICY" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.ActivityDiagramChangeStereotypedShapeEditpolicy"/> @@ -1551,8 +1547,6 @@ height="20"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.papyrus.uml.diagram.common.editpolicies.ChangeStereotypedShapeEditPolicy.CHANGE_SHAPE_POLICY" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.ActivityDiagramChangeStereotypedShapeEditpolicy"/> @@ -1642,8 +1636,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.RequestConstants.REQ_CREATE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.CreateActionLocalConditionEditPolicy"/> @@ -1754,8 +1746,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -1859,8 +1849,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -1964,8 +1952,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -2055,8 +2041,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -2140,8 +2124,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.figures.CallBehaviorActionFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.RequestConstants.REQ_CREATE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.CreateActionLocalConditionEditPolicy"/> @@ -2248,8 +2230,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.RequestConstants.REQ_DELETE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.NoDeleteFromDiagramEditPolicy"/> @@ -2357,8 +2337,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.RequestConstants.REQ_DELETE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.NoDeleteFromDiagramEditPolicy"/> @@ -2466,8 +2444,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.RequestConstants.REQ_DELETE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.NoDeleteFromDiagramEditPolicy"/> @@ -2561,8 +2537,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.RequestConstants.REQ_DELETE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.NoDeleteFromDiagramEditPolicy"/> @@ -2650,8 +2624,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.RequestConstants.REQ_CREATE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.CreateActionLocalConditionEditPolicy"/> @@ -2758,8 +2730,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.RequestConstants.REQ_DELETE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.NoDeleteFromDiagramEditPolicy"/> @@ -2868,8 +2838,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.RequestConstants.REQ_DELETE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.NoDeleteFromDiagramEditPolicy"/> @@ -2978,8 +2946,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.RequestConstants.REQ_DELETE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.NoDeleteFromDiagramEditPolicy"/> @@ -3074,8 +3040,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.RequestConstants.REQ_DELETE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.NoDeleteFromDiagramEditPolicy"/> @@ -3169,8 +3133,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.RequestConstants.REQ_DELETE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.NoDeleteFromDiagramEditPolicy"/> @@ -3279,8 +3241,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.RequestConstants.REQ_DELETE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.NoDeleteFromDiagramEditPolicy"/> @@ -3389,8 +3349,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.RequestConstants.REQ_DELETE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.NoDeleteFromDiagramEditPolicy"/> @@ -3478,8 +3436,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.figures.LocalPreconditionConstraintFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy"/> @@ -3580,8 +3536,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.figures.LocalPostconditionConstraintFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy"/> @@ -3682,8 +3636,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.figures.LocalPreconditionConstraintFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy"/> @@ -3784,8 +3736,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.figures.LocalPostconditionConstraintFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy"/> @@ -3886,8 +3836,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.figures.LocalPreconditionConstraintFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy"/> @@ -3988,8 +3936,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.figures.LocalPostconditionConstraintFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy"/> @@ -4089,8 +4035,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.figures.LocalPreconditionConstraintFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy"/> @@ -4190,8 +4134,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.figures.LocalPostconditionConstraintFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy"/> @@ -4292,8 +4234,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.papyrus.uml.diagram.common.editpolicies.ChangeStereotypedShapeEditPolicy.CHANGE_SHAPE_POLICY" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.ActivityDiagramChangeStereotypedShapeEditpolicy"/> @@ -4400,8 +4340,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.papyrus.uml.diagram.common.editpolicies.ChangeStereotypedShapeEditPolicy.CHANGE_SHAPE_POLICY" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.ActivityDiagramChangeStereotypedShapeEditpolicy"/> @@ -4495,8 +4433,6 @@ height="40"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.papyrus.uml.diagram.common.editpolicies.ChangeStereotypedShapeEditPolicy.CHANGE_SHAPE_POLICY" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.ActivityDiagramChangeStereotypedShapeEditpolicy"/> @@ -4590,8 +4526,6 @@ height="40"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.papyrus.uml.diagram.common.editpolicies.ChangeStereotypedShapeEditPolicy.CHANGE_SHAPE_POLICY" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.ActivityDiagramChangeStereotypedShapeEditpolicy"/> @@ -4694,8 +4628,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy"/> @@ -4798,8 +4730,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.RequestConstants.REQ_CREATE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.CreateActionLocalConditionEditPolicy"/> @@ -4910,8 +4840,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -5016,8 +4944,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -5122,8 +5048,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -5214,8 +5138,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -5320,8 +5242,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -5426,8 +5346,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -5512,8 +5430,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.RequestConstants.REQ_CREATE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.CreateActionLocalConditionEditPolicy"/> @@ -5620,8 +5536,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -5726,8 +5640,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -5832,8 +5744,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -5924,8 +5834,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -6030,8 +5938,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -6136,8 +6042,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -6223,8 +6127,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy"/> @@ -6335,8 +6237,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.figures.AcceptEventActionFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.RequestConstants.REQ_CREATE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.CreateActionLocalConditionEditPolicy"/> @@ -6473,8 +6373,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -6558,8 +6456,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy"/> @@ -6670,8 +6566,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -6756,8 +6650,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.draw2d.StructuredActivityNodeFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.papyrus.uml.diagram.common.editpolicies.ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.ShowHideCompartmentEditPolicy"/> @@ -6824,8 +6716,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.draw2d.StructuredActivityNodeFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.papyrus.uml.diagram.common.editpolicies.ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.ShowHideCompartmentEditPolicy"/> @@ -6898,8 +6788,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -6953,8 +6841,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -7002,8 +6888,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.draw2d.StructuredActivityNodeFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.papyrus.uml.diagram.common.editpolicies.ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.ShowHideCompartmentEditPolicy"/> @@ -7074,8 +6958,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -7161,8 +7043,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -7264,8 +7144,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -7367,8 +7245,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -7458,8 +7334,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -7549,8 +7423,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -7636,8 +7508,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.draw2d.StructuredActivityNodeFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.papyrus.uml.diagram.common.editpolicies.ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.ShowHideCompartmentEditPolicy"/> @@ -7704,8 +7574,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.draw2d.StructuredActivityNodeFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.papyrus.uml.diagram.common.editpolicies.ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.ShowHideCompartmentEditPolicy"/> @@ -7774,8 +7642,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -7863,8 +7729,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -7963,8 +7827,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -8066,8 +7928,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -8151,8 +8011,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.figures.ActivityPartitionFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.papyrus.uml.diagram.common.editpolicies.ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.ShowHideCompartmentEditPolicy"/> @@ -8245,8 +8103,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.papyrus.uml.diagram.common.editpolicies.ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.ShowHideCompartmentEditPolicy"/> @@ -8354,8 +8210,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.RequestConstants.REQ_DELETE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.DeleteActionViewEditPolicy"/> @@ -8465,8 +8319,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -8661,8 +8513,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.RequestConstants.REQ_CREATE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.CreateActionLocalConditionEditPolicy"/> @@ -8773,8 +8623,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -8913,8 +8761,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.RequestConstants.REQ_CREATE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.CreateActionLocalConditionEditPolicy"/> @@ -9025,8 +8871,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -9113,8 +8957,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -9216,8 +9058,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -9317,8 +9157,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -9398,8 +9236,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.RequestConstants.REQ_CREATE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.CreateActionLocalConditionEditPolicy"/> @@ -9510,8 +9346,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -9602,8 +9436,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -9694,8 +9526,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -9786,8 +9616,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -9891,8 +9719,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -9996,8 +9822,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -10101,8 +9925,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -10206,8 +10028,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -10311,8 +10131,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -10416,8 +10234,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -10501,8 +10317,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.RequestConstants.REQ_CREATE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.CreateActionLocalConditionEditPolicy"/> @@ -10903,8 +10717,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.RequestConstants.REQ_CREATE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.CreateActionLocalConditionEditPolicy"/> @@ -11014,8 +10826,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -11096,8 +10906,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.RequestConstants.REQ_CREATE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.CreateActionLocalConditionEditPolicy"/> @@ -11208,8 +11016,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -11300,8 +11106,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -11392,8 +11196,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -11497,8 +11299,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -11602,8 +11402,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -11707,8 +11505,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -11806,8 +11602,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.RequestConstants.REQ_CREATE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.CreateActionLocalConditionEditPolicy"/> @@ -11918,8 +11712,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -12024,8 +11816,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -12130,8 +11920,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -12228,8 +12016,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy"/> @@ -12416,8 +12202,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.RequestConstants.REQ_CREATE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.CreateActionLocalConditionEditPolicy"/> @@ -12525,8 +12309,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -12613,8 +12395,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -12702,8 +12482,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -12805,8 +12583,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -12908,8 +12684,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -12997,8 +12771,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -13099,8 +12871,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -13197,8 +12967,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy"/> @@ -13304,8 +13072,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -13388,8 +13154,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -13473,8 +13237,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -13558,8 +13320,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -13656,8 +13416,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -13754,8 +13512,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -13852,8 +13608,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -13946,8 +13700,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.RequestConstants.REQ_CREATE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.CreateActionLocalConditionEditPolicy"/> @@ -14056,8 +13808,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -14144,8 +13894,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -14233,8 +13981,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -14335,8 +14081,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -14433,8 +14177,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.RequestConstants.REQ_CREATE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.CreateActionLocalConditionEditPolicy"/> @@ -14540,8 +14282,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -14629,8 +14369,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -14731,8 +14469,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -14829,8 +14565,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.RequestConstants.REQ_CREATE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.CreateActionLocalConditionEditPolicy"/> @@ -14937,8 +14671,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -15025,8 +14757,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -15114,8 +14844,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -15216,8 +14944,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -15314,8 +15040,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.RequestConstants.REQ_CREATE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.CreateActionLocalConditionEditPolicy"/> @@ -15420,8 +15144,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -15509,8 +15231,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -15611,8 +15331,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -15704,8 +15422,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.RequestConstants.REQ_CREATE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.CreateActionLocalConditionEditPolicy"/> @@ -15810,8 +15526,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -15899,8 +15613,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -16001,8 +15713,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -16094,8 +15804,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.RequestConstants.REQ_CREATE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.CreateActionLocalConditionEditPolicy"/> @@ -16202,8 +15910,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -16281,8 +15987,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.RequestConstants.REQ_CREATE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.CreateActionLocalConditionEditPolicy"/> @@ -16388,8 +16092,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -16477,8 +16179,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -16579,8 +16279,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -16672,8 +16370,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.RequestConstants.REQ_CREATE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.CreateActionLocalConditionEditPolicy"/> @@ -16780,8 +16476,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -16868,8 +16562,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -16957,8 +16649,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -17059,8 +16749,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -17152,8 +16840,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.RequestConstants.REQ_CREATE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.CreateActionLocalConditionEditPolicy"/> @@ -17260,8 +16946,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -17348,8 +17032,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -17437,8 +17119,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -17539,8 +17219,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -17632,8 +17310,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.RequestConstants.REQ_CREATE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.CreateActionLocalConditionEditPolicy"/> @@ -17738,8 +17414,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -17827,8 +17501,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -17929,8 +17601,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -18022,8 +17692,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.RequestConstants.REQ_CREATE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.CreateActionLocalConditionEditPolicy"/> @@ -18129,8 +17797,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -18217,8 +17883,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -18318,8 +17982,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -18421,8 +18083,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -18505,8 +18165,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.RequestConstants.REQ_CREATE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.CreateActionLocalConditionEditPolicy"/> @@ -18614,8 +18272,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -18706,8 +18362,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -18807,8 +18461,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> @@ -18910,8 +18562,6 @@ height="16"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.edit.policies.PinLayoutEditPolicy"/> diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/AcceptEventActionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/AcceptEventActionEditPart.java index 581f5d8774d..1409b1a6780 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/AcceptEventActionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/AcceptEventActionEditPart.java @@ -92,8 +92,6 @@ public class AcceptEventActionEditPart extends RoundedCompartmentEditPart { // installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.activity.edit.policies.AcceptEventActionCanonicalEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(RequestConstants.REQ_CREATE, new CreateActionLocalConditionEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new DeleteActionViewEditPolicy()); installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInCallBeActEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInCallBeActEditPart.java index 468b4566ade..4d39b8b8d23 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInCallBeActEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInCallBeActEditPart.java @@ -76,8 +76,6 @@ public class ActionInputPinInCallBeActEditPart extends AbstractPinEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInCallOpActAsTargetEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInCallOpActAsTargetEditPart.java index 58d6977df86..6c856a487c8 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInCallOpActAsTargetEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInCallOpActAsTargetEditPart.java @@ -76,8 +76,6 @@ public class ActionInputPinInCallOpActAsTargetEditPart extends AbstractPinEditPa installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInCallOpActEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInCallOpActEditPart.java index 19d4896d7e3..08b1fb34bb1 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInCallOpActEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInCallOpActEditPart.java @@ -76,8 +76,6 @@ public class ActionInputPinInCallOpActEditPart extends AbstractPinEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInClearStructuralFeatureActionAsObjectEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInClearStructuralFeatureActionAsObjectEditPart.java index cd85dbc53a3..12d4c534889 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInClearStructuralFeatureActionAsObjectEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInClearStructuralFeatureActionAsObjectEditPart.java @@ -76,8 +76,6 @@ public class ActionInputPinInClearStructuralFeatureActionAsObjectEditPart extend installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInCreateLinkActionAsInputValueEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInCreateLinkActionAsInputValueEditPart.java index 221e3607241..129eb438ed6 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInCreateLinkActionAsInputValueEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInCreateLinkActionAsInputValueEditPart.java @@ -76,8 +76,6 @@ public class ActionInputPinInCreateLinkActionAsInputValueEditPart extends Abstra installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInDestroyLinkActionAsInputValueEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInDestroyLinkActionAsInputValueEditPart.java index 6e2585db8e5..05360d8f153 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInDestroyLinkActionAsInputValueEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInDestroyLinkActionAsInputValueEditPart.java @@ -76,8 +76,6 @@ public class ActionInputPinInDestroyLinkActionAsInputValueEditPart extends Abstr installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInOpaqueActEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInOpaqueActEditPart.java index 376c4ecdf3f..197ee56c7db 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInOpaqueActEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInOpaqueActEditPart.java @@ -74,8 +74,6 @@ public class ActionInputPinInOpaqueActEditPart extends AbstractPinEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInReadLinkActionAsInputValueEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInReadLinkActionAsInputValueEditPart.java index 7cf71fc0836..40227c89ed2 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInReadLinkActionAsInputValueEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInReadLinkActionAsInputValueEditPart.java @@ -76,8 +76,6 @@ public class ActionInputPinInReadLinkActionAsInputValueEditPart extends Abstract installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInSendObjActAsReqEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInSendObjActAsReqEditPart.java index baa90b8d7df..9962220dc88 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInSendObjActAsReqEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInSendObjActAsReqEditPart.java @@ -74,8 +74,6 @@ public class ActionInputPinInSendObjActAsReqEditPart extends AbstractPinEditPart installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInSendObjActAsTargetEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInSendObjActAsTargetEditPart.java index 43d29543e3f..939fa010c38 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInSendObjActAsTargetEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInSendObjActAsTargetEditPart.java @@ -74,8 +74,6 @@ public class ActionInputPinInSendObjActAsTargetEditPart extends AbstractPinEditP installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInSendSigActAsTargetEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInSendSigActAsTargetEditPart.java index cd9a7a2f768..1e738b628ef 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInSendSigActAsTargetEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInSendSigActAsTargetEditPart.java @@ -74,8 +74,6 @@ public class ActionInputPinInSendSigActAsTargetEditPart extends AbstractPinEditP installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInSendSigActEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInSendSigActEditPart.java index fb5eaa4fa8c..f95bd8bce91 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInSendSigActEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionInputPinInSendSigActEditPart.java @@ -74,8 +74,6 @@ public class ActionInputPinInSendSigActEditPart extends AbstractPinEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInAddStructuralFeatureValueActionAsInserAtEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInAddStructuralFeatureValueActionAsInserAtEditPart.java index c07c5ba8d8e..c1d036ea11f 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInAddStructuralFeatureValueActionAsInserAtEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInAddStructuralFeatureValueActionAsInserAtEditPart.java @@ -76,8 +76,6 @@ public class ActionPinInAddStructuralFeatureValueActionAsInserAtEditPart extends installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInAddStructuralFeatureValueActionAsObjectEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInAddStructuralFeatureValueActionAsObjectEditPart.java index db86be028dc..9627eb5d36c 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInAddStructuralFeatureValueActionAsObjectEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInAddStructuralFeatureValueActionAsObjectEditPart.java @@ -76,8 +76,6 @@ public class ActionPinInAddStructuralFeatureValueActionAsObjectEditPart extends installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInAddStructuralFeatureValueActionAsValueEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInAddStructuralFeatureValueActionAsValueEditPart.java index 2618689a2f4..ed640e4c560 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInAddStructuralFeatureValueActionAsValueEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInAddStructuralFeatureValueActionAsValueEditPart.java @@ -76,8 +76,6 @@ public class ActionPinInAddStructuralFeatureValueActionAsValueEditPart extends A installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInAddVariableValueActionAsInsertAtEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInAddVariableValueActionAsInsertAtEditPart.java index 9c7ae4b7969..cd08462b705 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInAddVariableValueActionAsInsertAtEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInAddVariableValueActionAsInsertAtEditPart.java @@ -76,8 +76,6 @@ public class ActionPinInAddVariableValueActionAsInsertAtEditPart extends Abstrac installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInAddVariableValueActionAsValueEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInAddVariableValueActionAsValueEditPart.java index 57c3ef1aaaf..bac3adba5c4 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInAddVariableValueActionAsValueEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInAddVariableValueActionAsValueEditPart.java @@ -76,8 +76,6 @@ public class ActionPinInAddVariableValueActionAsValueEditPart extends AbstractPi installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInBroadcastSignalActionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInBroadcastSignalActionEditPart.java index a00ef8aa5f4..a6b85072989 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInBroadcastSignalActionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInBroadcastSignalActionEditPart.java @@ -76,8 +76,6 @@ public class ActionPinInBroadcastSignalActionEditPart extends AbstractPinEditPar installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInClearAssociationActionAsObjectEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInClearAssociationActionAsObjectEditPart.java index 74917114247..41ef75d1368 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInClearAssociationActionAsObjectEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInClearAssociationActionAsObjectEditPart.java @@ -76,8 +76,6 @@ public class ActionPinInClearAssociationActionAsObjectEditPart extends AbstractP installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInCreateLinkObjectActionAsInputValueEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInCreateLinkObjectActionAsInputValueEditPart.java index f4cb333725b..071e7bd5429 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInCreateLinkObjectActionAsInputValueEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInCreateLinkObjectActionAsInputValueEditPart.java @@ -76,8 +76,6 @@ public class ActionPinInCreateLinkObjectActionAsInputValueEditPart extends Abstr installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInLoopNodeAsVariableEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInLoopNodeAsVariableEditPart.java index c337ddb0362..ed10c7c9df5 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInLoopNodeAsVariableEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInLoopNodeAsVariableEditPart.java @@ -74,8 +74,6 @@ public class ActionPinInLoopNodeAsVariableEditPart extends AbstractPinEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInReadIsClassifiedObjectActionAsObjectEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInReadIsClassifiedObjectActionAsObjectEditPart.java index 34471b8e55a..0e191ae0289 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInReadIsClassifiedObjectActionAsObjectEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInReadIsClassifiedObjectActionAsObjectEditPart.java @@ -76,8 +76,6 @@ public class ActionPinInReadIsClassifiedObjectActionAsObjectEditPart extends Abs installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInReadStructuralFeatureAsObjectEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInReadStructuralFeatureAsObjectEditPart.java index 6fd547283d0..706ef75b5a2 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInReadStructuralFeatureAsObjectEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInReadStructuralFeatureAsObjectEditPart.java @@ -76,8 +76,6 @@ public class ActionPinInReadStructuralFeatureAsObjectEditPart extends AbstractPi installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInReclassifyObjectActionAsObjectEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInReclassifyObjectActionAsObjectEditPart.java index a0e6cb57e91..72275572d75 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInReclassifyObjectActionAsObjectEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInReclassifyObjectActionAsObjectEditPart.java @@ -76,8 +76,6 @@ public class ActionPinInReclassifyObjectActionAsObjectEditPart extends AbstractP installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInReduceActionAsCollectionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInReduceActionAsCollectionEditPart.java index d72124ca571..335dbec806f 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInReduceActionAsCollectionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInReduceActionAsCollectionEditPart.java @@ -76,8 +76,6 @@ public class ActionPinInReduceActionAsCollectionEditPart extends AbstractPinEdit installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInStartClassifierBehaviorActionAsObjectEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInStartClassifierBehaviorActionAsObjectEditPart.java index 9612bc28cf9..18c96a1dbbf 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInStartClassifierBehaviorActionAsObjectEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInStartClassifierBehaviorActionAsObjectEditPart.java @@ -76,8 +76,6 @@ public class ActionPinInStartClassifierBehaviorActionAsObjectEditPart extends Ab installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInStartObjectBehaviorActionAsArgumentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInStartObjectBehaviorActionAsArgumentEditPart.java index 944f54209ea..da6dd5a7667 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInStartObjectBehaviorActionAsArgumentEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInStartObjectBehaviorActionAsArgumentEditPart.java @@ -76,8 +76,6 @@ public class ActionPinInStartObjectBehaviorActionAsArgumentEditPart extends Abst installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInStartObjectBehaviorActionAsObjectEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInStartObjectBehaviorActionAsObjectEditPart.java index acc4c8f1a82..752f6c50a87 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInStartObjectBehaviorActionAsObjectEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInStartObjectBehaviorActionAsObjectEditPart.java @@ -76,8 +76,6 @@ public class ActionPinInStartObjectBehaviorActionAsObjectEditPart extends Abstra installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInStructuredActivityNodeAsStructuredNodeInputsEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInStructuredActivityNodeAsStructuredNodeInputsEditPart.java index d7a00dd9952..d0c550e4149 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInStructuredActivityNodeAsStructuredNodeInputsEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInStructuredActivityNodeAsStructuredNodeInputsEditPart.java @@ -76,8 +76,6 @@ public class ActionPinInStructuredActivityNodeAsStructuredNodeInputsEditPart ext installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInTestIdentityActionAsFirstEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInTestIdentityActionAsFirstEditPart.java index 7f7ba42da83..d2177d44b3f 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInTestIdentityActionAsFirstEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInTestIdentityActionAsFirstEditPart.java @@ -74,8 +74,6 @@ public class ActionPinInTestIdentityActionAsFirstEditPart extends AbstractPinEdi installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInTestIdentityActionAsSecondEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInTestIdentityActionAsSecondEditPart.java index f99c58b2d3c..75a6613b3be 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInTestIdentityActionAsSecondEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInTestIdentityActionAsSecondEditPart.java @@ -74,8 +74,6 @@ public class ActionPinInTestIdentityActionAsSecondEditPart extends AbstractPinEd installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInUnmarshallActionAsObjectEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInUnmarshallActionAsObjectEditPart.java index af795802e9b..098bc569ed5 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInUnmarshallActionAsObjectEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActionPinInUnmarshallActionAsObjectEditPart.java @@ -76,8 +76,6 @@ public class ActionPinInUnmarshallActionAsObjectEditPart extends AbstractPinEdit installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActivityFinalNodeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActivityFinalNodeEditPart.java index b0efef6e847..0d5b3e5dc35 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActivityFinalNodeEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActivityFinalNodeEditPart.java @@ -77,8 +77,6 @@ public class ActivityFinalNodeEditPart extends RoundedCompartmentEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(ChangeStereotypedShapeEditPolicy.CHANGE_SHAPE_POLICY, new ActivityDiagramChangeStereotypedShapeEditpolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActivityParameterNodeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActivityParameterNodeEditPart.java index 5bc8152c437..ec66d6c3ec3 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActivityParameterNodeEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActivityParameterNodeEditPart.java @@ -83,8 +83,6 @@ public class ActivityParameterNodeEditPart extends RoundedBorderNamedElementEdit installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY, new ActivityParameterMaskEditPolicy()); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActivityPartitionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActivityPartitionEditPart.java index 3d485668d1e..20c8536d7a7 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActivityPartitionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ActivityPartitionEditPart.java @@ -78,8 +78,6 @@ public class ActivityPartitionEditPart extends RoundedCompartmentEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY, new ShowHideCompartmentEditPolicy()); 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 diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/AddStructuralFeatureValueActionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/AddStructuralFeatureValueActionEditPart.java index a7483a5091f..3891b6b9b91 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/AddStructuralFeatureValueActionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/AddStructuralFeatureValueActionEditPart.java @@ -93,8 +93,6 @@ public class AddStructuralFeatureValueActionEditPart extends RoundedCompartmentE // installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.activity.edit.policies.AddStructuralFeatureValueActionCanonicalEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(RequestConstants.REQ_CREATE, new CreateActionLocalConditionEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new DeleteActionViewEditPolicy()); installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/AddVariableValueActionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/AddVariableValueActionEditPart.java index bd614ef4828..46cb62e74e1 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/AddVariableValueActionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/AddVariableValueActionEditPart.java @@ -93,8 +93,6 @@ public class AddVariableValueActionEditPart extends RoundedCompartmentEditPart { // installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.activity.edit.policies.AddVariableValueActionCanonicalEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(RequestConstants.REQ_CREATE, new CreateActionLocalConditionEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new DeleteActionViewEditPolicy()); installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/BroadcastSignalActionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/BroadcastSignalActionEditPart.java index 29411747b31..474be816f93 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/BroadcastSignalActionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/BroadcastSignalActionEditPart.java @@ -93,8 +93,6 @@ public class BroadcastSignalActionEditPart extends RoundedCompartmentEditPart { // installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.activity.edit.policies.BroadcastSignalActionCanonicalEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(RequestConstants.REQ_CREATE, new CreateActionLocalConditionEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new DeleteActionViewEditPolicy()); installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/CallBehaviorActionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/CallBehaviorActionEditPart.java index cb65b7696c2..46699c95a53 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/CallBehaviorActionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/CallBehaviorActionEditPart.java @@ -93,8 +93,6 @@ public class CallBehaviorActionEditPart extends RoundedCompartmentEditPart { // installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.activity.edit.policies.CallBehaviorActionCanonicalEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(RequestConstants.REQ_CREATE, new CreateActionLocalConditionEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new DeleteActionViewEditPolicy()); installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/CallOperationActionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/CallOperationActionEditPart.java index 77da578f605..b4e394a6a4d 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/CallOperationActionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/CallOperationActionEditPart.java @@ -93,8 +93,6 @@ public class CallOperationActionEditPart extends RoundedCompartmentEditPart { // installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.activity.edit.policies.CallOperationActionCanonicalEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(RequestConstants.REQ_CREATE, new CreateActionLocalConditionEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new DeleteActionViewEditPolicy()); installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/CentralBufferNodeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/CentralBufferNodeEditPart.java index 82bae9f6859..f993b329235 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/CentralBufferNodeEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/CentralBufferNodeEditPart.java @@ -79,8 +79,6 @@ public class CentralBufferNodeEditPart extends RoundedCompartmentEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); 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 // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ClearAssociationActionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ClearAssociationActionEditPart.java index 1edc5f0444d..38359dfdc43 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ClearAssociationActionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ClearAssociationActionEditPart.java @@ -93,8 +93,6 @@ public class ClearAssociationActionEditPart extends RoundedCompartmentEditPart { // installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.activity.edit.policies.ClearAssociationActionCanonicalEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(RequestConstants.REQ_CREATE, new CreateActionLocalConditionEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new DeleteActionViewEditPolicy()); installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ClearStructuralFeatureActionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ClearStructuralFeatureActionEditPart.java index 04adb2d971a..dc6f7843e0c 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ClearStructuralFeatureActionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ClearStructuralFeatureActionEditPart.java @@ -93,8 +93,6 @@ public class ClearStructuralFeatureActionEditPart extends RoundedCompartmentEdit // installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.activity.edit.policies.ClearStructuralFeatureActionCanonicalEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(RequestConstants.REQ_CREATE, new CreateActionLocalConditionEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new DeleteActionViewEditPolicy()); installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ConditionalNodeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ConditionalNodeEditPart.java index 3a0b7ddd3c9..ec67e8a9cff 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ConditionalNodeEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ConditionalNodeEditPart.java @@ -77,8 +77,6 @@ public class ConditionalNodeEditPart extends RoundedCompartmentEditPart { // installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.activity.edit.policies.ConditionalNodeCanonicalEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY, new ShowHideCompartmentEditPolicy()); 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 diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ConstraintAsLocalPostcondEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ConstraintAsLocalPostcondEditPart.java index 2d8ed0f87b6..95711c6ff37 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ConstraintAsLocalPostcondEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ConstraintAsLocalPostcondEditPart.java @@ -66,8 +66,6 @@ public class ConstraintAsLocalPostcondEditPart extends AbstractConstraintEditPar installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); installEditPolicy(ChangeStereotypedShapeEditPolicy.CHANGE_SHAPE_POLICY, new ActivityDiagramChangeStereotypedShapeEditpolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ConstraintAsLocalPrecondEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ConstraintAsLocalPrecondEditPart.java index 9ee25523a12..e4ca31d59c4 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ConstraintAsLocalPrecondEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ConstraintAsLocalPrecondEditPart.java @@ -66,8 +66,6 @@ public class ConstraintAsLocalPrecondEditPart extends AbstractConstraintEditPart installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); installEditPolicy(ChangeStereotypedShapeEditPolicy.CHANGE_SHAPE_POLICY, new ActivityDiagramChangeStereotypedShapeEditpolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/CreateLinkActionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/CreateLinkActionEditPart.java index 5f7eaa3750c..f55624e82e7 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/CreateLinkActionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/CreateLinkActionEditPart.java @@ -93,8 +93,6 @@ public class CreateLinkActionEditPart extends RoundedCompartmentEditPart { // installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.activity.edit.policies.CreateLinkActionCanonicalEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(RequestConstants.REQ_CREATE, new CreateActionLocalConditionEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new DeleteActionViewEditPolicy()); installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/CreateLinkObjectActionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/CreateLinkObjectActionEditPart.java index 564a0863c60..615a0fd15fc 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/CreateLinkObjectActionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/CreateLinkObjectActionEditPart.java @@ -93,8 +93,6 @@ public class CreateLinkObjectActionEditPart extends RoundedCompartmentEditPart { // installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.activity.edit.policies.CreateLinkObjectActionCanonicalEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(RequestConstants.REQ_CREATE, new CreateActionLocalConditionEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new DeleteActionViewEditPolicy()); installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/CreateObjectActionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/CreateObjectActionEditPart.java index 6750cf58ac8..be3ea897b00 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/CreateObjectActionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/CreateObjectActionEditPart.java @@ -93,8 +93,6 @@ public class CreateObjectActionEditPart extends RoundedCompartmentEditPart { // installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.activity.edit.policies.CreateObjectActionCanonicalEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(RequestConstants.REQ_CREATE, new CreateActionLocalConditionEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new DeleteActionViewEditPolicy()); installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/DataStoreNodeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/DataStoreNodeEditPart.java index 22108fb0fad..da3ec27cedb 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/DataStoreNodeEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/DataStoreNodeEditPart.java @@ -79,8 +79,6 @@ public class DataStoreNodeEditPart extends RoundedCompartmentEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); 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 // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/DecisionNodeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/DecisionNodeEditPart.java index 083d4e34f3e..c0659073a6d 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/DecisionNodeEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/DecisionNodeEditPart.java @@ -77,8 +77,6 @@ public class DecisionNodeEditPart extends RoundedCompartmentEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(ChangeStereotypedShapeEditPolicy.CHANGE_SHAPE_POLICY, new ActivityDiagramChangeStereotypedShapeEditpolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/DestroyLinkActionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/DestroyLinkActionEditPart.java index 63938b3462d..2a95adaeda8 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/DestroyLinkActionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/DestroyLinkActionEditPart.java @@ -93,8 +93,6 @@ public class DestroyLinkActionEditPart extends RoundedCompartmentEditPart { // installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.activity.edit.policies.DestroyLinkActionCanonicalEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(RequestConstants.REQ_CREATE, new CreateActionLocalConditionEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new DeleteActionViewEditPolicy()); installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/DestroyObjectActionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/DestroyObjectActionEditPart.java index e80fa52d4a4..b2a7f3bfa4a 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/DestroyObjectActionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/DestroyObjectActionEditPart.java @@ -93,8 +93,6 @@ public class DestroyObjectActionEditPart extends RoundedCompartmentEditPart { // installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.activity.edit.policies.DestroyObjectActionCanonicalEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(RequestConstants.REQ_CREATE, new CreateActionLocalConditionEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new DeleteActionViewEditPolicy()); installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/DurationConstraintAsLocalPostcondEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/DurationConstraintAsLocalPostcondEditPart.java index a4dd0824762..9ae05fe391d 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/DurationConstraintAsLocalPostcondEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/DurationConstraintAsLocalPostcondEditPart.java @@ -66,8 +66,6 @@ public class DurationConstraintAsLocalPostcondEditPart extends AbstractConstrain installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); installEditPolicy(ChangeStereotypedShapeEditPolicy.CHANGE_SHAPE_POLICY, new ActivityDiagramChangeStereotypedShapeEditpolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/DurationConstraintAsLocalPrecondEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/DurationConstraintAsLocalPrecondEditPart.java index ffa060c041a..f364bc51b1d 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/DurationConstraintAsLocalPrecondEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/DurationConstraintAsLocalPrecondEditPart.java @@ -66,8 +66,6 @@ public class DurationConstraintAsLocalPrecondEditPart extends AbstractConstraint installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); installEditPolicy(ChangeStereotypedShapeEditPolicy.CHANGE_SHAPE_POLICY, new ActivityDiagramChangeStereotypedShapeEditpolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ExpansionNodeAsInEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ExpansionNodeAsInEditPart.java index bc08c7d3ded..5c62e1f9717 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ExpansionNodeAsInEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ExpansionNodeAsInEditPart.java @@ -62,8 +62,6 @@ public class ExpansionNodeAsInEditPart extends AbstractBorderItemEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ExpansionNodeAsOutEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ExpansionNodeAsOutEditPart.java index 9643829db02..4da5e3c8ef9 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ExpansionNodeAsOutEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ExpansionNodeAsOutEditPart.java @@ -62,8 +62,6 @@ public class ExpansionNodeAsOutEditPart extends AbstractBorderItemEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ExpansionRegionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ExpansionRegionEditPart.java index 68c1f1d5c9c..abce3c08f43 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ExpansionRegionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ExpansionRegionEditPart.java @@ -78,8 +78,6 @@ public class ExpansionRegionEditPart extends RoundedCompartmentEditPart { // installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.activity.edit.policies.ExpansionRegionCanonicalEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY, new ShowHideCompartmentEditPolicy()); 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 diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/FlowFinalNodeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/FlowFinalNodeEditPart.java index b345ae3766a..283b6db9a98 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/FlowFinalNodeEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/FlowFinalNodeEditPart.java @@ -77,8 +77,6 @@ public class FlowFinalNodeEditPart extends RoundedCompartmentEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(ChangeStereotypedShapeEditPolicy.CHANGE_SHAPE_POLICY, new ActivityDiagramChangeStereotypedShapeEditpolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ForkNodeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ForkNodeEditPart.java index da812a7a425..252b253d612 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ForkNodeEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ForkNodeEditPart.java @@ -77,8 +77,6 @@ public class ForkNodeEditPart extends RoundedCompartmentEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(ChangeStereotypedShapeEditPolicy.CHANGE_SHAPE_POLICY, new ActivityDiagramChangeStereotypedShapeEditpolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InitialNodeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InitialNodeEditPart.java index e9282d25184..35960a233e9 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InitialNodeEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InitialNodeEditPart.java @@ -77,8 +77,6 @@ public class InitialNodeEditPart extends RoundedCompartmentEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(ChangeStereotypedShapeEditPolicy.CHANGE_SHAPE_POLICY, new ActivityDiagramChangeStereotypedShapeEditpolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInAddStructuralFeatureValueActionAsInserAtEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInAddStructuralFeatureValueActionAsInserAtEditPart.java index c3eadd96339..0bfe7f000a4 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInAddStructuralFeatureValueActionAsInserAtEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInAddStructuralFeatureValueActionAsInserAtEditPart.java @@ -76,8 +76,6 @@ public class InputPinInAddStructuralFeatureValueActionAsInserAtEditPart extends installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInAddStructuralFeatureValueActionAsObjectEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInAddStructuralFeatureValueActionAsObjectEditPart.java index 78464e454ae..096c3b59797 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInAddStructuralFeatureValueActionAsObjectEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInAddStructuralFeatureValueActionAsObjectEditPart.java @@ -76,8 +76,6 @@ public class InputPinInAddStructuralFeatureValueActionAsObjectEditPart extends A installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInAddStructuralFeatureValueActionAsValueEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInAddStructuralFeatureValueActionAsValueEditPart.java index 2f69b1be364..1c310f9c106 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInAddStructuralFeatureValueActionAsValueEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInAddStructuralFeatureValueActionAsValueEditPart.java @@ -76,8 +76,6 @@ public class InputPinInAddStructuralFeatureValueActionAsValueEditPart extends Ab installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInAddVariableValueActionAsInsertAtEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInAddVariableValueActionAsInsertAtEditPart.java index 57593cddd18..50143dd9d60 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInAddVariableValueActionAsInsertAtEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInAddVariableValueActionAsInsertAtEditPart.java @@ -76,8 +76,6 @@ public class InputPinInAddVariableValueActionAsInsertAtEditPart extends Abstract installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInAddVariableValueActionAsValueEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInAddVariableValueActionAsValueEditPart.java index 2d6d806acc6..64e06ac63b4 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInAddVariableValueActionAsValueEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInAddVariableValueActionAsValueEditPart.java @@ -76,8 +76,6 @@ public class InputPinInAddVariableValueActionAsValueEditPart extends AbstractPin installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInBroadcastSignalActionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInBroadcastSignalActionEditPart.java index 87ab2c8bf8d..fe565d829fa 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInBroadcastSignalActionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInBroadcastSignalActionEditPart.java @@ -76,8 +76,6 @@ public class InputPinInBroadcastSignalActionEditPart extends AbstractPinEditPart installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInCallBeActEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInCallBeActEditPart.java index c10bc107cb9..118c6f306a8 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInCallBeActEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInCallBeActEditPart.java @@ -76,8 +76,6 @@ public class InputPinInCallBeActEditPart extends AbstractPinEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInCallOpActAsTargetEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInCallOpActAsTargetEditPart.java index 9411ddfa52f..e4970a97e2b 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInCallOpActAsTargetEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInCallOpActAsTargetEditPart.java @@ -76,8 +76,6 @@ public class InputPinInCallOpActAsTargetEditPart extends AbstractPinEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInCallOpActEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInCallOpActEditPart.java index 3bd8202524a..606bf56a04c 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInCallOpActEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInCallOpActEditPart.java @@ -76,8 +76,6 @@ public class InputPinInCallOpActEditPart extends AbstractPinEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInClearAssociationActionAsObjectEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInClearAssociationActionAsObjectEditPart.java index f1617661b8f..240e6184638 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInClearAssociationActionAsObjectEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInClearAssociationActionAsObjectEditPart.java @@ -76,8 +76,6 @@ public class InputPinInClearAssociationActionAsObjectEditPart extends AbstractPi installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInClearStructuralFeatureActionAsObjectEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInClearStructuralFeatureActionAsObjectEditPart.java index c215d775945..379dbcbf4de 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInClearStructuralFeatureActionAsObjectEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInClearStructuralFeatureActionAsObjectEditPart.java @@ -76,8 +76,6 @@ public class InputPinInClearStructuralFeatureActionAsObjectEditPart extends Abst installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInCreateLinkActionAsInputValueEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInCreateLinkActionAsInputValueEditPart.java index e9d378e5c8d..bbc52b0d1a8 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInCreateLinkActionAsInputValueEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInCreateLinkActionAsInputValueEditPart.java @@ -76,8 +76,6 @@ public class InputPinInCreateLinkActionAsInputValueEditPart extends AbstractPinE installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInCreateLinkObjectActionAsInputValueEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInCreateLinkObjectActionAsInputValueEditPart.java index fba32d7d5b9..76563b1ccc6 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInCreateLinkObjectActionAsInputValueEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInCreateLinkObjectActionAsInputValueEditPart.java @@ -76,8 +76,6 @@ public class InputPinInCreateLinkObjectActionAsInputValueEditPart extends Abstra installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInDestroyLinkActionAsInputValueEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInDestroyLinkActionAsInputValueEditPart.java index edf499ae723..b85afa3b293 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInDestroyLinkActionAsInputValueEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInDestroyLinkActionAsInputValueEditPart.java @@ -76,8 +76,6 @@ public class InputPinInDestroyLinkActionAsInputValueEditPart extends AbstractPin installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInLoopNodeAsVariableEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInLoopNodeAsVariableEditPart.java index f2d723cbaaa..24f3914ed22 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInLoopNodeAsVariableEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInLoopNodeAsVariableEditPart.java @@ -74,8 +74,6 @@ public class InputPinInLoopNodeAsVariableEditPart extends AbstractPinEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInOpaqueActEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInOpaqueActEditPart.java index e1721ca1d39..70256ff402b 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInOpaqueActEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInOpaqueActEditPart.java @@ -74,8 +74,6 @@ public class InputPinInOpaqueActEditPart extends AbstractPinEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInReadIsClassifiedObjectActionAsObjectEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInReadIsClassifiedObjectActionAsObjectEditPart.java index 7eb60909180..119d26924f4 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInReadIsClassifiedObjectActionAsObjectEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInReadIsClassifiedObjectActionAsObjectEditPart.java @@ -76,8 +76,6 @@ public class InputPinInReadIsClassifiedObjectActionAsObjectEditPart extends Abst installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInReadLinkActionAsInputValueEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInReadLinkActionAsInputValueEditPart.java index fe50e48a4a1..888d5acf893 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInReadLinkActionAsInputValueEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInReadLinkActionAsInputValueEditPart.java @@ -76,8 +76,6 @@ public class InputPinInReadLinkActionAsInputValueEditPart extends AbstractPinEdi installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInReadStructuralFeatureAsObjectEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInReadStructuralFeatureAsObjectEditPart.java index e452df4f6e7..fd680a4d618 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInReadStructuralFeatureAsObjectEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInReadStructuralFeatureAsObjectEditPart.java @@ -74,8 +74,6 @@ public class InputPinInReadStructuralFeatureAsObjectEditPart extends AbstractPin installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInReclassifyObjectActionAsObjectEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInReclassifyObjectActionAsObjectEditPart.java index 1b01e962b5e..b396378c76a 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInReclassifyObjectActionAsObjectEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInReclassifyObjectActionAsObjectEditPart.java @@ -76,8 +76,6 @@ public class InputPinInReclassifyObjectActionAsObjectEditPart extends AbstractPi installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInReduceActionAsCollectionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInReduceActionAsCollectionEditPart.java index 2160f1efd1e..f306c683f00 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInReduceActionAsCollectionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInReduceActionAsCollectionEditPart.java @@ -76,8 +76,6 @@ public class InputPinInReduceActionAsCollectionEditPart extends AbstractPinEditP installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInSendObjActAsReqEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInSendObjActAsReqEditPart.java index 9217797c245..34aba7c61b9 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInSendObjActAsReqEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInSendObjActAsReqEditPart.java @@ -74,8 +74,6 @@ public class InputPinInSendObjActAsReqEditPart extends AbstractPinEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInSendObjActAsTargetEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInSendObjActAsTargetEditPart.java index 66237bae98b..ef989349c5a 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInSendObjActAsTargetEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInSendObjActAsTargetEditPart.java @@ -74,8 +74,6 @@ public class InputPinInSendObjActAsTargetEditPart extends AbstractPinEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInSendSigActAsTargetEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInSendSigActAsTargetEditPart.java index fa15c6050f8..30f5ef06d79 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInSendSigActAsTargetEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInSendSigActAsTargetEditPart.java @@ -74,8 +74,6 @@ public class InputPinInSendSigActAsTargetEditPart extends AbstractPinEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInSendSigActEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInSendSigActEditPart.java index 07852eefb51..1acea46d067 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInSendSigActEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInSendSigActEditPart.java @@ -74,8 +74,6 @@ public class InputPinInSendSigActEditPart extends AbstractPinEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInStartClassifierBehaviorActionAsObjectEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInStartClassifierBehaviorActionAsObjectEditPart.java index 0d9dfc65fda..e50106e69b1 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInStartClassifierBehaviorActionAsObjectEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInStartClassifierBehaviorActionAsObjectEditPart.java @@ -76,8 +76,6 @@ public class InputPinInStartClassifierBehaviorActionAsObjectEditPart extends Abs installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInStartObjectBehaviorActionAsArgumentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInStartObjectBehaviorActionAsArgumentEditPart.java index 9c63e320fe5..e987df9c620 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInStartObjectBehaviorActionAsArgumentEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInStartObjectBehaviorActionAsArgumentEditPart.java @@ -76,8 +76,6 @@ public class InputPinInStartObjectBehaviorActionAsArgumentEditPart extends Abstr installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInStartObjectBehaviorActionAsObjectEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInStartObjectBehaviorActionAsObjectEditPart.java index c766e719240..19bdad1a868 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInStartObjectBehaviorActionAsObjectEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInStartObjectBehaviorActionAsObjectEditPart.java @@ -76,8 +76,6 @@ public class InputPinInStartObjectBehaviorActionAsObjectEditPart extends Abstrac installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInStructuredActivityNodeAsStructuredNodeInputsEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInStructuredActivityNodeAsStructuredNodeInputsEditPart.java index 8aa6ec5cb61..6dbe891d6fe 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInStructuredActivityNodeAsStructuredNodeInputsEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInStructuredActivityNodeAsStructuredNodeInputsEditPart.java @@ -76,8 +76,6 @@ public class InputPinInStructuredActivityNodeAsStructuredNodeInputsEditPart exte installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInTestIdentityActionAsFirstEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInTestIdentityActionAsFirstEditPart.java index aabe8f0e70e..b4ca7100297 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInTestIdentityActionAsFirstEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInTestIdentityActionAsFirstEditPart.java @@ -74,8 +74,6 @@ public class InputPinInTestIdentityActionAsFirstEditPart extends AbstractPinEdit installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInTestIdentityActionAsSecondEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInTestIdentityActionAsSecondEditPart.java index 285e8360289..4f20fd1ab53 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInTestIdentityActionAsSecondEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInTestIdentityActionAsSecondEditPart.java @@ -74,8 +74,6 @@ public class InputPinInTestIdentityActionAsSecondEditPart extends AbstractPinEdi installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInUnmarshallActionAsObjectEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInUnmarshallActionAsObjectEditPart.java index 5ae317dbbf3..a75b24009c4 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInUnmarshallActionAsObjectEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InputPinInUnmarshallActionAsObjectEditPart.java @@ -78,8 +78,6 @@ public class InputPinInUnmarshallActionAsObjectEditPart extends AbstractPinEditP installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new GetChildLayoutEditPolicy()); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InterruptibleActivityRegionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InterruptibleActivityRegionEditPart.java index 918b2d3c5a0..8d8985053ee 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InterruptibleActivityRegionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/InterruptibleActivityRegionEditPart.java @@ -61,8 +61,6 @@ public class InterruptibleActivityRegionEditPart extends RoundedCompartmentEditP installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY, new ShowHideCompartmentEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/IntervalConstraintAsLocalPostcondEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/IntervalConstraintAsLocalPostcondEditPart.java index 0c133625d16..23fd625a690 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/IntervalConstraintAsLocalPostcondEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/IntervalConstraintAsLocalPostcondEditPart.java @@ -66,8 +66,6 @@ public class IntervalConstraintAsLocalPostcondEditPart extends AbstractConstrain installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); installEditPolicy(ChangeStereotypedShapeEditPolicy.CHANGE_SHAPE_POLICY, new ActivityDiagramChangeStereotypedShapeEditpolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/IntervalConstraintAsLocalPrecondEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/IntervalConstraintAsLocalPrecondEditPart.java index b98e7df3e15..29a3424fa3b 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/IntervalConstraintAsLocalPrecondEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/IntervalConstraintAsLocalPrecondEditPart.java @@ -66,8 +66,6 @@ public class IntervalConstraintAsLocalPrecondEditPart extends AbstractConstraint installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); installEditPolicy(ChangeStereotypedShapeEditPolicy.CHANGE_SHAPE_POLICY, new ActivityDiagramChangeStereotypedShapeEditpolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/JoinNodeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/JoinNodeEditPart.java index 13d2b299055..d3edbb57cbe 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/JoinNodeEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/JoinNodeEditPart.java @@ -77,8 +77,6 @@ public class JoinNodeEditPart extends RoundedCompartmentEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(ChangeStereotypedShapeEditPolicy.CHANGE_SHAPE_POLICY, new ActivityDiagramChangeStereotypedShapeEditpolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/LoopNodeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/LoopNodeEditPart.java index a441db5cbea..2509222b6aa 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/LoopNodeEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/LoopNodeEditPart.java @@ -77,8 +77,6 @@ public class LoopNodeEditPart extends RoundedCompartmentEditPart { // installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.activity.edit.policies.LoopNodeCanonicalEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY, new ShowHideCompartmentEditPolicy()); 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 diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/MergeNodeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/MergeNodeEditPart.java index 6b65be5c884..8a83a9f7563 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/MergeNodeEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/MergeNodeEditPart.java @@ -77,8 +77,6 @@ public class MergeNodeEditPart extends RoundedCompartmentEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(ChangeStereotypedShapeEditPolicy.CHANGE_SHAPE_POLICY, new ActivityDiagramChangeStereotypedShapeEditpolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OpaqueActionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OpaqueActionEditPart.java index 1e76ef1f41c..e8eed3b7dfc 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OpaqueActionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OpaqueActionEditPart.java @@ -93,8 +93,6 @@ public class OpaqueActionEditPart extends RoundedCompartmentEditPart { // installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.activity.edit.policies.OpaqueActionCanonicalEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(RequestConstants.REQ_CREATE, new CreateActionLocalConditionEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new DeleteActionViewEditPolicy()); installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInAcceptEventActionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInAcceptEventActionEditPart.java index 90a58764e1a..f441e52adee 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInAcceptEventActionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInAcceptEventActionEditPart.java @@ -74,8 +74,6 @@ public class OutputPinInAcceptEventActionEditPart extends AbstractPinEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInAddStructuralFeatureValueActionAsResultEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInAddStructuralFeatureValueActionAsResultEditPart.java index 0036e59321d..5771e548148 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInAddStructuralFeatureValueActionAsResultEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInAddStructuralFeatureValueActionAsResultEditPart.java @@ -76,8 +76,6 @@ public class OutputPinInAddStructuralFeatureValueActionAsResultEditPart extends installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInCallBeActEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInCallBeActEditPart.java index 17418d5b9e6..dc3f3958d67 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInCallBeActEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInCallBeActEditPart.java @@ -76,8 +76,6 @@ public class OutputPinInCallBeActEditPart extends AbstractPinEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInCallOpActEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInCallOpActEditPart.java index 12841282ff7..0d32fd357a1 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInCallOpActEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInCallOpActEditPart.java @@ -76,8 +76,6 @@ public class OutputPinInCallOpActEditPart extends AbstractPinEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInClearStructuralFeatureActionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInClearStructuralFeatureActionEditPart.java index 85a0abc15c0..508455b4ce9 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInClearStructuralFeatureActionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInClearStructuralFeatureActionEditPart.java @@ -76,8 +76,6 @@ public class OutputPinInClearStructuralFeatureActionEditPart extends AbstractPin installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInCreateLinkObjectActionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInCreateLinkObjectActionEditPart.java index 0e44a5ee3d8..c0fed76354b 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInCreateLinkObjectActionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInCreateLinkObjectActionEditPart.java @@ -76,8 +76,6 @@ public class OutputPinInCreateLinkObjectActionEditPart extends AbstractPinEditPa installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInCreateObjectActionAsResultEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInCreateObjectActionAsResultEditPart.java index 69e8ebe95fb..955f6c0137b 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInCreateObjectActionAsResultEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInCreateObjectActionAsResultEditPart.java @@ -74,8 +74,6 @@ public class OutputPinInCreateObjectActionAsResultEditPart extends AbstractPinEd installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInLoopNodeAsBodyOutputEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInLoopNodeAsBodyOutputEditPart.java index 84f1086bdf7..5423a1847e9 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInLoopNodeAsBodyOutputEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInLoopNodeAsBodyOutputEditPart.java @@ -74,8 +74,6 @@ public class OutputPinInLoopNodeAsBodyOutputEditPart extends AbstractPinEditPart installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInLoopNodeAsLoopVariableEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInLoopNodeAsLoopVariableEditPart.java index 1d6a1268ee7..ce917560102 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInLoopNodeAsLoopVariableEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInLoopNodeAsLoopVariableEditPart.java @@ -74,8 +74,6 @@ public class OutputPinInLoopNodeAsLoopVariableEditPart extends AbstractPinEditPa installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInLoopNodeAsResultEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInLoopNodeAsResultEditPart.java index 07c8bdbeb8d..04d6b55bb30 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInLoopNodeAsResultEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInLoopNodeAsResultEditPart.java @@ -74,8 +74,6 @@ public class OutputPinInLoopNodeAsResultEditPart extends AbstractPinEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInOpaqueActEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInOpaqueActEditPart.java index a225c63fe25..84b07524c1f 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInOpaqueActEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInOpaqueActEditPart.java @@ -74,8 +74,6 @@ public class OutputPinInOpaqueActEditPart extends AbstractPinEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInReadExtentActionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInReadExtentActionEditPart.java index aac03b08198..ccc0b10b974 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInReadExtentActionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInReadExtentActionEditPart.java @@ -76,8 +76,6 @@ public class OutputPinInReadExtentActionEditPart extends AbstractPinEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInReadIsClassifiedObjectActionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInReadIsClassifiedObjectActionEditPart.java index 228f0584d06..bc00771bff9 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInReadIsClassifiedObjectActionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInReadIsClassifiedObjectActionEditPart.java @@ -76,8 +76,6 @@ public class OutputPinInReadIsClassifiedObjectActionEditPart extends AbstractPin installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInReadLinkActionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInReadLinkActionEditPart.java index dbaf7eb9df7..a1649dd78aa 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInReadLinkActionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInReadLinkActionEditPart.java @@ -76,8 +76,6 @@ public class OutputPinInReadLinkActionEditPart extends AbstractPinEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInReadStructuralFeatureAsResultEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInReadStructuralFeatureAsResultEditPart.java index d821ba8a74e..0cb3a20dc00 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInReadStructuralFeatureAsResultEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInReadStructuralFeatureAsResultEditPart.java @@ -74,8 +74,6 @@ public class OutputPinInReadStructuralFeatureAsResultEditPart extends AbstractPi installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInReadVariableActionAsResultEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInReadVariableActionAsResultEditPart.java index 549a54c8320..3fed407c18d 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInReadVariableActionAsResultEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInReadVariableActionAsResultEditPart.java @@ -74,8 +74,6 @@ public class OutputPinInReadVariableActionAsResultEditPart extends AbstractPinEd installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInReduceActionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInReduceActionEditPart.java index e9014243208..1c13f83609a 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInReduceActionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInReduceActionEditPart.java @@ -76,8 +76,6 @@ public class OutputPinInReduceActionEditPart extends AbstractPinEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInStartObjectBehaviorActionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInStartObjectBehaviorActionEditPart.java index 06f47d7f88f..c413a31c3b5 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInStartObjectBehaviorActionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInStartObjectBehaviorActionEditPart.java @@ -76,8 +76,6 @@ public class OutputPinInStartObjectBehaviorActionEditPart extends AbstractPinEdi installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInStructuredActivityNodeAsStructuredNodeInputsEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInStructuredActivityNodeAsStructuredNodeInputsEditPart.java index 6d22b3d57e3..d4a729e5971 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInStructuredActivityNodeAsStructuredNodeInputsEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInStructuredActivityNodeAsStructuredNodeInputsEditPart.java @@ -76,8 +76,6 @@ public class OutputPinInStructuredActivityNodeAsStructuredNodeInputsEditPart ext installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInTestIdentityActionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInTestIdentityActionEditPart.java index 49650782250..a3772283919 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInTestIdentityActionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInTestIdentityActionEditPart.java @@ -74,8 +74,6 @@ public class OutputPinInTestIdentityActionEditPart extends AbstractPinEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInUnmarshallActionAsResultEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInUnmarshallActionAsResultEditPart.java index de791a63d92..dff6ce2ebd7 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInUnmarshallActionAsResultEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInUnmarshallActionAsResultEditPart.java @@ -76,8 +76,6 @@ public class OutputPinInUnmarshallActionAsResultEditPart extends AbstractPinEdit installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInValSpecActEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInValSpecActEditPart.java index 09da7fc0e20..57901f8d3a5 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInValSpecActEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/OutputPinInValSpecActEditPart.java @@ -74,8 +74,6 @@ public class OutputPinInValSpecActEditPart extends AbstractPinEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ReadExtentActionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ReadExtentActionEditPart.java index 53a6f8d3279..4302a900326 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ReadExtentActionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ReadExtentActionEditPart.java @@ -93,8 +93,6 @@ public class ReadExtentActionEditPart extends RoundedCompartmentEditPart { // installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.activity.edit.policies.ReadExtentActionCanonicalEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(RequestConstants.REQ_CREATE, new CreateActionLocalConditionEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new DeleteActionViewEditPolicy()); installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ReadIsClassifiedObjectActionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ReadIsClassifiedObjectActionEditPart.java index c7688263112..42f709175b9 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ReadIsClassifiedObjectActionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ReadIsClassifiedObjectActionEditPart.java @@ -93,8 +93,6 @@ public class ReadIsClassifiedObjectActionEditPart extends RoundedCompartmentEdit // installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.activity.edit.policies.ReadIsClassifiedObjectActionCanonicalEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(RequestConstants.REQ_CREATE, new CreateActionLocalConditionEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new DeleteActionViewEditPolicy()); installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ReadLinkActionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ReadLinkActionEditPart.java index 207466941aa..2d2e0c5e01c 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ReadLinkActionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ReadLinkActionEditPart.java @@ -93,8 +93,6 @@ public class ReadLinkActionEditPart extends RoundedCompartmentEditPart { // installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.activity.edit.policies.ReadLinkActionCanonicalEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(RequestConstants.REQ_CREATE, new CreateActionLocalConditionEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new DeleteActionViewEditPolicy()); installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ReadSelfActionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ReadSelfActionEditPart.java index 493a411f45f..ed2dd386bef 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ReadSelfActionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ReadSelfActionEditPart.java @@ -93,8 +93,6 @@ public class ReadSelfActionEditPart extends RoundedCompartmentEditPart { // installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.activity.edit.policies.ReadSelfActionCanonicalEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new DeleteActionViewEditPolicy()); installEditPolicy(ChangeStereotypedShapeEditPolicy.CHANGE_SHAPE_POLICY, new ActivityDiagramChangeStereotypedShapeEditpolicy()); installEditPolicy(RequestConstants.REQ_CREATE, new CreateActionLocalConditionEditPolicy()); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ReadSelfActionOutputPinEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ReadSelfActionOutputPinEditPart.java index 9a334f5850d..ef4f096c00b 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ReadSelfActionOutputPinEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ReadSelfActionOutputPinEditPart.java @@ -74,8 +74,6 @@ public class ReadSelfActionOutputPinEditPart extends AbstractPinEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ReadStructuralFeatureActionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ReadStructuralFeatureActionEditPart.java index 31902a9c513..d4f291fe579 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ReadStructuralFeatureActionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ReadStructuralFeatureActionEditPart.java @@ -93,8 +93,6 @@ public class ReadStructuralFeatureActionEditPart extends RoundedCompartmentEditP // installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.activity.edit.policies.ReadStructuralFeatureActionCanonicalEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(RequestConstants.REQ_CREATE, new CreateActionLocalConditionEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new DeleteActionViewEditPolicy()); installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ReadVariableActionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ReadVariableActionEditPart.java index 9305b0a4a10..78bad81238e 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ReadVariableActionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ReadVariableActionEditPart.java @@ -93,8 +93,6 @@ public class ReadVariableActionEditPart extends RoundedCompartmentEditPart { // installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.activity.edit.policies.ReadVariableActionCanonicalEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(RequestConstants.REQ_CREATE, new CreateActionLocalConditionEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new DeleteActionViewEditPolicy()); installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ReclassifyObjectActionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ReclassifyObjectActionEditPart.java index 4ab999c0c46..f784db9c3bc 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ReclassifyObjectActionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ReclassifyObjectActionEditPart.java @@ -93,8 +93,6 @@ public class ReclassifyObjectActionEditPart extends RoundedCompartmentEditPart { // installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.activity.edit.policies.ReclassifyObjectActionCanonicalEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(RequestConstants.REQ_CREATE, new CreateActionLocalConditionEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new DeleteActionViewEditPolicy()); installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ReduceActionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ReduceActionEditPart.java index 6471b4cf4a8..ade414bae1b 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ReduceActionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ReduceActionEditPart.java @@ -93,8 +93,6 @@ public class ReduceActionEditPart extends RoundedCompartmentEditPart { // installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.activity.edit.policies.ReduceActionCanonicalEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(RequestConstants.REQ_CREATE, new CreateActionLocalConditionEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new DeleteActionViewEditPolicy()); installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/SendObjectActionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/SendObjectActionEditPart.java index 97490df089a..db42b16f98a 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/SendObjectActionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/SendObjectActionEditPart.java @@ -93,8 +93,6 @@ public class SendObjectActionEditPart extends RoundedCompartmentEditPart { // installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.activity.edit.policies.SendObjectActionCanonicalEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(RequestConstants.REQ_CREATE, new CreateActionLocalConditionEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new DeleteActionViewEditPolicy()); installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/SendSignalActionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/SendSignalActionEditPart.java index ea533cd3b73..17a99d080ba 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/SendSignalActionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/SendSignalActionEditPart.java @@ -91,8 +91,6 @@ public class SendSignalActionEditPart extends RoundedCompartmentEditPart { // installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.activity.edit.policies.SendSignalActionCanonicalEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(RequestConstants.REQ_CREATE, new CreateActionLocalConditionEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new DeleteActionViewEditPolicy()); installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/SequenceNodeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/SequenceNodeEditPart.java index 3e746e42eff..bb2f3af352b 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/SequenceNodeEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/SequenceNodeEditPart.java @@ -77,8 +77,6 @@ public class SequenceNodeEditPart extends RoundedCompartmentEditPart { // installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.activity.edit.policies.SequenceNodeCanonicalEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY, new ShowHideCompartmentEditPolicy()); 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 diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/StartClassifierBehaviorActionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/StartClassifierBehaviorActionEditPart.java index 1f8dd383962..340efb18953 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/StartClassifierBehaviorActionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/StartClassifierBehaviorActionEditPart.java @@ -92,8 +92,6 @@ public class StartClassifierBehaviorActionEditPart extends RoundedCompartmentEdi // installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.activity.edit.policies.StartClassifierBehaviorActionCanonicalEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(RequestConstants.REQ_CREATE, new CreateActionLocalConditionEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new DeleteActionViewEditPolicy()); installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/StartObjectBehavoiurActionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/StartObjectBehavoiurActionEditPart.java index 09201e08f4d..e2cd7959996 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/StartObjectBehavoiurActionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/StartObjectBehavoiurActionEditPart.java @@ -93,8 +93,6 @@ public class StartObjectBehavoiurActionEditPart extends RoundedCompartmentEditPa // installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.activity.edit.policies.StartObjectBehavoiurActionCanonicalEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(RequestConstants.REQ_CREATE, new CreateActionLocalConditionEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new DeleteActionViewEditPolicy()); installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/StructuredActivityNodeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/StructuredActivityNodeEditPart.java index 70c6a786504..8390da75eef 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/StructuredActivityNodeEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/StructuredActivityNodeEditPart.java @@ -77,8 +77,6 @@ public class StructuredActivityNodeEditPart extends RoundedCompartmentEditPart { // installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.activity.edit.policies.StructuredActivityNodeCanonicalEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY, new ShowHideCompartmentEditPolicy()); 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 diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/TestIdentityActionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/TestIdentityActionEditPart.java index 9c22ff1fb53..f0a02640ea5 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/TestIdentityActionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/TestIdentityActionEditPart.java @@ -93,8 +93,6 @@ public class TestIdentityActionEditPart extends RoundedCompartmentEditPart { // installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.activity.edit.policies.TestIdentityActionCanonicalEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); installEditPolicy(ChangeStereotypedShapeEditPolicy.CHANGE_SHAPE_POLICY, new ActivityDiagramChangeStereotypedShapeEditpolicy()); installEditPolicy(RequestConstants.REQ_CREATE, new CreateActionLocalConditionEditPolicy()); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/TimeConstraintAsLocalPostcondEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/TimeConstraintAsLocalPostcondEditPart.java index 09d945a8688..68a146d7905 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/TimeConstraintAsLocalPostcondEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/TimeConstraintAsLocalPostcondEditPart.java @@ -66,8 +66,6 @@ public class TimeConstraintAsLocalPostcondEditPart extends AbstractConstraintEdi installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); installEditPolicy(ChangeStereotypedShapeEditPolicy.CHANGE_SHAPE_POLICY, new ActivityDiagramChangeStereotypedShapeEditpolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/TimeConstraintAsLocalPrecondEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/TimeConstraintAsLocalPrecondEditPart.java index 0315d8a46f0..fa47b36aff8 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/TimeConstraintAsLocalPrecondEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/TimeConstraintAsLocalPrecondEditPart.java @@ -66,8 +66,6 @@ public class TimeConstraintAsLocalPrecondEditPart extends AbstractConstraintEdit installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); installEditPolicy(ChangeStereotypedShapeEditPolicy.CHANGE_SHAPE_POLICY, new ActivityDiagramChangeStereotypedShapeEditpolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/UnmarshallActionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/UnmarshallActionEditPart.java index 13ed91c0cd9..7bdf4d862af 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/UnmarshallActionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/UnmarshallActionEditPart.java @@ -93,8 +93,6 @@ public class UnmarshallActionEditPart extends RoundedCompartmentEditPart { // installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.activity.edit.policies.UnmarshallActionCanonicalEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(RequestConstants.REQ_CREATE, new CreateActionLocalConditionEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new DeleteActionViewEditPolicy()); installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInAddStructuralFeatureValueActionAsInserAtEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInAddStructuralFeatureValueActionAsInserAtEditPart.java index f45c6a584e0..cb7bd27accc 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInAddStructuralFeatureValueActionAsInserAtEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInAddStructuralFeatureValueActionAsInserAtEditPart.java @@ -76,8 +76,6 @@ public class ValuePinInAddStructuralFeatureValueActionAsInserAtEditPart extends installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInAddStructuralFeatureValueActionAsObjectEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInAddStructuralFeatureValueActionAsObjectEditPart.java index d140a2bb21c..333044f1386 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInAddStructuralFeatureValueActionAsObjectEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInAddStructuralFeatureValueActionAsObjectEditPart.java @@ -76,8 +76,6 @@ public class ValuePinInAddStructuralFeatureValueActionAsObjectEditPart extends A installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInAddStructuralFeatureValueActionAsValueEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInAddStructuralFeatureValueActionAsValueEditPart.java index 824f456f643..848b893462d 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInAddStructuralFeatureValueActionAsValueEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInAddStructuralFeatureValueActionAsValueEditPart.java @@ -76,8 +76,6 @@ public class ValuePinInAddStructuralFeatureValueActionAsValueEditPart extends Ab installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInAddVariableValueActionAsInsertAtEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInAddVariableValueActionAsInsertAtEditPart.java index 053fa27042d..87c9fd626d6 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInAddVariableValueActionAsInsertAtEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInAddVariableValueActionAsInsertAtEditPart.java @@ -76,8 +76,6 @@ public class ValuePinInAddVariableValueActionAsInsertAtEditPart extends Abstract installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInAddVariableValueActionAsValueEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInAddVariableValueActionAsValueEditPart.java index 46f75281b73..46ca4916b61 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInAddVariableValueActionAsValueEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInAddVariableValueActionAsValueEditPart.java @@ -76,8 +76,6 @@ public class ValuePinInAddVariableValueActionAsValueEditPart extends AbstractPin installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInBroadcastSignalActionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInBroadcastSignalActionEditPart.java index acfa1050559..ad1ac3b43d9 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInBroadcastSignalActionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInBroadcastSignalActionEditPart.java @@ -76,8 +76,6 @@ public class ValuePinInBroadcastSignalActionEditPart extends AbstractPinEditPart installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInCallBeActEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInCallBeActEditPart.java index 42f4feaf6dd..e76e4b7b760 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInCallBeActEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInCallBeActEditPart.java @@ -76,8 +76,6 @@ public class ValuePinInCallBeActEditPart extends AbstractPinEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInCallOpActAsTargetEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInCallOpActAsTargetEditPart.java index c0d21f1035a..efd2282514c 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInCallOpActAsTargetEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInCallOpActAsTargetEditPart.java @@ -76,8 +76,6 @@ public class ValuePinInCallOpActAsTargetEditPart extends AbstractPinEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInCallOpActEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInCallOpActEditPart.java index 3b94ee10c66..b2031cc2076 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInCallOpActEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInCallOpActEditPart.java @@ -76,8 +76,6 @@ public class ValuePinInCallOpActEditPart extends AbstractPinEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInClearAssociationActionAsObjectEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInClearAssociationActionAsObjectEditPart.java index c5d6ca93975..81da672d915 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInClearAssociationActionAsObjectEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInClearAssociationActionAsObjectEditPart.java @@ -76,8 +76,6 @@ public class ValuePinInClearAssociationActionAsObjectEditPart extends AbstractPi installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInClearStructuralFeatureActionAsObjectEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInClearStructuralFeatureActionAsObjectEditPart.java index 8288d806321..dbd260c8a46 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInClearStructuralFeatureActionAsObjectEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInClearStructuralFeatureActionAsObjectEditPart.java @@ -76,8 +76,6 @@ public class ValuePinInClearStructuralFeatureActionAsObjectEditPart extends Abst installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInCreateLinkActionAsInputValueEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInCreateLinkActionAsInputValueEditPart.java index 97c391c253a..c9913e5800d 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInCreateLinkActionAsInputValueEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInCreateLinkActionAsInputValueEditPart.java @@ -76,8 +76,6 @@ public class ValuePinInCreateLinkActionAsInputValueEditPart extends AbstractPinE installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInCreateLinkObjectActionAsInputValueEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInCreateLinkObjectActionAsInputValueEditPart.java index a92c9a31b70..154c131aadf 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInCreateLinkObjectActionAsInputValueEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInCreateLinkObjectActionAsInputValueEditPart.java @@ -76,8 +76,6 @@ public class ValuePinInCreateLinkObjectActionAsInputValueEditPart extends Abstra installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInDestroyLinkActionAsInputValueEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInDestroyLinkActionAsInputValueEditPart.java index c824287573d..9fef7b2d806 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInDestroyLinkActionAsInputValueEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInDestroyLinkActionAsInputValueEditPart.java @@ -76,8 +76,6 @@ public class ValuePinInDestroyLinkActionAsInputValueEditPart extends AbstractPin installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInLoopNodeAsVariableEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInLoopNodeAsVariableEditPart.java index a0c60a3096b..ddd85954359 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInLoopNodeAsVariableEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInLoopNodeAsVariableEditPart.java @@ -74,8 +74,6 @@ public class ValuePinInLoopNodeAsVariableEditPart extends AbstractPinEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInOpaqueActEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInOpaqueActEditPart.java index b514b217d82..eb6cf16658e 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInOpaqueActEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInOpaqueActEditPart.java @@ -74,8 +74,6 @@ public class ValuePinInOpaqueActEditPart extends AbstractPinEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInReadIsClassifiedObjectActionAsObjectEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInReadIsClassifiedObjectActionAsObjectEditPart.java index 0a9f0445449..ed32d5b544e 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInReadIsClassifiedObjectActionAsObjectEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInReadIsClassifiedObjectActionAsObjectEditPart.java @@ -76,8 +76,6 @@ public class ValuePinInReadIsClassifiedObjectActionAsObjectEditPart extends Abst installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInReadLinkActionAsInputValueEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInReadLinkActionAsInputValueEditPart.java index 34d7780d372..1e663d82935 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInReadLinkActionAsInputValueEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInReadLinkActionAsInputValueEditPart.java @@ -76,8 +76,6 @@ public class ValuePinInReadLinkActionAsInputValueEditPart extends AbstractPinEdi installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInReadStructuralFeatureAsObjectEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInReadStructuralFeatureAsObjectEditPart.java index 4340125378d..f97ccd77427 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInReadStructuralFeatureAsObjectEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInReadStructuralFeatureAsObjectEditPart.java @@ -76,8 +76,6 @@ public class ValuePinInReadStructuralFeatureAsObjectEditPart extends AbstractPin installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInReclassifyObjectActionAsObjectEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInReclassifyObjectActionAsObjectEditPart.java index a791206e05a..12c9d726ae2 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInReclassifyObjectActionAsObjectEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInReclassifyObjectActionAsObjectEditPart.java @@ -76,8 +76,6 @@ public class ValuePinInReclassifyObjectActionAsObjectEditPart extends AbstractPi installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInReduceActionAsCollectionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInReduceActionAsCollectionEditPart.java index 8353c4345ad..75fd9ae4499 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInReduceActionAsCollectionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInReduceActionAsCollectionEditPart.java @@ -76,8 +76,6 @@ public class ValuePinInReduceActionAsCollectionEditPart extends AbstractPinEditP installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInSendObjActAsReqEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInSendObjActAsReqEditPart.java index 050587bc53e..64535681cd6 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInSendObjActAsReqEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInSendObjActAsReqEditPart.java @@ -74,8 +74,6 @@ public class ValuePinInSendObjActAsReqEditPart extends AbstractPinEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInSendObjActAsTargetEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInSendObjActAsTargetEditPart.java index 1f89f529ac4..73af81a1a8a 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInSendObjActAsTargetEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInSendObjActAsTargetEditPart.java @@ -74,8 +74,6 @@ public class ValuePinInSendObjActAsTargetEditPart extends AbstractPinEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInSendSigActAsTargetEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInSendSigActAsTargetEditPart.java index b840a27855b..c00ea98d75b 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInSendSigActAsTargetEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInSendSigActAsTargetEditPart.java @@ -74,8 +74,6 @@ public class ValuePinInSendSigActAsTargetEditPart extends AbstractPinEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInSendSigActEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInSendSigActEditPart.java index f0745442f1c..a64505592a9 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInSendSigActEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInSendSigActEditPart.java @@ -74,8 +74,6 @@ public class ValuePinInSendSigActEditPart extends AbstractPinEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInStartClassifierBehaviorActionAsObjectEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInStartClassifierBehaviorActionAsObjectEditPart.java index 67e5e439fab..91e835444e0 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInStartClassifierBehaviorActionAsObjectEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInStartClassifierBehaviorActionAsObjectEditPart.java @@ -76,8 +76,6 @@ public class ValuePinInStartClassifierBehaviorActionAsObjectEditPart extends Abs installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInStartObjectBehaviorActionAsArgumentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInStartObjectBehaviorActionAsArgumentEditPart.java index 18fc76e494e..d69039f5597 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInStartObjectBehaviorActionAsArgumentEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInStartObjectBehaviorActionAsArgumentEditPart.java @@ -76,8 +76,6 @@ public class ValuePinInStartObjectBehaviorActionAsArgumentEditPart extends Abstr installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInStartObjectBehaviorActionAsObjectEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInStartObjectBehaviorActionAsObjectEditPart.java index 34d561bdc26..f96a3db1eae 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInStartObjectBehaviorActionAsObjectEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInStartObjectBehaviorActionAsObjectEditPart.java @@ -76,8 +76,6 @@ public class ValuePinInStartObjectBehaviorActionAsObjectEditPart extends Abstrac installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInStructuredActivityNodeAsStructuredNodeInputsEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInStructuredActivityNodeAsStructuredNodeInputsEditPart.java index 6c1f65ad6af..b3bb37edf4b 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInStructuredActivityNodeAsStructuredNodeInputsEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInStructuredActivityNodeAsStructuredNodeInputsEditPart.java @@ -76,8 +76,6 @@ public class ValuePinInStructuredActivityNodeAsStructuredNodeInputsEditPart exte installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInTestIdentityActionAsFirstEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInTestIdentityActionAsFirstEditPart.java index e3bb7c338d5..d06455bf34a 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInTestIdentityActionAsFirstEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInTestIdentityActionAsFirstEditPart.java @@ -74,8 +74,6 @@ public class ValuePinInTestIdentityActionAsFirstEditPart extends AbstractPinEdit installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInTestIdentityActionAsSecondEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInTestIdentityActionAsSecondEditPart.java index cfc01927002..547ff41c28e 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInTestIdentityActionAsSecondEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInTestIdentityActionAsSecondEditPart.java @@ -74,8 +74,6 @@ public class ValuePinInTestIdentityActionAsSecondEditPart extends AbstractPinEdi installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInUnmarshallActionAsObjectEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInUnmarshallActionAsObjectEditPart.java index 729c54b40a6..e23480be4b2 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInUnmarshallActionAsObjectEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValuePinInUnmarshallActionAsObjectEditPart.java @@ -76,8 +76,6 @@ public class ValuePinInUnmarshallActionAsObjectEditPart extends AbstractPinEditP installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new PinLayoutEditPolicy()); installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValueSpecificationActionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValueSpecificationActionEditPart.java index e533a5d9af7..88baa592ea4 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValueSpecificationActionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/edit/parts/ValueSpecificationActionEditPart.java @@ -93,8 +93,6 @@ public class ValueSpecificationActionEditPart extends RoundedCompartmentEditPart // installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.activity.edit.policies.ValueSpecificationActionCanonicalEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); installEditPolicy(ChangeStereotypedShapeEditPolicy.CHANGE_SHAPE_POLICY, new ActivityDiagramChangeStereotypedShapeEditpolicy()); installEditPolicy(RequestConstants.REQ_CREATE, new CreateActionLocalConditionEditPolicy()); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/providers/UMLViewProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/providers/UMLViewProvider.java index df00d0e3f44..dbf15de3c97 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/providers/UMLViewProvider.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src-gen/org/eclipse/papyrus/uml/diagram/activity/providers/UMLViewProvider.java @@ -921,7 +921,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createInitialNode_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(InitialNodeEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -950,7 +949,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createActivityFinalNode_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ActivityFinalNodeEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -979,7 +977,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createFlowFinalNode_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(FlowFinalNodeEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -1008,7 +1005,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createOpaqueAction_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(OpaqueActionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -1032,7 +1028,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createValuePin_OpaqueActionInputShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ValuePinInOpaqueActEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -1066,7 +1061,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createActionInputPin_OpaqueActionInputShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ActionInputPinInOpaqueActEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -1100,7 +1094,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createInputPin_OpaqueActionInputShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(InputPinInOpaqueActEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -1129,7 +1122,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createOutputPin_OpaqueActionOutputShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(OutputPinInOpaqueActEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -1158,7 +1150,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createCallBehaviorAction_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(CallBehaviorActionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -1182,7 +1173,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createValuePin_CallBehaviorActionArgumentShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ValuePinInCallBeActEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -1216,7 +1206,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createActionInputPin_CallBehaviorActionArgumentShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ActionInputPinInCallBeActEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -1250,7 +1239,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createInputPin_CallBehaviorActionArgumentShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(InputPinInCallBeActEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -1279,7 +1267,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createOutputPin_CallBehaviorActionResultShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(OutputPinInCallBeActEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -1308,7 +1295,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createCallOperationAction_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(CallOperationActionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -1332,7 +1318,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createActionInputPin_CallOperationActionArgumentShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ActionInputPinInCallOpActEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -1366,7 +1351,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createValuePin_CallOperationActionArgumentShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ValuePinInCallOpActEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -1400,7 +1384,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createInputPin_CallOperationActionArgumentShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(InputPinInCallOpActEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -1429,7 +1412,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createOutputPin_CallOperationActionResultShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(OutputPinInCallOpActEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -1458,7 +1440,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createValuePin_CallOperationActionTargetShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ValuePinInCallOpActAsTargetEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -1492,7 +1473,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createActionInputPin_CallOperationActionTargetShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ActionInputPinInCallOpActAsTargetEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -1526,7 +1506,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createInputPin_CallOperationActionTargetShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(InputPinInCallOpActAsTargetEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -1555,7 +1534,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createDurationConstraint_LocalPreconditionShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(DurationConstraintAsLocalPrecondEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -1575,7 +1553,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createDurationConstraint_LocalPostconditionShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(DurationConstraintAsLocalPostcondEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -1595,7 +1572,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createTimeConstraint_LocalPreconditionShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(TimeConstraintAsLocalPrecondEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -1615,7 +1591,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createTimeConstraint_LocalPostconditionShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(TimeConstraintAsLocalPostcondEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -1635,7 +1610,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createIntervalConstraint_LocalPreconditionShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(IntervalConstraintAsLocalPrecondEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -1655,7 +1629,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createIntervalConstraint_LocalPostconditionShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(IntervalConstraintAsLocalPostcondEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -1675,7 +1648,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createConstraint_LocalPreconditionShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ConstraintAsLocalPrecondEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -1695,7 +1667,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createConstraint_LocalPostconditionShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ConstraintAsLocalPostcondEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -1715,7 +1686,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createDecisionNode_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(DecisionNodeEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -1749,7 +1719,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createMergeNode_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(MergeNodeEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -1778,7 +1747,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createForkNode_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ForkNodeEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -1807,7 +1775,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createJoinNode_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(JoinNodeEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -1841,7 +1808,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createDataStoreNode_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(DataStoreNodeEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -1870,7 +1836,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createSendObjectAction_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(SendObjectActionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -1894,7 +1859,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createValuePin_SendObjectActionRequestShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ValuePinInSendObjActAsReqEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -1928,7 +1892,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createActionInputPin_SendObjectActionRequestShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ActionInputPinInSendObjActAsReqEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -1962,7 +1925,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createInputPin_SendObjectActionRequestShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(InputPinInSendObjActAsReqEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -1991,7 +1953,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createValuePin_SendObjectActionTargetShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ValuePinInSendObjActAsTargetEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -2025,7 +1986,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createActionInputPin_SendObjectActionTargetShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ActionInputPinInSendObjActAsTargetEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -2059,7 +2019,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createInputPin_SendObjectActionTargetShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(InputPinInSendObjActAsTargetEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -2088,7 +2047,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createSendSignalAction_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(SendSignalActionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -2112,7 +2070,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createActionInputPin_SendSignalActionArgumentShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ActionInputPinInSendSigActEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -2146,7 +2103,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createValuePin_SendSignalActionArgumentShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ValuePinInSendSigActEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -2180,7 +2136,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createInputPin_SendSignalActionArgumentShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(InputPinInSendSigActEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -2209,7 +2164,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createValuePin_SendSignalActionTargetShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ValuePinInSendSigActAsTargetEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -2243,7 +2197,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createActionInputPin_SendSignalActionTargetShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ActionInputPinInSendSigActAsTargetEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -2277,7 +2230,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createInputPin_SendSignalActionTargetShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(InputPinInSendSigActAsTargetEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -2306,7 +2258,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createActivityParameterNode_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ActivityParameterNodeEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -2335,7 +2286,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createAcceptEventAction_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(AcceptEventActionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -2370,7 +2320,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createOutputPin_AcceptEventActionResultShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(OutputPinInAcceptEventActionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -2399,7 +2348,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createValueSpecificationAction_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ValueSpecificationActionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -2423,7 +2371,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createOutputPin_ValueSpecificationActionResultShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(OutputPinInValSpecActEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -2452,7 +2399,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createConditionalNode_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ConditionalNodeEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -2473,7 +2419,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createExpansionRegion_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ExpansionRegionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -2494,7 +2439,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createExpansionNode_InputShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ExpansionNodeAsInEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -2512,7 +2456,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createExpansionNode_OutputShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ExpansionNodeAsOutEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -2530,7 +2473,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createLoopNode_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(LoopNodeEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -2551,7 +2493,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createInputPin_LoopNodeVariableInputShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(InputPinInLoopNodeAsVariableEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -2579,7 +2520,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createValuePin_LoopNodeVariableInputShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ValuePinInLoopNodeAsVariableEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -2612,7 +2552,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createActionInputPin_LoopNodeVariableInputShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ActionPinInLoopNodeAsVariableEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -2645,7 +2584,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createOutputPin_LoopNodeBodyOutputShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(OutputPinInLoopNodeAsBodyOutputEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -2673,7 +2611,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createOutputPin_LoopNodeVariableShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(OutputPinInLoopNodeAsLoopVariableEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -2701,7 +2638,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createOutputPin_LoopNodeResultShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(OutputPinInLoopNodeAsResultEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -2729,7 +2665,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createSequenceNode_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(SequenceNodeEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -2750,7 +2685,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createStructuredActivityNode_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(StructuredActivityNodeEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -2771,7 +2705,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createInputPin_StructuredActivityNodeInputShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(InputPinInStructuredActivityNodeAsStructuredNodeInputsEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -2799,7 +2732,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createValuePin_StructuredActivityNodeInputShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ValuePinInStructuredActivityNodeAsStructuredNodeInputsEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -2832,7 +2764,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createActionInputPin_StructuredActivityNodeInputShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ActionPinInStructuredActivityNodeAsStructuredNodeInputsEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -2865,7 +2796,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createOutputPin_StructuredActivityNodeOutputShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(OutputPinInStructuredActivityNodeAsStructuredNodeInputsEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -2893,7 +2823,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createActivityPartition_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ActivityPartitionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -2919,7 +2848,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createInterruptibleActivityRegion_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(InterruptibleActivityRegionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -2957,7 +2885,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createReadSelfAction_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ReadSelfActionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -2981,7 +2908,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createOutputPin_ReadSelfActionResultShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ReadSelfActionOutputPinEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -3034,7 +2960,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createCreateObjectAction_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(CreateObjectActionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -3058,7 +2983,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createOutputPin_CreateObjectActionResultShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(OutputPinInCreateObjectActionAsResultEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -3110,7 +3034,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createReadStructuralFeatureAction_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ReadStructuralFeatureActionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -3134,7 +3057,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createInputPin_ReadStructuralFeatureActionObjectShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(InputPinInReadStructuralFeatureAsObjectEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -3163,7 +3085,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createValuePin_ReadStructuralFeatureActionObjectShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ValuePinInReadStructuralFeatureAsObjectEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -3196,7 +3117,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createActionInputPin_ReadStructuralFeatureActionObjectShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ActionPinInReadStructuralFeatureAsObjectEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -3229,7 +3149,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createOutputPin_ReadStructuralFeatureActionResultShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(OutputPinInReadStructuralFeatureAsResultEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -3257,7 +3176,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createAddStructuralFeatureValueAction_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(AddStructuralFeatureValueActionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -3281,7 +3199,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createInputPin_AddStructuralFeatureValueActionObjectShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(InputPinInAddStructuralFeatureValueActionAsObjectEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -3309,7 +3226,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createInputPin_AddStructuralFeatureValueActionValueShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(InputPinInAddStructuralFeatureValueActionAsValueEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -3337,7 +3253,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createInputPin_AddStructuralFeatureValueActionInsertAtShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(InputPinInAddStructuralFeatureValueActionAsInserAtEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -3365,7 +3280,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createValuePin_AddStructuralFeatureValueActionObjectShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ValuePinInAddStructuralFeatureValueActionAsObjectEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -3398,7 +3312,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createValuePin_AddStructuralFeatureValueActionValueShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ValuePinInAddStructuralFeatureValueActionAsValueEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -3431,7 +3344,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createValuePin_AddStructuralFeatureValueActionInsertAtShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ValuePinInAddStructuralFeatureValueActionAsInserAtEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -3464,7 +3376,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createActionInputPin_AddStructuralFeatureValueActionObjectShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ActionPinInAddStructuralFeatureValueActionAsObjectEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -3497,7 +3408,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createActionInputPin_AddStructuralFeatureValueActionValueShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ActionPinInAddStructuralFeatureValueActionAsValueEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -3530,7 +3440,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createActionInputPin_AddStructuralFeatureValueActionInsertAtShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ActionPinInAddStructuralFeatureValueActionAsInserAtEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -3563,7 +3472,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createOutputPin_AddStructuralFeatureValueActionResultShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(OutputPinInAddStructuralFeatureValueActionAsResultEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -3591,7 +3499,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createDestroyObjectAction_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(DestroyObjectActionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -3706,7 +3613,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createReadVariableAction_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ReadVariableActionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -3730,7 +3636,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createOutputPin_ReadVariableActionResultShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(OutputPinInReadVariableActionAsResultEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -3759,7 +3664,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createAddVariableValueAction_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(AddVariableValueActionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -3783,7 +3687,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createInputPin_AddVariableValueActionInsertAtShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(InputPinInAddVariableValueActionAsInsertAtEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -3811,7 +3714,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createInputPin_AddVariableValueActionValueShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(InputPinInAddVariableValueActionAsValueEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -3839,7 +3741,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createValuePin_AddVariableValueActionInsertAtShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ValuePinInAddVariableValueActionAsInsertAtEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -3872,7 +3773,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createValuePin_AddVariableValueActionValueShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ValuePinInAddVariableValueActionAsValueEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -3905,7 +3805,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createActionInputPin_AddVariableValueActionInsertAtShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ActionPinInAddVariableValueActionAsInsertAtEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -3938,7 +3837,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createActionInputPin_AddVariableValueActionValueShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ActionPinInAddVariableValueActionAsValueEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -3971,7 +3869,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createBroadcastSignalAction_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(BroadcastSignalActionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -3995,7 +3892,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createInputPin_BroadcastSignalActionArgumentShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(InputPinInBroadcastSignalActionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -4028,7 +3924,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createValuePin_BroadcastSignalActionArgumentShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ValuePinInBroadcastSignalActionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -4061,7 +3956,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createActionInputPin_BroadcastSignalActionArgumentShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ActionPinInBroadcastSignalActionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -4094,7 +3988,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createCentralBufferNode_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(CentralBufferNodeEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -4142,7 +4035,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createStartObjectBehaviorAction_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(StartObjectBehavoiurActionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -4166,7 +4058,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createOutputPin_StartObjectBehaviorActionResultShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(OutputPinInStartObjectBehaviorActionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -4194,7 +4085,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createInputPin_StartObjectBehaviorActionObjectShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(InputPinInStartObjectBehaviorActionAsObjectEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -4222,7 +4112,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createValuePin_StartObjectBehaviorActionObjectShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ValuePinInStartObjectBehaviorActionAsObjectEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -4255,7 +4144,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createActionInputPin_StartObjectBehaviorActionObjectShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ActionPinInStartObjectBehaviorActionAsObjectEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -4288,7 +4176,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createInputPin_StartObjectBehaviorActionArgumentShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(InputPinInStartObjectBehaviorActionAsArgumentEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -4316,7 +4203,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createValuePin_StartObjectBehaviorActionArgumentShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ValuePinInStartObjectBehaviorActionAsArgumentEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -4349,7 +4235,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createActionInputPin_StartObjectBehaviorActionArgumentShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ActionPinInStartObjectBehaviorActionAsArgumentEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -4382,7 +4267,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createTestIdentityAction_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(TestIdentityActionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -4406,7 +4290,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createOutputPin_TestIdentityActionResultShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(OutputPinInTestIdentityActionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -4434,7 +4317,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createInputPin_TestIdentityActionFirstShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(InputPinInTestIdentityActionAsFirstEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -4462,7 +4344,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createInputPin_TestIdentityActionSecondShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(InputPinInTestIdentityActionAsSecondEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -4490,7 +4371,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createValuePin_TestIdentityActionFirstShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ValuePinInTestIdentityActionAsFirstEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -4523,7 +4403,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createValuePin_TestIdentityActionSecondShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ValuePinInTestIdentityActionAsSecondEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -4556,7 +4435,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createActionInputPin_TestIdentityActionFirstShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ActionPinInTestIdentityActionAsFirstEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -4589,7 +4467,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createActionInputPin_TestIdentityActionSecondShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ActionPinInTestIdentityActionAsSecondEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -4622,7 +4499,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createClearStructuralFeatureAction_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ClearStructuralFeatureActionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -4646,7 +4522,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createOutputPin_ClearStructuralFeatureActionResultShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(OutputPinInClearStructuralFeatureActionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -4674,7 +4549,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createInputPin_ClearStructuralFeatureActionObjectShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(InputPinInClearStructuralFeatureActionAsObjectEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -4702,7 +4576,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createValuePin_ClearStructuralFeatureActionObjectShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ValuePinInClearStructuralFeatureActionAsObjectEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -4735,7 +4608,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createActionInputPin_ClearStructuralFeatureActionObjectShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ActionInputPinInClearStructuralFeatureActionAsObjectEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -4768,7 +4640,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createCreateLinkAction_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(CreateLinkActionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -4792,7 +4663,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createInputPin_CreateLinkActionInputShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(InputPinInCreateLinkActionAsInputValueEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -4820,7 +4690,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createValuePin_CreateLinkActionInputShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ValuePinInCreateLinkActionAsInputValueEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -4853,7 +4722,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createActionInputPin_CreateLinkActionInputShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ActionInputPinInCreateLinkActionAsInputValueEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -4886,7 +4754,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createReadLinkAction_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ReadLinkActionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -4910,7 +4777,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createOutputPin_ReadLinkActionResultShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(OutputPinInReadLinkActionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -4938,7 +4804,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createInputPin_ReadLinkActionInputShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(InputPinInReadLinkActionAsInputValueEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -4966,7 +4831,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createValuePin_ReadLinkActionInputShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ValuePinInReadLinkActionAsInputValueEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -4999,7 +4863,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createActionInputPin_ReadLinkActionInputShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ActionInputPinInReadLinkActionAsInputValueEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -5032,7 +4895,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createDestroyLinkAction_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(DestroyLinkActionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -5056,7 +4918,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createInputPin_DestroyLinkActionInputShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(InputPinInDestroyLinkActionAsInputValueEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -5084,7 +4945,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createValuePin_DestroyLinkActionInputShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ValuePinInDestroyLinkActionAsInputValueEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -5117,7 +4977,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createActionInputPin_DestroyLinkActionInputShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ActionInputPinInDestroyLinkActionAsInputValueEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -5150,7 +5009,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createClearAssociationAction_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ClearAssociationActionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -5174,7 +5032,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createInputPin_ClearAssociationActionObjectShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(InputPinInClearAssociationActionAsObjectEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -5202,7 +5059,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createValuePin_ClearAssociationActionObjectShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ValuePinInClearAssociationActionAsObjectEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -5235,7 +5091,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createActionInputPin_ClearAssociationActionObjectShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ActionPinInClearAssociationActionAsObjectEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -5268,7 +5123,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createReadExtentAction_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ReadExtentActionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -5292,7 +5146,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createOutputPin_ReadExtentActionResultShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(OutputPinInReadExtentActionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -5320,7 +5173,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createReclassifyObjectAction_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ReclassifyObjectActionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -5344,7 +5196,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createInputPin_ReclassifyObjectActionObjectShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(InputPinInReclassifyObjectActionAsObjectEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -5372,7 +5223,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createValuePin_ReclassifyObjectActionObjectShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ValuePinInReclassifyObjectActionAsObjectEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -5405,7 +5255,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createActionInputPin_ReclassifyObjectActionObjectShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ActionPinInReclassifyObjectActionAsObjectEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -5438,7 +5287,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createReadIsClassifiedObjectAction_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ReadIsClassifiedObjectActionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -5462,7 +5310,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createOutputPin_ReadIsClassifiedObjectActionResultShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(OutputPinInReadIsClassifiedObjectActionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -5490,7 +5337,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createInputPin_ReadIsClassifiedObjectActionObjectShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(InputPinInReadIsClassifiedObjectActionAsObjectEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -5518,7 +5364,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createValuePin_ReadIsClassifiedObjectActionObjectShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ValuePinInReadIsClassifiedObjectActionAsObjectEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -5551,7 +5396,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createActionInputPin_ReadIsClassifiedObjectActionObjectShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ActionPinInReadIsClassifiedObjectActionAsObjectEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -5584,7 +5428,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createReduceAction_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ReduceActionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -5608,7 +5451,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createOutputPin_ReduceActionResultShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(OutputPinInReduceActionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -5636,7 +5478,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createInputPin_ReduceActionCollectionShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(InputPinInReduceActionAsCollectionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -5664,7 +5505,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createValuePin_ReduceActionCollectionShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ValuePinInReduceActionAsCollectionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -5697,7 +5537,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createActionInputPin_ReduceActionCollectionShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ActionPinInReduceActionAsCollectionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -5730,7 +5569,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createStartClassifierBehaviorAction_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(StartClassifierBehaviorActionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -5754,7 +5592,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createInputPin_StartClassifierBehaviorActionObjectShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(InputPinInStartClassifierBehaviorActionAsObjectEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -5782,7 +5619,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createValuePin_StartClassifierBehaviorActionObjectShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ValuePinInStartClassifierBehaviorActionAsObjectEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -5815,7 +5651,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createActionInputPin_StartClassifierBehaviorActionObjectShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ActionPinInStartClassifierBehaviorActionAsObjectEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -5848,7 +5683,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createCreateLinkObjectAction_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(CreateLinkObjectActionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -5872,7 +5706,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createInputPin_CreateLinkObjectActionInputShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(InputPinInCreateLinkObjectActionAsInputValueEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -5900,7 +5733,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createValuePin_CreateLinkObjectActionInputShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ValuePinInCreateLinkObjectActionAsInputValueEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -5933,7 +5765,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createActionInputPin_CreateLinkObjectActionInputShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ActionPinInCreateLinkObjectActionAsInputValueEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -5966,7 +5797,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createOutputPin_CreateLinkObjectActionResultShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(OutputPinInCreateLinkObjectActionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -5993,7 +5823,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { */ public Node createUnmarshallAction_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(UnmarshallActionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -6016,7 +5845,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { */ public Node createInputPin_UnmarshallActionObjectShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(InputPinInUnmarshallActionAsObjectEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -6043,7 +5871,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { */ public Node createValuePin_UnmarshallActionObjectShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ValuePinInUnmarshallActionAsObjectEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -6075,7 +5902,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { */ public Node createActionInputPin_UnmarshallActionObjectShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(ActionPinInUnmarshallActionAsObjectEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -6107,7 +5933,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { */ public Node createOutputPin_UnmarshallActionResultShape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(OutputPinInUnmarshallActionAsResultEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/.options b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/.options index 58eb2b25cd7..bdc7520273f 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/.options +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/.options @@ -1,7 +1,7 @@ -# Tracing options for the org.eclipse.papyrus.uml.diagram.communication plug-in
-
-# Common issues
-org.eclipse.papyrus.uml.diagram.communication/debug=false
-
-# Visual IDs
-org.eclipse.papyrus.uml.diagram.communication/debug/visualID=false
+# Tracing options for the org.eclipse.papyrus.uml.diagram.communication plug-in + +# Common issues +org.eclipse.papyrus.uml.diagram.communication/debug=false + +# Visual IDs +org.eclipse.papyrus.uml.diagram.communication/debug/visualID=false diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/META-INF/MANIFEST.MF b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/META-INF/MANIFEST.MF index 14ca8d33576..a8723440e91 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/META-INF/MANIFEST.MF +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/META-INF/MANIFEST.MF @@ -1,78 +1,78 @@ -Manifest-Version: 1.0
-Export-Package: org.eclipse.papyrus.uml.diagram.communication,
- org.eclipse.papyrus.uml.diagram.communication.custom.canonical,
- org.eclipse.papyrus.uml.diagram.communication.custom.commands,
- org.eclipse.papyrus.uml.diagram.communication.custom.edit.parts,
- org.eclipse.papyrus.uml.diagram.communication.custom.edit.policies,
- org.eclipse.papyrus.uml.diagram.communication.custom.factory,
- org.eclipse.papyrus.uml.diagram.communication.custom.figures,
- org.eclipse.papyrus.uml.diagram.communication.custom.helper,
- org.eclipse.papyrus.uml.diagram.communication.custom.messages,
- org.eclipse.papyrus.uml.diagram.communication.custom.migration,
- org.eclipse.papyrus.uml.diagram.communication.custom.parser,
- org.eclipse.papyrus.uml.diagram.communication.custom.parts,
- org.eclipse.papyrus.uml.diagram.communication.custom.providers,
- org.eclipse.papyrus.uml.diagram.communication.edit.helpers,
- org.eclipse.papyrus.uml.diagram.communication.edit.parts,
- org.eclipse.papyrus.uml.diagram.communication.edit.policies,
- org.eclipse.papyrus.uml.diagram.communication.expressions,
- org.eclipse.papyrus.uml.diagram.communication.navigator,
- org.eclipse.papyrus.uml.diagram.communication.parsers,
- org.eclipse.papyrus.uml.diagram.communication.part,
- org.eclipse.papyrus.uml.diagram.communication.preferences,
- org.eclipse.papyrus.uml.diagram.communication.providers
-Bundle-ActivationPolicy: lazy
-Bundle-ClassPath: .
-Bundle-Name: %pluginName
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: JavaSE-1.8
-Require-Bundle: org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide;bundle-version="[1.7.0,2.0.0)",
- org.eclipse.ocl.ecore;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.papyrus.infra.gmfdiag.preferences;visibility:=reexport;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.uml2.uml.resources;bundle-version="[5.3.0,6.0.0)",
- org.eclipse.ui.navigator.resources;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.ui.navigator;visibility:=reexport;bundle-version="[3.6.0,4.0.0)",
- org.eclipse.papyrus.infra.gmfdiag.navigation;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.emf.ecore;visibility:=reexport;bundle-version="[2.12.0,3.0.0)",
- org.eclipse.papyrus.uml.service.types;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.gmf.runtime.diagram.ui.providers.ide;bundle-version="[1.7.0,2.0.0)",
- org.eclipse.gmf.runtime.diagram.ui.render;bundle-version="[1.7.0,2.0.0)",
- org.eclipse.draw2d;visibility:=reexport;bundle-version="[3.10.0,4.0.0)",
- org.eclipse.gmf.runtime.draw2d.ui;visibility:=reexport;bundle-version="[1.9.0,2.0.0)",
- org.eclipse.uml2.uml;visibility:=reexport;bundle-version="[5.3.0,6.0.0)",
- org.eclipse.emf.ecore;visibility:=reexport;bundle-version="[2.12.0,3.0.0)",
- org.eclipse.emf.ecore.edit;visibility:=reexport;bundle-version="[2.9.0,3.0.0)",
- org.eclipse.emf.validation;visibility:=reexport;bundle-version="[1.8.0,2.0.0)",
- org.eclipse.papyrus.infra.internationalization.utils;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.papyrus.uml.internationalization.utils;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.13.0,4.0.0)",
- org.eclipse.core.resources;bundle-version="[3.12.0,4.0.0)",
- org.eclipse.core.expressions;bundle-version="[3.6.0,4.0.0)",
- org.eclipse.jface;bundle-version="[3.13.0,4.0.0)",
- org.eclipse.ui.ide;bundle-version="[3.13.0,4.0.0)",
- org.eclipse.ui.views;bundle-version="[3.9.0,4.0.0)",
- org.eclipse.emf.ecore.xmi;bundle-version="[2.13.0,3.0.0)",
- org.eclipse.emf.edit.ui;bundle-version="[2.13.0,3.0.0)",
- org.eclipse.gmf.runtime.emf.core;bundle-version="[1.7.0,2.0.0)",
- org.eclipse.gmf.runtime.emf.commands.core;bundle-version="[1.7.0,2.0.0)",
- org.eclipse.gmf.runtime.emf.ui.properties;bundle-version="[1.7.0,2.0.0)",
- org.eclipse.gmf.runtime.diagram.ui;bundle-version="[1.8.0,2.0.0)",
- org.eclipse.papyrus.uml.diagram.common;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.papyrus.infra.widgets;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.papyrus.infra.ui;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.papyrus.infra.core.sashwindows.di;bundle-version="[1.2.0,2.0.0)",
- org.eclipse.gmf.runtime.diagram.ui.providers;bundle-version="[1.7.0,2.0.0)",
- org.eclipse.gmf.runtime.diagram.ui.resources.editor;bundle-version="[1.7.0,2.0.0)",
- org.eclipse.papyrus.uml.diagram.common;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.uml2.uml.edit;bundle-version="[5.3.0,6.0.0)",
- org.eclipse.papyrus.infra.gmfdiag.tooling.runtime;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.gef;bundle-version="[3.11.0,4.0.0)",
- org.eclipse.papyrus.extensionpoints.editors;bundle-version="[2.0.0,3.0.0)"
-Bundle-Vendor: %providerName
-Eclipse-LazyStart: true
-Bundle-Version: 3.0.0.qualifier
-Bundle-Activator: org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditorPlugin
-Bundle-ManifestVersion: 2
-Bundle-SymbolicName: org.eclipse.papyrus.uml.diagram.communication; singleton:=true
-Import-Package: com.google.common.collect;version="21.0.0"
+Manifest-Version: 1.0 +Export-Package: org.eclipse.papyrus.uml.diagram.communication, + org.eclipse.papyrus.uml.diagram.communication.custom.canonical, + org.eclipse.papyrus.uml.diagram.communication.custom.commands, + org.eclipse.papyrus.uml.diagram.communication.custom.edit.parts, + org.eclipse.papyrus.uml.diagram.communication.custom.edit.policies, + org.eclipse.papyrus.uml.diagram.communication.custom.factory, + org.eclipse.papyrus.uml.diagram.communication.custom.figures, + org.eclipse.papyrus.uml.diagram.communication.custom.helper, + org.eclipse.papyrus.uml.diagram.communication.custom.messages, + org.eclipse.papyrus.uml.diagram.communication.custom.migration, + org.eclipse.papyrus.uml.diagram.communication.custom.parser, + org.eclipse.papyrus.uml.diagram.communication.custom.parts, + org.eclipse.papyrus.uml.diagram.communication.custom.providers, + org.eclipse.papyrus.uml.diagram.communication.edit.helpers, + org.eclipse.papyrus.uml.diagram.communication.edit.parts, + org.eclipse.papyrus.uml.diagram.communication.edit.policies, + org.eclipse.papyrus.uml.diagram.communication.expressions, + org.eclipse.papyrus.uml.diagram.communication.navigator, + org.eclipse.papyrus.uml.diagram.communication.parsers, + org.eclipse.papyrus.uml.diagram.communication.part, + org.eclipse.papyrus.uml.diagram.communication.preferences, + org.eclipse.papyrus.uml.diagram.communication.providers +Bundle-ActivationPolicy: lazy +Bundle-ClassPath: . +Bundle-Name: %pluginName +Bundle-Localization: plugin +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Require-Bundle: org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide;bundle-version="[1.7.0,2.0.0)", + org.eclipse.ocl.ecore;bundle-version="[3.5.0,4.0.0)", + org.eclipse.papyrus.infra.gmfdiag.preferences;visibility:=reexport;bundle-version="[3.0.0,4.0.0)", + org.eclipse.uml2.uml.resources;bundle-version="[5.3.0,6.0.0)", + org.eclipse.ui.navigator.resources;bundle-version="[3.5.0,4.0.0)", + org.eclipse.ui.navigator;visibility:=reexport;bundle-version="[3.6.0,4.0.0)", + org.eclipse.papyrus.infra.gmfdiag.navigation;bundle-version="[2.0.0,3.0.0)", + org.eclipse.emf.ecore;visibility:=reexport;bundle-version="[2.12.0,3.0.0)", + org.eclipse.papyrus.uml.service.types;bundle-version="[3.0.0,4.0.0)", + org.eclipse.gmf.runtime.diagram.ui.providers.ide;bundle-version="[1.7.0,2.0.0)", + org.eclipse.gmf.runtime.diagram.ui.render;bundle-version="[1.7.0,2.0.0)", + org.eclipse.draw2d;visibility:=reexport;bundle-version="[3.10.0,4.0.0)", + org.eclipse.gmf.runtime.draw2d.ui;visibility:=reexport;bundle-version="[1.9.0,2.0.0)", + org.eclipse.uml2.uml;visibility:=reexport;bundle-version="[5.3.0,6.0.0)", + org.eclipse.emf.ecore;visibility:=reexport;bundle-version="[2.12.0,3.0.0)", + org.eclipse.emf.ecore.edit;visibility:=reexport;bundle-version="[2.9.0,3.0.0)", + org.eclipse.emf.validation;visibility:=reexport;bundle-version="[1.8.0,2.0.0)", + org.eclipse.papyrus.infra.internationalization.utils;bundle-version="[1.0.0,2.0.0)", + org.eclipse.papyrus.uml.internationalization.utils;bundle-version="[1.0.0,2.0.0)", + org.eclipse.core.runtime;bundle-version="[3.13.0,4.0.0)", + org.eclipse.core.resources;bundle-version="[3.12.0,4.0.0)", + org.eclipse.core.expressions;bundle-version="[3.6.0,4.0.0)", + org.eclipse.jface;bundle-version="[3.13.0,4.0.0)", + org.eclipse.ui.ide;bundle-version="[3.13.0,4.0.0)", + org.eclipse.ui.views;bundle-version="[3.9.0,4.0.0)", + org.eclipse.emf.ecore.xmi;bundle-version="[2.13.0,3.0.0)", + org.eclipse.emf.edit.ui;bundle-version="[2.13.0,3.0.0)", + org.eclipse.gmf.runtime.emf.core;bundle-version="[1.7.0,2.0.0)", + org.eclipse.gmf.runtime.emf.commands.core;bundle-version="[1.7.0,2.0.0)", + org.eclipse.gmf.runtime.emf.ui.properties;bundle-version="[1.7.0,2.0.0)", + org.eclipse.gmf.runtime.diagram.ui;bundle-version="[1.8.0,2.0.0)", + org.eclipse.papyrus.uml.diagram.common;bundle-version="[3.0.0,4.0.0)", + org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="[3.0.0,4.0.0)", + org.eclipse.papyrus.infra.widgets;bundle-version="[3.0.0,4.0.0)", + org.eclipse.papyrus.infra.ui;bundle-version="[2.0.0,3.0.0)", + org.eclipse.papyrus.infra.core.sashwindows.di;bundle-version="[1.2.0,2.0.0)", + org.eclipse.gmf.runtime.diagram.ui.providers;bundle-version="[1.7.0,2.0.0)", + org.eclipse.gmf.runtime.diagram.ui.resources.editor;bundle-version="[1.7.0,2.0.0)", + org.eclipse.papyrus.uml.diagram.common;bundle-version="[3.0.0,4.0.0)", + org.eclipse.uml2.uml.edit;bundle-version="[5.3.0,6.0.0)", + org.eclipse.papyrus.infra.gmfdiag.tooling.runtime;bundle-version="[3.0.0,4.0.0)", + org.eclipse.gef;bundle-version="[3.11.0,4.0.0)", + org.eclipse.papyrus.extensionpoints.editors;bundle-version="[2.0.0,3.0.0)" +Bundle-Vendor: %providerName +Eclipse-LazyStart: true +Bundle-Version: 3.0.0.qualifier +Bundle-Activator: org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditorPlugin +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: org.eclipse.papyrus.uml.diagram.communication; singleton:=true +Import-Package: com.google.common.collect;version="21.0.0" diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/model/communicationdiagram.gmfgen b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/model/communicationdiagram.gmfgen index a729696eb44..9b034aae1d3 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/model/communicationdiagram.gmfgen +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/model/communicationdiagram.gmfgen @@ -1,1156 +1,1154 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<xmi:XMI
- xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:gmfgen="http://www.eclipse.org/gmf/2009/GenModel"
- xmlns:papyrusgmfgenextension="http://www.eclipse.org/papyrus/2009/papyrusgmfgenextension">
- <gmfgen:GenEditorGenerator
- packageNamePrefix="org.eclipse.papyrus.uml.diagram.communication"
- modelID="PapyrusUMLCommunicationDiagram"
- diagramFileExtension="PapyrusUMLCommunication_diagram"
- domainFileExtension="PapyrusUMLCommunication"
- dynamicTemplates="true"
- templateDirectory="/org.eclipse.papyrus.def/xtend/"
- copyrightText="Copyright (c) 2014 CEA LIST.

All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html

Contributors:
 CEA LIST - Initial API and implementation"
- pluginDirectory="/org.eclipse.papyrus.uml.diagram.communication/src-gen">
- <diagram
- visualID="1000"
- editPartClassName="ModelEditPart"
- canonicalEditPolicyClassName="ModelCanonicalEditPolicy"
- editingDomainID="org.eclipse.papyrus.uml.diagram.communication.EditingDomain"
- validationEnabled="true"
- validationDecorators="true"
- liveValidationUIFeedback="true">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Diagram"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.diagram.communication.Package_CommunicationDiagram"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.draw2d.FreeformLayer"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key=""RemoveOrphanView""
- editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.communication.custom.edit.policies.CustomOrphanViewPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.DRAG_DROP_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.communication.custom.edit.policies.CustomDiagramDragDropEditPolicy"/>
- <domainDiagramElement
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package"/>
- <childNodes
- visualID="8001"
- editPartClassName="LifelineEditPartCN"
- itemSemanticEditPolicyClassName="LifelineItemSemanticEditPolicyCN"
- canonicalEditPolicyClassName="LifelineCanonicalEditPolicyCN"
- graphicalNodeEditPolicyClassName="LifelineGraphicalNodeEditPolicyCN"
- createCommandClassName="LifelineCreateCommandCN"
- containers="/0/@diagram/@compartments.0">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.umldi.Lifeline_Shape"
- displayName="Lifeline"
- definedExternally="true"
- editHelperClassName="LifelineEditHelper"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure">
- <attributes
- xsi:type="gmfgen:DefaultSizeAttributes"
- width="100"
- height="25"/>
- </viewmap>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.gef.EditPolicy.GRAPHICAL_NODE_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.communication.custom.edit.policies.CommunicationGraphicalNodeEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.uml.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.GetChildLayoutEditPolicy"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Lifeline"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Interaction/lifeline"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Interaction/lifeline"/>
- <modelElementInitializer
- xsi:type="gmfgen:GenFeatureSeqInitializer">
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.1/@expressions.5">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </initializers>
- </modelElementInitializer>
- </modelFacet>
- <labels
- visualID="5002"
- editPartClassName="LifelineNameEditPart">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getNameLabel"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel"/>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.4"
- viewPattern="{0}"
- editorPattern="{0}"
- editPattern="{0}">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- <labels
- xsi:type="gmfgen:GenExternalNodeLabel"
- visualID="6014"
- editPartClassName="LifelineFloatingLabelEditPartCN"
- itemSemanticEditPolicyClassName="LifelineFloatingLabelItemSemanticEditPolicy">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.infra.gmfdiag.common.figure.node.PapyrusWrappingLabel"/>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.0"
- viewPattern=""
- editorPattern=""
- editPattern="">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- </childNodes>
- <childNodes
- visualID="8004"
- editPartClassName="ConstraintEditPartCN"
- itemSemanticEditPolicyClassName="ConstraintItemSemanticEditPolicyCN"
- canonicalEditPolicyClassName="ConstraintCanonicalEditPolicyCN"
- graphicalNodeEditPolicyClassName="ConstraintGraphicalNodeEditPolicyCN"
- createCommandClassName="ConstraintCreateCommandCN"
- containers="/0/@diagram/@compartments.0">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.umldi.Constraint_Shape"
- displayName="Constraint"
- definedExternally="true"
- editHelperClassName="ConstraintEditHelper"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.ConstraintFigure"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Constraint"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Namespace/ownedRule"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Namespace/ownedRule"/>
- <modelElementInitializer
- xsi:type="gmfgen:GenFeatureSeqInitializer">
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.1/@expressions.5">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </initializers>
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.1/@expressions.6">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Constraint/specification"/>
- </initializers>
- </modelElementInitializer>
- </modelFacet>
- <labels
- visualID="5064"
- editPartClassName="ConstraintNameEditPartCN"
- itemSemanticEditPolicyClassName="ConstraintNameItemSemanticEditPolicyCN"
- elementIcon="true">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getNameLabel"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel"/>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.0">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- <labels
- visualID="5160"
- editPartClassName="ConstraintBodyEditPartCN"
- itemSemanticEditPolicyClassName="ConstraintNameItemSemanticEditPolicy">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getConstraintFigure"
- figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.ConstraintFigure"/>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.3"
- viewPattern=""
- editPattern="">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Constraint/specification"/>
- </modelFacet>
- </labels>
- </childNodes>
- <childNodes
- visualID="8005"
- editPartClassName="CommentEditPartCN"
- itemSemanticEditPolicyClassName="CommentItemSemanticEditPolicyCN"
- canonicalEditPolicyClassName="CommentCanonicalEditPolicyCN"
- graphicalNodeEditPolicyClassName="CommentGraphicalNodeEditPolicyCN"
- createCommandClassName="CommentCreateCommandCN"
- containers="/0/@diagram/@compartments.0">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.umldi.Comment_Shape"
- displayName="Comment"
- definedExternally="true"
- editHelperClassName="CommentEditHelper"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.HTMLCornerBentFigure"/>
- <behaviour
- xsi:type="gmfgen:OpenDiagramBehaviour"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.gef.EditPolicy.PRIMARY_DRAG_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.PapyrusReflowableShapeEditPolicy"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Comment"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Element/ownedComment"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Element/ownedComment"/>
- <modelElementInitializer
- xsi:type="gmfgen:GenFeatureSeqInitializer">
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.0/@expressions.7">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Comment/body"/>
- </initializers>
- </modelElementInitializer>
- </modelFacet>
- <labels
- visualID="5150"
- editPartClassName="CommentBodyEditPartCN"
- itemSemanticEditPolicyClassName="CommentBodyItemSemanticEditPolicyCN">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getCornerBentFigure"
- figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.HTMLCornerBentFigure"/>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.1">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Comment/body"/>
- </modelFacet>
- </labels>
- </childNodes>
- <childNodes
- visualID="8006"
- editPartClassName="TimeObservationEditPartCN"
- itemSemanticEditPolicyClassName="TimeObservationItemSemanticEditPolicyCN"
- canonicalEditPolicyClassName="TimeObservationCanonicalEditPolicyCN"
- graphicalNodeEditPolicyClassName="TimeObservationGraphicalNodeEditPolicyCN"
- createCommandClassName="TimeObservationCreateCommandCN"
- containers="/0/@diagram/@compartments.0">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.umldi.TimeObservation_Shape"
- displayName="TimeObservation"
- definedExternally="true"
- editHelperClassName="TimeObservationEditHelper"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure">
- <attributes
- xsi:type="gmfgen:DefaultSizeAttributes"
- width="20"
- height="20"/>
- </viewmap>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeIconlDisplayEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.uml.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.GetChildLayoutEditPolicy"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/TimeObservation"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/>
- <modelElementInitializer
- xsi:type="gmfgen:GenFeatureSeqInitializer">
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.1/@expressions.5">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </initializers>
- </modelElementInitializer>
- </modelFacet>
- <labels
- xsi:type="gmfgen:GenExternalNodeLabel"
- visualID="5153"
- editPartClassName="TimeObservationNameEditPartCN"
- itemSemanticEditPolicyClassName="TimeObservationNameItemSemanticEditPolicyCN">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.infra.gmfdiag.common.figure.node.PapyrusWrappingLabel">
- <attributes
- xsi:type="gmfgen:LabelOffsetAttributes"
- x="25"
- y="3"/>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.0">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- <labels
- xsi:type="gmfgen:GenExternalNodeLabel"
- visualID="5154"
- editPartClassName="TimeObservationStereotypeLabelEditPartCN"
- itemSemanticEditPolicyClassName="TimeObservationStereotypeLabelItemSemanticEditPolicyCN">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.AppliedStereotypeWrappingLabelFigure">
- <attributes
- xsi:type="gmfgen:LabelOffsetAttributes"
- x="25"
- y="-10"/>
- </viewmap>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeExternalNodeEditPolicy"/>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.2"
- viewPattern="<<{0}>>"
- editorPattern="<<{0}>>"
- editPattern="<<{0}>>">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- </childNodes>
- <childNodes
- visualID="8007"
- editPartClassName="DurationObservationEditPartCN"
- itemSemanticEditPolicyClassName="DurationObservationItemSemanticEditPolicyCN"
- canonicalEditPolicyClassName="DurationObservationCanonicalEditPolicyCN"
- graphicalNodeEditPolicyClassName="DurationObservationGraphicalNodeEditPolicyCN"
- createCommandClassName="DurationObservationCreateCommandCN"
- containers="/0/@diagram/@compartments.0">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.umldi.DurationObservation_Shape"
- displayName="DurationObservation"
- definedExternally="true"
- editHelperClassName="DurationObservationEditHelper"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure">
- <attributes
- xsi:type="gmfgen:DefaultSizeAttributes"
- width="20"
- height="20"/>
- </viewmap>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeIconlDisplayEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.uml.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.GetChildLayoutEditPolicy"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/DurationObservation"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/>
- <modelElementInitializer
- xsi:type="gmfgen:GenFeatureSeqInitializer">
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.1/@expressions.5">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </initializers>
- </modelElementInitializer>
- </modelFacet>
- <labels
- xsi:type="gmfgen:GenExternalNodeLabel"
- visualID="5155"
- editPartClassName="DurationObservationLabelEditPartCN"
- itemSemanticEditPolicyClassName="DurationObservationLabelItemSemanticEditPolicyCN">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.infra.gmfdiag.common.figure.node.PapyrusWrappingLabel">
- <attributes
- xsi:type="gmfgen:LabelOffsetAttributes"
- x="25"
- y="3"/>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.0">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- <labels
- xsi:type="gmfgen:GenExternalNodeLabel"
- visualID="5156"
- editPartClassName="DurationObservationStereotypeLabelEditPartCN">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.AppliedStereotypeWrappingLabelFigure">
- <attributes
- xsi:type="gmfgen:LabelOffsetAttributes"
- x="25"
- y="-10"/>
- </viewmap>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeExternalNodeEditPolicy"/>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.2"
- viewPattern="<<{0}>>"
- editorPattern="<<{0}>>"
- editPattern="<<{0}>>">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- </childNodes>
- <topLevelNodes
- visualID="8002"
- editPartClassName="InteractionEditPart"
- itemSemanticEditPolicyClassName="InteractionItemSemanticEditPolicy"
- canonicalEditPolicyClassName="InteractionCanonicalEditPolicy"
- compartments="/0/@diagram/@compartments.0"
- graphicalNodeEditPolicyClassName="InteractionGraphicalNodeEditPolicy"
- createCommandClassName="InteractionCreateCommand">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.umldi.Interaction_Shape"
- displayName="Interaction"
- definedExternally="true"
- editHelperClassName="InteractionEditHelper"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.communication.custom.figures.InteractionRectangleFigure">
- <attributes
- xsi:type="gmfgen:DefaultSizeAttributes"
- width="857"
- height="757"/>
- </viewmap>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.gef.EditPolicy.GRAPHICAL_NODE_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.communication.custom.edit.policies.CommunicationGraphicalNodeEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.DRAG_DROP_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.communication.custom.edit.policies.CustomDiagramDragDropEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.uml.diagram.common.editpolicies.ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.ShowHideCompartmentEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.GetChildLayoutEditPolicy"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Interaction"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Component/packagedElement"/>
- <modelElementInitializer
- xsi:type="gmfgen:GenFeatureSeqInitializer">
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.1/@expressions.5">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </initializers>
- </modelElementInitializer>
- </modelFacet>
- <labels
- visualID="5001"
- elementIcon="true">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getNameLabel"
- figureQualifiedClassName="org.eclipse.papyrus.infra.gmfdiag.common.figure.node.PapyrusWrappingLabel"/>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.0"
- viewPattern="{0}"
- editorPattern="{0}"
- editPattern="{0}">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- <labels
- xsi:type="gmfgen:GenExternalNodeLabel"
- visualID="6013"
- editPartClassName="InteractionFloatingLabelEditPart"
- itemSemanticEditPolicyClassName="InteractionFloatingLabelItemSemanticEditPolicy">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.infra.gmfdiag.common.figure.node.PapyrusWrappingLabel">
- <attributes
- xsi:type="gmfgen:LabelOffsetAttributes"
- x="50"/>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.0"
- viewPattern=""
- editorPattern=""
- editPattern="">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- </topLevelNodes>
- <links
- visualID="8009"
- editPartClassName="MessageEditPart"
- itemSemanticEditPolicyClassName="MessageItemSemanticEditPolicy"
- incomingCreationAllowed="true"
- createCommandClassName="MessageCreateCommand"
- reorientCommandClassName="MessageReorientCommand">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.communication.Path_Edge"
- displayName="Message"
- definedExternally="true"
- editHelperClassName="MessageEditHelper"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.communication.custom.figures.MessageFigure"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy"/>
- <modelFacet
- xsi:type="gmfgen:TypeLinkModelFacet"
- modelElementSelector="/0/@expressionProviders/@providers.0/@expressions.5">
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Message"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Interaction/message"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Interaction/message"/>
- <modelElementInitializer
- xsi:type="gmfgen:GenFeatureSeqInitializer">
- <initializers
- xsi:type="gmfgen:GenFeatureValueSpec"
- value="/0/@expressionProviders/@providers.1/@expressions.5">
- <feature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </initializers>
- </modelElementInitializer>
- <sourceMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Element/owner"/>
- <targetMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Element/ownedElement"/>
- </modelFacet>
- <labels
- visualID="6001"
- editPartClassName="MessageNameEditPart"
- itemSemanticEditPolicyClassName="MessageNameItemSemanticEditPolicy"
- elementIcon="true">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getFigureMessageCreateLabelFigure"
- figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.communication.custom.figures.CustomWrappingLabel">
- <attributes
- xsi:type="gmfgen:LabelOffsetAttributes"
- x="1"
- y="-23"/>
- </viewmap>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key=""CustomDisplay""
- editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.communication.custom.edit.policies.MessageNameEditPolicy"/>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.0"
- editorPattern="{0}"
- editPattern="{0}">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- <labels
- visualID="6012"
- editPartClassName="AppliedStereotypeMessageEditPart"
- itemSemanticEditPolicyClassName="AppliedStereotypeMessageEditPolicy">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getAppliedStereotypeLabel"
- figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.communication.custom.figures.CustomWrappingLabel">
- <attributes
- xsi:type="gmfgen:LabelOffsetAttributes"
- x="1"
- y="-53"/>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.2"
- viewPattern="<<{0}>>"
- editorPattern="<<{0}>>"
- editPattern="<<{0}>>">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- <creationConstraints
- sourceEnd="/0/@expressionProviders/@providers.0/@expressions.3"
- targetEnd="/0/@expressionProviders/@providers.0/@expressions.3"/>
- </links>
- <links
- visualID="8010"
- editPartClassName="CommentAnnotatedElementEditPart"
- itemSemanticEditPolicyClassName="CommentAnnotatedElementItemSemanticEditPolicy"
- createCommandClassName="CommentAnnotatedElementCreateCommand"
- reorientCommandClassName="CommentAnnotatedElementReorientCommand">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/>
- <elementType
- xsi:type="gmfgen:SpecializationType"
- uniqueIdentifier="org.eclipse.papyrus.umldi.Comment_AnnotatedElementEdge"
- definedExternally="true"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.edge.SimpleDashedEdgeFigure"/>
- <modelFacet
- xsi:type="gmfgen:FeatureLinkModelFacet">
- <metaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Comment/annotatedElement"/>
- </modelFacet>
- </links>
- <links
- visualID="8011"
- editPartClassName="ConstraintConstrainedElementEditPart"
- itemSemanticEditPolicyClassName="ConstraintConstrainedElementItemSemanticEditPolicy"
- createCommandClassName="ConstraintConstrainedElementCreateCommand"
- reorientCommandClassName="ConstraintConstrainedElementReorientCommand">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/>
- <elementType
- xsi:type="gmfgen:SpecializationType"
- uniqueIdentifier="org.eclipse.papyrus.umldi.Constraint_ConstrainedElementEdge"
- definedExternally="true"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.edge.SimpleDashedEdgeFigure"/>
- <modelFacet
- xsi:type="gmfgen:FeatureLinkModelFacet">
- <metaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Constraint/constrainedElement"/>
- </modelFacet>
- </links>
- <links
- visualID="8012"
- editPartClassName="ConnectorDurationObservationEditPart"
- itemSemanticEditPolicyClassName="ConnectorDurationObservationItemSemanticEditPolicy"
- createCommandClassName="ConnectorDurationObservationCreateCommand"
- reorientCommandClassName="ConnectorDurationObservationReorientCommand">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/>
- <elementType
- xsi:type="gmfgen:SpecializationType"
- uniqueIdentifier="org.eclipse.papyrus.umldi.DurationObservation_EventEdge"
- definedExternally="true"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.edge.SimpleDashedEdgeFigure"/>
- <modelFacet
- xsi:type="gmfgen:FeatureLinkModelFacet">
- <metaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/DurationObservation/event"/>
- </modelFacet>
- </links>
- <links
- visualID="8013"
- editPartClassName="ConnectorTimeObservationEditPart"
- itemSemanticEditPolicyClassName="ConnectorTimeObservationItemSemanticEditPolicy"
- createCommandClassName="ConnectorTimeObservationCreateCommand"
- reorientCommandClassName="ConnectorTimeObservationReorientCommand">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/>
- <elementType
- xsi:type="gmfgen:SpecializationType"
- uniqueIdentifier="org.eclipse.papyrus.umldi.TimeObservation_EventEdge"
- definedExternally="true"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.edge.SimpleDashedEdgeFigure"/>
- <modelFacet
- xsi:type="gmfgen:FeatureLinkModelFacet">
- <metaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/TimeObservation/event"/>
- </modelFacet>
- </links>
- <compartments
- visualID="7001"
- editPartClassName="InteractionCompartmentEditPart"
- itemSemanticEditPolicyClassName="InteractionCompartmentItemSemanticEditPolicy"
- canonicalEditPolicyClassName="InteractionCompartmentCanonicalEditPolicy"
- childNodes="/0/@diagram/@childNodes.0 /0/@diagram/@childNodes.2 /0/@diagram/@childNodes.1 /0/@diagram/@childNodes.3 /0/@diagram/@childNodes.4"
- title="InteractionCompartment"
- needsTitle="false"
- node="/0/@diagram/@topLevelNodes.0"
- listLayout="false">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getCompartmentFigure"
- figureQualifiedClassName="org.eclipse.draw2d.RectangleFigure"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key=""RemoveOrphanView""
- editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.OrphanViewPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.DRAG_DROP_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.communication.custom.edit.policies.CustomDiagramDragDropEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.BorderDisplayEditPolicy.BORDER_DISPLAY_EDITPOLICY"
- editPolicyQualifiedClassName="org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.BorderDisplayEditPolicy"/>
- </compartments>
- <palette
- factoryClassName="UMLPaletteFactory">
- <groups
- title="Nodes"
- description="Nodes"
- largeIconPath="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"
- smallIconPath="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"
- id=""communication.group.nodes""
- collapse="true">
- <entries
- xsi:type="gmfgen:ToolEntry"
- title="Lifeline"
- description="Create a Lifeline"
- largeIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Lifeline.gif"
- smallIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Lifeline.gif"
- createMethodName="createLifelineComCreationTool"
- id=""communication.tool.lifeline""
- genNodes="/0/@diagram/@childNodes.0"/>
- <entries
- xsi:type="gmfgen:ToolEntry"
- title="Comment"
- description="Create new Comment"
- largeIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Comment.gif"
- smallIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Comment.gif"
- createMethodName="createComment7CreationTool"
- id=""communication.tool.comment""
- genNodes="/0/@diagram/@childNodes.2"/>
- <entries
- xsi:type="gmfgen:ToolEntry"
- title="Constraint"
- description="Create a constraint"
- largeIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Constraint.gif"
- smallIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Constraint.gif"
- createMethodName="createConstraint5CreationTool"
- id=""communication.tool.constraint""
- genNodes="/0/@diagram/@childNodes.1"/>
- <entries
- xsi:type="gmfgen:ToolEntry"
- title="Duration Observation"
- description="Create a Duration Observation on a Message"
- largeIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/DurationObservation.gif"
- smallIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/DurationObservation.gif"
- createMethodName="createDurationObservation4CreationTool"
- id=""communication.tool.durationobservation""
- genNodes="/0/@diagram/@childNodes.4"/>
- <entries
- xsi:type="gmfgen:ToolEntry"
- title="Time Observation"
- description="Create a Time Observation"
- largeIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/TimeObservation.gif"
- smallIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/TimeObservation.gif"
- createMethodName="createTimeObservation6CreationTool"
- id=""communication.tool.timeobservation""
- qualifiedToolName=""
- genNodes="/0/@diagram/@childNodes.3"/>
- </groups>
- <groups
- title="Edges"
- description="Edges tools"
- largeIconPath="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"
- smallIconPath="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"
- createMethodName="createEdges2Group"
- collapse="true">
- <entries
- xsi:type="gmfgen:ToolEntry"
- title="Message"
- description="MessageCreate"
- largeIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Message_createMessage.gif"
- smallIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Message_createMessage.gif"
- createMethodName="createMessageCreateCreationTool"
- qualifiedToolName=""
- genLinks="/0/@diagram/@links.0"/>
- <entries
- xsi:type="gmfgen:ToolEntry"
- title="Link"
- description="Creation of a link for comment, constraint, TimeObservation, DurationObservation"
- largeIconPath="icons/obj16/Link.gif"
- smallIconPath="icons/obj16/Link.gif"
- createMethodName="createLink13CreationTool"
- genLinks="/0/@diagram/@links.1 /0/@diagram/@links.2 /0/@diagram/@links.3 /0/@diagram/@links.4"/>
- </groups>
- </palette>
- <preferencePages
- xsi:type="gmfgen:GenStandardPreferencePage"
- iD="org.eclipse.uml2.uml.diagram.general"
- name="UML Diagram">
- <children
- xsi:type="gmfgen:GenStandardPreferencePage"
- iD="org.eclipse.uml2.uml.diagram.appearance"
- name="Appearance"
- kind="Appearance"
- className="DiagramAppearancePreferencePage"/>
- <children
- xsi:type="gmfgen:GenStandardPreferencePage"
- iD="org.eclipse.uml2.uml.diagram.connections"
- name="Connections"
- kind="Connections"
- className="DiagramConnectionsPreferencePage"/>
- <children
- xsi:type="gmfgen:GenStandardPreferencePage"
- iD="org.eclipse.uml2.uml.diagram.printing"
- name="Printing"
- kind="Printing"
- className="DiagramPrintingPreferencePage"/>
- </preferencePages>
- </diagram>
- <plugin
- iD="org.eclipse.papyrus.uml.diagram.communication"
- name="org.eclipse.papyrus.uml.diagram.communication"
- version="3.0.0.qualifier">
- <requiredPlugins>org.eclipse.draw2d</requiredPlugins>
- <requiredPlugins>org.eclipse.papyrus.uml.diagram.common</requiredPlugins>
- <requiredPlugins>org.eclipse.gmf.runtime.draw2d.ui</requiredPlugins>
- </plugin>
- <editor/>
- <navigator/>
- <diagramUpdater/>
- <domainGenModel
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#/"/>
- <expressionProviders>
- <providers
- xsi:type="gmfgen:GenExpressionInterpreter">
- <expressions
- body="let base : String = 'Lifeline' in
let suffixes : Sequence(String) = Sequence {'', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'} in 
let space : Namespace = self.namespace in
let allMissed : Sequence(String) = suffixes->
 select(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s))
 ) in
let firstMissed : String = allMissed->first() in 
let noMisses : Boolean = firstMissed.oclIsUndefined() in
let allNames : Set(String) = 
 if noMisses 
 then 
 space.member->collect(e : NamedElement | 
 if e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base
 then '' 
 else e.name 
 endif)->asSet()->excluding('') else Set{'not in use'} 
 endif in 
let longestName : String = 
 if noMisses
 then allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first() 
 else 'not in use' 
 endif in 
if noMisses then 
 if longestName.oclIsUndefined() 
 then base 
 else longestName.concat('1') 
 endif 
else 
 base.concat(firstMissed) 
endif "/>
- <expressions
- body="let base : String = 'Interaction' in
let suffixes : Sequence(String) = Sequence {'', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'} in 
let space : Namespace = self.namespace in
let allMissed : Sequence(String) = suffixes->
 select(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s))
 ) in
let firstMissed : String = allMissed->first() in 
let noMisses : Boolean = firstMissed.oclIsUndefined() in
let allNames : Set(String) = 
 if noMisses 
 then 
 space.member->collect(e : NamedElement | 
 if e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base
 then '' 
 else e.name 
 endif)->asSet()->excluding('') else Set{'not in use'} 
 endif in 
let longestName : String = 
 if noMisses
 then allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first() 
 else 'not in use' 
 endif in 
if noMisses then 
 if longestName.oclIsUndefined() 
 then base 
 else longestName.concat('1') 
 endif 
else 
 base.concat(firstMissed) 
endif "/>
- <expressions
- body="self.messageSort=MessageSort::createMessage and self.sendEvent<>null and self.receiveEvent<>null"/>
- <expressions
- xsi:type="gmfgen:GenConstraint"
- body="self.oclIsKindOf(uml::Lifeline)"/>
- <expressions
- xsi:type="gmfgen:GenConstraint"
- body="self.oclIsKindOf(uml::InteractionFragment) or self.oclIsKindOf(uml::Lifeline)"/>
- <expressions
- xsi:type="gmfgen:GenConstraint"
- body="self.sendEvent<>null and self.receiveEvent<>null"/>
- <expressions
- body="'OpaqueExpression'"/>
- <expressions
- body="' '"/>
- </providers>
- <providers
- xsi:type="gmfgen:GenJavaExpressionProvider"
- injectExpressionBody="true">
- <expressions
- body="return self.getBody();"/>
- <expressions
- body="return getName(self);"/>
- <expressions
- body="return getNamedElement(self, "", "t", "");"/>
- <expressions
- body="return getNamedElement(self, "", self.eClass().getName(), "");"/>
- <expressions
- body="return getNamedElement(self, "", "d", "");"/>
- <expressions
- body="return org.eclipse.papyrus.uml.tools.utils.NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());"/>
- <expressions
- body="org.eclipse.uml2.uml.LiteralString literalString=org.eclipse.uml2.uml.UMLFactory.eINSTANCE.createLiteralString();
literalString.setValue("");
return literalString;"/>
- </providers>
- <providers
- xsi:type="gmfgen:GenLiteralExpressionProvider">
- <expressions
- body="0"/>
- <expressions
- body="1"/>
- </providers>
- </expressionProviders>
- <labelParsers
- extensibleViaService="true">
- <implementations
- xsi:type="gmfgen:PredefinedParser"
- uses="/0/@diagram/@topLevelNodes.0/@labels.0/@modelFacet /0/@diagram/@childNodes.1/@labels.0/@modelFacet /0/@diagram/@childNodes.4/@labels.0/@modelFacet /0/@diagram/@childNodes.3/@labels.0/@modelFacet /0/@diagram/@links.0/@labels.0/@modelFacet /0/@diagram/@topLevelNodes.0/@labels.1/@modelFacet /0/@diagram/@childNodes.0/@labels.1/@modelFacet"
- className="MessageFormatParser"/>
- <implementations
- xsi:type="gmfgen:CustomParser"
- uses="/0/@diagram/@childNodes.2/@labels.0/@modelFacet"
- qualifiedName="org.eclipse.papyrus.uml.diagram.common.parser.CommentParser"/>
- <implementations
- xsi:type="gmfgen:CustomParser"
- uses="/0/@diagram/@childNodes.3/@labels.1/@modelFacet /0/@diagram/@childNodes.4/@labels.1/@modelFacet /0/@diagram/@links.0/@labels.1/@modelFacet"
- qualifiedName="org.eclipse.papyrus.uml.diagram.common.parser.stereotype.AppliedStereotypeParser"/>
- <implementations
- xsi:type="gmfgen:CustomParser"
- uses="/0/@diagram/@childNodes.1/@labels.1/@modelFacet"
- qualifiedName="org.eclipse.papyrus.uml.diagram.common.parser.ConstraintParser"/>
- <implementations
- xsi:type="gmfgen:CustomParser"
- uses="/0/@diagram/@childNodes.0/@labels.0/@modelFacet"
- qualifiedName="org.eclipse.papyrus.uml.diagram.communication.custom.parser.LifelineCustomParsers"/>
- </labelParsers>
- <extensions
- name="Custom templates"
- rootInput="PapyrusUMLCommunicationDiagram">
- <invocations
- xsi:type="gmfgen:GenTemplateInvocation"
- description="VisualTypeProvider"
- templateFqn="aspects::xpt::providers::VisualTypeProvider::VisualTypeProvider"
- inputs="/0/@extensions.0"
- oclExpression="self.diagram"/>
- </extensions>
- </gmfgen:GenEditorGenerator>
- <papyrusgmfgenextension:PapyrusExtensionRootNode
- comment="Papyrus specific extension for GMFGen">
- <extensionNodes
- xsi:type="papyrusgmfgenextension:SpecificLocatorExternalLabel"
- comment="External node label locator"
- classpath="org.eclipse.papyrus.uml.diagram.common.locator.ExternalLabelPositionLocator"
- genExternalNodeLabel="/0/@diagram/@childNodes.3/@labels.1 /0/@diagram/@childNodes.4/@labels.1"/>
- <extensionNodes
- xsi:type="papyrusgmfgenextension:ExtendedGenView"
- comment="adding to manange otherNamedElement"
- genView="/0/@diagram"
- name="OtherNamedElementEditPart"
- superOwnedEditPart="org.eclipse.papyrus.uml.diagram.common.editparts.NamedElementEditPart"/>
- <extensionNodes
- xsi:type="papyrusgmfgenextension:ExtendedGenView"
- comment="this is an extension to manage the comment"
- genView="/0/@diagram/@childNodes.2"
- name="comment extended node"
- superOwnedEditPart="org.eclipse.papyrus.uml.diagram.common.editparts.AbstractCommentEditPart"/>
- <extensionNodes
- xsi:type="papyrusgmfgenextension:ExtendedGenView"
- comment="this is an extension for constraint "
- genView="/0/@diagram/@childNodes.1"
- name="ConstraintEditPart extension"
- superOwnedEditPart="org.eclipse.papyrus.uml.diagram.common.editparts.AbstractConstraintEditPart"/>
- <extensionNodes
- xsi:type="papyrusgmfgenextension:SpecificDiagramUpdater"
- comment="InteractionCompartment custom DiagramUpdater"
- classpath="org.eclipse.papyrus.uml.diagram.communication.custom.parts.InteractionCompartmentDiagramUpdater"
- genNode="/0/@diagram/@compartments.0"/>
- <extensionNodes
- xsi:type="papyrusgmfgenextension:ExtendedGenView"
- comment="add superclass for floating Label"
- genView="/0/@diagram/@topLevelNodes.0/@labels.1 /0/@diagram/@childNodes.4/@labels.0 /0/@diagram/@childNodes.3/@labels.0 /0/@diagram/@childNodes.0/@labels.1"
- name="FloatingLabelEditPart"
- superOwnedEditPart="org.eclipse.papyrus.uml.diagram.common.editparts.FloatingLabelEditPart"/>
- <extensionNodes
- xsi:type="papyrusgmfgenextension:SpecificLocatorExternalLabel"
- comment="Locator for external Floating label of RoundedCompartment EP"
- classpath="org.eclipse.papyrus.uml.diagram.common.locator.RoundedRectangleLabelPositionLocator"
- genExternalNodeLabel="/0/@diagram/@topLevelNodes.0/@labels.1 /0/@diagram/@childNodes.3/@labels.0 /0/@diagram/@childNodes.4/@labels.0 /0/@diagram/@childNodes.0/@labels.1"/>
- <extensionNodes
- xsi:type="papyrusgmfgenextension:ExtendedGenView"
- comment="Rounded Compartment EditPart"
- genView="/0/@diagram/@childNodes.3 /0/@diagram/@childNodes.4 /0/@diagram/@childNodes.0 /0/@diagram/@topLevelNodes.0"
- name="RoundedCompartmentEditPart"
- superOwnedEditPart="org.eclipse.papyrus.uml.diagram.common.editparts.RoundedCompartmentEditPart"/>
- <extensionNodes
- xsi:type="papyrusgmfgenextension:ExtendedGenView"
- comment="Label in charge to display applied stereotypes on links"
- genView="/0/@diagram/@links.2 /0/@diagram/@links.1"
- name="UMLConnectionNodeEditPart"
- superOwnedEditPart="org.eclipse.papyrus.uml.diagram.common.editparts.UMLConnectionNodeEditPart"/>
- </papyrusgmfgenextension:PapyrusExtensionRootNode>
- <papyrusgmfgenextension:VisualIDOverride
- genView="/0/@diagram"
- visualID="Package_CommunicationDiagram">
- <child
- genView="/0/@diagram/@childNodes.0"
- visualID="Lifeline_Shape">
- <child
- genView="/0/@diagram/@childNodes.0/@labels.0"
- visualID="Lifeline_NameLabel"/>
- <child
- genView="/0/@diagram/@childNodes.0/@labels.1"
- visualID="Lifeline_FloatingNameLabel"/>
- </child>
- <child
- genView="/0/@diagram/@childNodes.1"
- visualID="Constraint_Shape">
- <child
- genView="/0/@diagram/@childNodes.1/@labels.0"
- visualID="Constraint_NameLabel"/>
- <child
- genView="/0/@diagram/@childNodes.1/@labels.1"
- visualID="Constraint_BodyLabel"/>
- </child>
- <child
- genView="/0/@diagram/@childNodes.2"
- visualID="Comment_Shape">
- <child
- genView="/0/@diagram/@childNodes.2/@labels.0"
- visualID="Comment_BodyLabel"/>
- </child>
- <child
- genView="/0/@diagram/@childNodes.3"
- visualID="TimeObservation_Shape">
- <child
- genView="/0/@diagram/@childNodes.3/@labels.0"
- visualID="TimeObservation_NameLabel"/>
- <child
- genView="/0/@diagram/@childNodes.3/@labels.1"
- visualID="TimeObservation_StereotypeLabel"/>
- </child>
- <child
- genView="/0/@diagram/@childNodes.4"
- visualID="DurationObservation_Shape">
- <child
- genView="/0/@diagram/@childNodes.4/@labels.0"
- visualID="DurationObservation_NameLabel"/>
- <child
- genView="/0/@diagram/@childNodes.4/@labels.1"
- visualID="DurationObservation_StereotypeLabel"/>
- </child>
- <child
- genView="/0/@diagram/@compartments.0"
- visualID="Interaction_SubfragmentCompartment"/>
- <child
- genView="/0/@diagram/@topLevelNodes.0"
- visualID="Interaction_Shape">
- <child
- genView="/0/@diagram/@topLevelNodes.0/@labels.0"
- visualID="Interaction_NameLabel"/>
- <child
- genView="/0/@diagram/@topLevelNodes.0/@labels.1"
- visualID="Interaction_FloatingNameLabel"/>
- </child>
- <child
- genView="/0/@diagram/@links.0"
- visualID="Path_Edge">
- <child
- genView="/0/@diagram/@links.0/@labels.0"
- visualID="Path_MessageLabel"/>
- <child
- genView="/0/@diagram/@links.0/@labels.1"
- visualID="Path_StereotypeLabel"/>
- </child>
- <child
- genView="/0/@diagram/@links.1"
- visualID="Comment_AnnotatedElementEdge"/>
- <child
- genView="/0/@diagram/@links.2"
- visualID="Constraint_ConstrainedElementEdge"/>
- <child
- genView="/0/@diagram/@links.3"
- visualID="DurationObservation_EventEdge"/>
- <child
- genView="/0/@diagram/@links.4"
- visualID="TimeObservation_EventEdge"/>
- </papyrusgmfgenextension:VisualIDOverride>
-</xmi:XMI>
+<?xml version="1.0" encoding="UTF-8"?> +<xmi:XMI + xmi:version="2.0" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:gmfgen="http://www.eclipse.org/gmf/2009/GenModel" + xmlns:papyrusgmfgenextension="http://www.eclipse.org/papyrus/2009/papyrusgmfgenextension"> + <gmfgen:GenEditorGenerator + packageNamePrefix="org.eclipse.papyrus.uml.diagram.communication" + modelID="PapyrusUMLCommunicationDiagram" + diagramFileExtension="PapyrusUMLCommunication_diagram" + domainFileExtension="PapyrusUMLCommunication" + dynamicTemplates="true" + templateDirectory="/org.eclipse.papyrus.def/xtend/" + copyrightText="Copyright (c) 2014 CEA LIST.

All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html

Contributors:
 CEA LIST - Initial API and implementation" + pluginDirectory="/org.eclipse.papyrus.uml.diagram.communication/src-gen"> + <diagram + visualID="1000" + editPartClassName="ModelEditPart" + canonicalEditPolicyClassName="ModelCanonicalEditPolicy" + editingDomainID="org.eclipse.papyrus.uml.diagram.communication.EditingDomain" + validationEnabled="true" + validationDecorators="true" + liveValidationUIFeedback="true"> + <diagramRunTimeClass + href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Diagram"/> + <elementType + xsi:type="gmfgen:MetamodelType" + uniqueIdentifier="org.eclipse.papyrus.uml.diagram.communication.Package_CommunicationDiagram"/> + <viewmap + xsi:type="gmfgen:FigureViewmap" + figureQualifiedClassName="org.eclipse.draw2d.FreeformLayer"/> + <behaviour + xsi:type="gmfgen:CustomBehaviour" + key=""RemoveOrphanView"" + editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.communication.custom.edit.policies.CustomOrphanViewPolicy"/> + <behaviour + xsi:type="gmfgen:CustomBehaviour" + key="org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.DRAG_DROP_ROLE" + editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.communication.custom.edit.policies.CustomDiagramDragDropEditPolicy"/> + <domainDiagramElement + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package"/> + <childNodes + visualID="8001" + editPartClassName="LifelineEditPartCN" + itemSemanticEditPolicyClassName="LifelineItemSemanticEditPolicyCN" + canonicalEditPolicyClassName="LifelineCanonicalEditPolicyCN" + graphicalNodeEditPolicyClassName="LifelineGraphicalNodeEditPolicyCN" + createCommandClassName="LifelineCreateCommandCN" + containers="/0/@diagram/@compartments.0"> + <diagramRunTimeClass + href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> + <elementType + xsi:type="gmfgen:MetamodelType" + uniqueIdentifier="org.eclipse.papyrus.umldi.Lifeline_Shape" + displayName="Lifeline" + definedExternally="true" + editHelperClassName="LifelineEditHelper"/> + <viewmap + xsi:type="gmfgen:FigureViewmap" + figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure"> + <attributes + xsi:type="gmfgen:DefaultSizeAttributes" + width="100" + height="25"/> + </viewmap> + <behaviour + xsi:type="gmfgen:CustomBehaviour" + key="org.eclipse.gef.EditPolicy.GRAPHICAL_NODE_ROLE" + editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.communication.custom.edit.policies.CommunicationGraphicalNodeEditPolicy"/> + <behaviour + xsi:type="gmfgen:CustomBehaviour" + key="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY" + editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy"/> + <behaviour + xsi:type="gmfgen:CustomBehaviour" + key="org.eclipse.papyrus.uml.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY" + editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy"/> + <behaviour + xsi:type="gmfgen:CustomBehaviour" + key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" + editPolicyQualifiedClassName="org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.GetChildLayoutEditPolicy"/> + <modelFacet> + <metaClass + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Lifeline"/> + <containmentMetaFeature + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Interaction/lifeline"/> + <childMetaFeature + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Interaction/lifeline"/> + <modelElementInitializer + xsi:type="gmfgen:GenFeatureSeqInitializer"> + <initializers + xsi:type="gmfgen:GenFeatureValueSpec" + value="/0/@expressionProviders/@providers.1/@expressions.5"> + <feature + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/> + </initializers> + </modelElementInitializer> + </modelFacet> + <labels + visualID="5002" + editPartClassName="LifelineNameEditPart"> + <diagramRunTimeClass + href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> + <viewmap + xsi:type="gmfgen:ParentAssignedViewmap" + getterName="getNameLabel" + figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel"/> + <modelFacet + xsi:type="gmfgen:FeatureLabelModelFacet" + parser="/0/@labelParsers/@implementations.4" + viewPattern="{0}" + editorPattern="{0}" + editPattern="{0}"> + <metaFeatures + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/> + </modelFacet> + </labels> + <labels + xsi:type="gmfgen:GenExternalNodeLabel" + visualID="6014" + editPartClassName="LifelineFloatingLabelEditPartCN" + itemSemanticEditPolicyClassName="LifelineFloatingLabelItemSemanticEditPolicy"> + <diagramRunTimeClass + href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> + <viewmap + xsi:type="gmfgen:FigureViewmap" + figureQualifiedClassName="org.eclipse.papyrus.infra.gmfdiag.common.figure.node.PapyrusWrappingLabel"/> + <modelFacet + xsi:type="gmfgen:FeatureLabelModelFacet" + parser="/0/@labelParsers/@implementations.0" + viewPattern="" + editorPattern="" + editPattern=""> + <metaFeatures + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/> + </modelFacet> + </labels> + </childNodes> + <childNodes + visualID="8004" + editPartClassName="ConstraintEditPartCN" + itemSemanticEditPolicyClassName="ConstraintItemSemanticEditPolicyCN" + canonicalEditPolicyClassName="ConstraintCanonicalEditPolicyCN" + graphicalNodeEditPolicyClassName="ConstraintGraphicalNodeEditPolicyCN" + createCommandClassName="ConstraintCreateCommandCN" + containers="/0/@diagram/@compartments.0"> + <diagramRunTimeClass + href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> + <elementType + xsi:type="gmfgen:MetamodelType" + uniqueIdentifier="org.eclipse.papyrus.umldi.Constraint_Shape" + displayName="Constraint" + definedExternally="true" + editHelperClassName="ConstraintEditHelper"/> + <viewmap + xsi:type="gmfgen:FigureViewmap" + figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.ConstraintFigure"/> + <modelFacet> + <metaClass + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Constraint"/> + <containmentMetaFeature + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Namespace/ownedRule"/> + <childMetaFeature + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Namespace/ownedRule"/> + <modelElementInitializer + xsi:type="gmfgen:GenFeatureSeqInitializer"> + <initializers + xsi:type="gmfgen:GenFeatureValueSpec" + value="/0/@expressionProviders/@providers.1/@expressions.5"> + <feature + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/> + </initializers> + <initializers + xsi:type="gmfgen:GenFeatureValueSpec" + value="/0/@expressionProviders/@providers.1/@expressions.6"> + <feature + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Constraint/specification"/> + </initializers> + </modelElementInitializer> + </modelFacet> + <labels + visualID="5064" + editPartClassName="ConstraintNameEditPartCN" + itemSemanticEditPolicyClassName="ConstraintNameItemSemanticEditPolicyCN" + elementIcon="true"> + <diagramRunTimeClass + href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> + <viewmap + xsi:type="gmfgen:ParentAssignedViewmap" + getterName="getNameLabel" + figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel"/> + <modelFacet + xsi:type="gmfgen:FeatureLabelModelFacet" + parser="/0/@labelParsers/@implementations.0"> + <metaFeatures + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/> + </modelFacet> + </labels> + <labels + visualID="5160" + editPartClassName="ConstraintBodyEditPartCN" + itemSemanticEditPolicyClassName="ConstraintNameItemSemanticEditPolicy"> + <diagramRunTimeClass + href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> + <viewmap + xsi:type="gmfgen:ParentAssignedViewmap" + getterName="getConstraintFigure" + figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.ConstraintFigure"/> + <modelFacet + xsi:type="gmfgen:FeatureLabelModelFacet" + parser="/0/@labelParsers/@implementations.3" + viewPattern="" + editPattern=""> + <metaFeatures + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Constraint/specification"/> + </modelFacet> + </labels> + </childNodes> + <childNodes + visualID="8005" + editPartClassName="CommentEditPartCN" + itemSemanticEditPolicyClassName="CommentItemSemanticEditPolicyCN" + canonicalEditPolicyClassName="CommentCanonicalEditPolicyCN" + graphicalNodeEditPolicyClassName="CommentGraphicalNodeEditPolicyCN" + createCommandClassName="CommentCreateCommandCN" + containers="/0/@diagram/@compartments.0"> + <diagramRunTimeClass + href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> + <elementType + xsi:type="gmfgen:MetamodelType" + uniqueIdentifier="org.eclipse.papyrus.umldi.Comment_Shape" + displayName="Comment" + definedExternally="true" + editHelperClassName="CommentEditHelper"/> + <viewmap + xsi:type="gmfgen:FigureViewmap" + figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.HTMLCornerBentFigure"/> + <behaviour + xsi:type="gmfgen:CustomBehaviour" + key="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY" + editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy"/> + <behaviour + xsi:type="gmfgen:CustomBehaviour" + key="org.eclipse.gef.EditPolicy.PRIMARY_DRAG_ROLE" + editPolicyQualifiedClassName="org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.PapyrusReflowableShapeEditPolicy"/> + <modelFacet> + <metaClass + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Comment"/> + <containmentMetaFeature + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Element/ownedComment"/> + <childMetaFeature + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Element/ownedComment"/> + <modelElementInitializer + xsi:type="gmfgen:GenFeatureSeqInitializer"> + <initializers + xsi:type="gmfgen:GenFeatureValueSpec" + value="/0/@expressionProviders/@providers.0/@expressions.7"> + <feature + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Comment/body"/> + </initializers> + </modelElementInitializer> + </modelFacet> + <labels + visualID="5150" + editPartClassName="CommentBodyEditPartCN" + itemSemanticEditPolicyClassName="CommentBodyItemSemanticEditPolicyCN"> + <diagramRunTimeClass + href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> + <viewmap + xsi:type="gmfgen:ParentAssignedViewmap" + getterName="getCornerBentFigure" + figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.HTMLCornerBentFigure"/> + <modelFacet + xsi:type="gmfgen:FeatureLabelModelFacet" + parser="/0/@labelParsers/@implementations.1"> + <metaFeatures + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Comment/body"/> + </modelFacet> + </labels> + </childNodes> + <childNodes + visualID="8006" + editPartClassName="TimeObservationEditPartCN" + itemSemanticEditPolicyClassName="TimeObservationItemSemanticEditPolicyCN" + canonicalEditPolicyClassName="TimeObservationCanonicalEditPolicyCN" + graphicalNodeEditPolicyClassName="TimeObservationGraphicalNodeEditPolicyCN" + createCommandClassName="TimeObservationCreateCommandCN" + containers="/0/@diagram/@compartments.0"> + <diagramRunTimeClass + href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> + <elementType + xsi:type="gmfgen:MetamodelType" + uniqueIdentifier="org.eclipse.papyrus.umldi.TimeObservation_Shape" + displayName="TimeObservation" + definedExternally="true" + editHelperClassName="TimeObservationEditHelper"/> + <viewmap + xsi:type="gmfgen:FigureViewmap" + figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure"> + <attributes + xsi:type="gmfgen:DefaultSizeAttributes" + width="20" + height="20"/> + </viewmap> + <behaviour + xsi:type="gmfgen:CustomBehaviour" + key="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY" + editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeIconlDisplayEditPolicy"/> + <behaviour + xsi:type="gmfgen:CustomBehaviour" + key="org.eclipse.papyrus.uml.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY" + editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy"/> + <behaviour + xsi:type="gmfgen:CustomBehaviour" + key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" + editPolicyQualifiedClassName="org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.GetChildLayoutEditPolicy"/> + <modelFacet> + <metaClass + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/TimeObservation"/> + <containmentMetaFeature + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/> + <childMetaFeature + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/> + <modelElementInitializer + xsi:type="gmfgen:GenFeatureSeqInitializer"> + <initializers + xsi:type="gmfgen:GenFeatureValueSpec" + value="/0/@expressionProviders/@providers.1/@expressions.5"> + <feature + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/> + </initializers> + </modelElementInitializer> + </modelFacet> + <labels + xsi:type="gmfgen:GenExternalNodeLabel" + visualID="5153" + editPartClassName="TimeObservationNameEditPartCN" + itemSemanticEditPolicyClassName="TimeObservationNameItemSemanticEditPolicyCN"> + <diagramRunTimeClass + href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> + <viewmap + xsi:type="gmfgen:FigureViewmap" + figureQualifiedClassName="org.eclipse.papyrus.infra.gmfdiag.common.figure.node.PapyrusWrappingLabel"> + <attributes + xsi:type="gmfgen:LabelOffsetAttributes" + x="25" + y="3"/> + </viewmap> + <modelFacet + xsi:type="gmfgen:FeatureLabelModelFacet" + parser="/0/@labelParsers/@implementations.0"> + <metaFeatures + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/> + </modelFacet> + </labels> + <labels + xsi:type="gmfgen:GenExternalNodeLabel" + visualID="5154" + editPartClassName="TimeObservationStereotypeLabelEditPartCN" + itemSemanticEditPolicyClassName="TimeObservationStereotypeLabelItemSemanticEditPolicyCN"> + <diagramRunTimeClass + href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> + <viewmap + xsi:type="gmfgen:FigureViewmap" + figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.AppliedStereotypeWrappingLabelFigure"> + <attributes + xsi:type="gmfgen:LabelOffsetAttributes" + x="25" + y="-10"/> + </viewmap> + <behaviour + xsi:type="gmfgen:CustomBehaviour" + key="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY" + editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeExternalNodeEditPolicy"/> + <modelFacet + xsi:type="gmfgen:FeatureLabelModelFacet" + parser="/0/@labelParsers/@implementations.2" + viewPattern="<<{0}>>" + editorPattern="<<{0}>>" + editPattern="<<{0}>>"> + <metaFeatures + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/> + </modelFacet> + </labels> + </childNodes> + <childNodes + visualID="8007" + editPartClassName="DurationObservationEditPartCN" + itemSemanticEditPolicyClassName="DurationObservationItemSemanticEditPolicyCN" + canonicalEditPolicyClassName="DurationObservationCanonicalEditPolicyCN" + graphicalNodeEditPolicyClassName="DurationObservationGraphicalNodeEditPolicyCN" + createCommandClassName="DurationObservationCreateCommandCN" + containers="/0/@diagram/@compartments.0"> + <diagramRunTimeClass + href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> + <elementType + xsi:type="gmfgen:MetamodelType" + uniqueIdentifier="org.eclipse.papyrus.umldi.DurationObservation_Shape" + displayName="DurationObservation" + definedExternally="true" + editHelperClassName="DurationObservationEditHelper"/> + <viewmap + xsi:type="gmfgen:FigureViewmap" + figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure"> + <attributes + xsi:type="gmfgen:DefaultSizeAttributes" + width="20" + height="20"/> + </viewmap> + <behaviour + xsi:type="gmfgen:CustomBehaviour" + key="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY" + editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeIconlDisplayEditPolicy"/> + <behaviour + xsi:type="gmfgen:CustomBehaviour" + key="org.eclipse.papyrus.uml.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY" + editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy"/> + <behaviour + xsi:type="gmfgen:CustomBehaviour" + key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" + editPolicyQualifiedClassName="org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.GetChildLayoutEditPolicy"/> + <modelFacet> + <metaClass + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/DurationObservation"/> + <containmentMetaFeature + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/> + <childMetaFeature + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/> + <modelElementInitializer + xsi:type="gmfgen:GenFeatureSeqInitializer"> + <initializers + xsi:type="gmfgen:GenFeatureValueSpec" + value="/0/@expressionProviders/@providers.1/@expressions.5"> + <feature + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/> + </initializers> + </modelElementInitializer> + </modelFacet> + <labels + xsi:type="gmfgen:GenExternalNodeLabel" + visualID="5155" + editPartClassName="DurationObservationLabelEditPartCN" + itemSemanticEditPolicyClassName="DurationObservationLabelItemSemanticEditPolicyCN"> + <diagramRunTimeClass + href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> + <viewmap + xsi:type="gmfgen:FigureViewmap" + figureQualifiedClassName="org.eclipse.papyrus.infra.gmfdiag.common.figure.node.PapyrusWrappingLabel"> + <attributes + xsi:type="gmfgen:LabelOffsetAttributes" + x="25" + y="3"/> + </viewmap> + <modelFacet + xsi:type="gmfgen:FeatureLabelModelFacet" + parser="/0/@labelParsers/@implementations.0"> + <metaFeatures + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/> + </modelFacet> + </labels> + <labels + xsi:type="gmfgen:GenExternalNodeLabel" + visualID="5156" + editPartClassName="DurationObservationStereotypeLabelEditPartCN"> + <diagramRunTimeClass + href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> + <viewmap + xsi:type="gmfgen:FigureViewmap" + figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.AppliedStereotypeWrappingLabelFigure"> + <attributes + xsi:type="gmfgen:LabelOffsetAttributes" + x="25" + y="-10"/> + </viewmap> + <behaviour + xsi:type="gmfgen:CustomBehaviour" + key="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY" + editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeExternalNodeEditPolicy"/> + <modelFacet + xsi:type="gmfgen:FeatureLabelModelFacet" + parser="/0/@labelParsers/@implementations.2" + viewPattern="<<{0}>>" + editorPattern="<<{0}>>" + editPattern="<<{0}>>"> + <metaFeatures + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/> + </modelFacet> + </labels> + </childNodes> + <topLevelNodes + visualID="8002" + editPartClassName="InteractionEditPart" + itemSemanticEditPolicyClassName="InteractionItemSemanticEditPolicy" + canonicalEditPolicyClassName="InteractionCanonicalEditPolicy" + compartments="/0/@diagram/@compartments.0" + graphicalNodeEditPolicyClassName="InteractionGraphicalNodeEditPolicy" + createCommandClassName="InteractionCreateCommand"> + <diagramRunTimeClass + href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> + <elementType + xsi:type="gmfgen:MetamodelType" + uniqueIdentifier="org.eclipse.papyrus.umldi.Interaction_Shape" + displayName="Interaction" + definedExternally="true" + editHelperClassName="InteractionEditHelper"/> + <viewmap + xsi:type="gmfgen:FigureViewmap" + figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.communication.custom.figures.InteractionRectangleFigure"> + <attributes + xsi:type="gmfgen:DefaultSizeAttributes" + width="857" + height="757"/> + </viewmap> + <behaviour + xsi:type="gmfgen:CustomBehaviour" + key="org.eclipse.gef.EditPolicy.GRAPHICAL_NODE_ROLE" + editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.communication.custom.edit.policies.CommunicationGraphicalNodeEditPolicy"/> + <behaviour + xsi:type="gmfgen:CustomBehaviour" + key="org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.DRAG_DROP_ROLE" + editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.communication.custom.edit.policies.CustomDiagramDragDropEditPolicy"/> + <behaviour + xsi:type="gmfgen:CustomBehaviour" + key="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY" + editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy"/> + <behaviour + xsi:type="gmfgen:CustomBehaviour" + key="org.eclipse.papyrus.uml.diagram.common.editpolicies.ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY" + editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.ShowHideCompartmentEditPolicy"/> + <behaviour + xsi:type="gmfgen:CustomBehaviour" + key="org.eclipse.gef.EditPolicy.LAYOUT_ROLE" + editPolicyQualifiedClassName="org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.GetChildLayoutEditPolicy"/> + <modelFacet> + <metaClass + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Interaction"/> + <containmentMetaFeature + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/> + <childMetaFeature + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Component/packagedElement"/> + <modelElementInitializer + xsi:type="gmfgen:GenFeatureSeqInitializer"> + <initializers + xsi:type="gmfgen:GenFeatureValueSpec" + value="/0/@expressionProviders/@providers.1/@expressions.5"> + <feature + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/> + </initializers> + </modelElementInitializer> + </modelFacet> + <labels + visualID="5001" + elementIcon="true"> + <diagramRunTimeClass + href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> + <viewmap + xsi:type="gmfgen:ParentAssignedViewmap" + getterName="getNameLabel" + figureQualifiedClassName="org.eclipse.papyrus.infra.gmfdiag.common.figure.node.PapyrusWrappingLabel"/> + <modelFacet + xsi:type="gmfgen:FeatureLabelModelFacet" + parser="/0/@labelParsers/@implementations.0" + viewPattern="{0}" + editorPattern="{0}" + editPattern="{0}"> + <metaFeatures + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/> + </modelFacet> + </labels> + <labels + xsi:type="gmfgen:GenExternalNodeLabel" + visualID="6013" + editPartClassName="InteractionFloatingLabelEditPart" + itemSemanticEditPolicyClassName="InteractionFloatingLabelItemSemanticEditPolicy"> + <diagramRunTimeClass + href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> + <viewmap + xsi:type="gmfgen:FigureViewmap" + figureQualifiedClassName="org.eclipse.papyrus.infra.gmfdiag.common.figure.node.PapyrusWrappingLabel"> + <attributes + xsi:type="gmfgen:LabelOffsetAttributes" + x="50"/> + </viewmap> + <modelFacet + xsi:type="gmfgen:FeatureLabelModelFacet" + parser="/0/@labelParsers/@implementations.0" + viewPattern="" + editorPattern="" + editPattern=""> + <metaFeatures + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/> + </modelFacet> + </labels> + </topLevelNodes> + <links + visualID="8009" + editPartClassName="MessageEditPart" + itemSemanticEditPolicyClassName="MessageItemSemanticEditPolicy" + incomingCreationAllowed="true" + createCommandClassName="MessageCreateCommand" + reorientCommandClassName="MessageReorientCommand"> + <diagramRunTimeClass + href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/> + <elementType + xsi:type="gmfgen:MetamodelType" + uniqueIdentifier="org.eclipse.papyrus.uml.communication.Path_Edge" + displayName="Message" + definedExternally="true" + editHelperClassName="MessageEditHelper"/> + <viewmap + xsi:type="gmfgen:FigureViewmap" + figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.communication.custom.figures.MessageFigure"/> + <behaviour + xsi:type="gmfgen:CustomBehaviour" + key="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY" + editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy"/> + <modelFacet + xsi:type="gmfgen:TypeLinkModelFacet" + modelElementSelector="/0/@expressionProviders/@providers.0/@expressions.5"> + <metaClass + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Message"/> + <containmentMetaFeature + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Interaction/message"/> + <childMetaFeature + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Interaction/message"/> + <modelElementInitializer + xsi:type="gmfgen:GenFeatureSeqInitializer"> + <initializers + xsi:type="gmfgen:GenFeatureValueSpec" + value="/0/@expressionProviders/@providers.1/@expressions.5"> + <feature + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/> + </initializers> + </modelElementInitializer> + <sourceMetaFeature + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Element/owner"/> + <targetMetaFeature + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Element/ownedElement"/> + </modelFacet> + <labels + visualID="6001" + editPartClassName="MessageNameEditPart" + itemSemanticEditPolicyClassName="MessageNameItemSemanticEditPolicy" + elementIcon="true"> + <diagramRunTimeClass + href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> + <viewmap + xsi:type="gmfgen:ParentAssignedViewmap" + getterName="getFigureMessageCreateLabelFigure" + figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.communication.custom.figures.CustomWrappingLabel"> + <attributes + xsi:type="gmfgen:LabelOffsetAttributes" + x="1" + y="-23"/> + </viewmap> + <behaviour + xsi:type="gmfgen:CustomBehaviour" + key=""CustomDisplay"" + editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.communication.custom.edit.policies.MessageNameEditPolicy"/> + <modelFacet + xsi:type="gmfgen:FeatureLabelModelFacet" + parser="/0/@labelParsers/@implementations.0" + editorPattern="{0}" + editPattern="{0}"> + <metaFeatures + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/> + </modelFacet> + </labels> + <labels + visualID="6012" + editPartClassName="AppliedStereotypeMessageEditPart" + itemSemanticEditPolicyClassName="AppliedStereotypeMessageEditPolicy"> + <diagramRunTimeClass + href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> + <viewmap + xsi:type="gmfgen:ParentAssignedViewmap" + getterName="getAppliedStereotypeLabel" + figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.communication.custom.figures.CustomWrappingLabel"> + <attributes + xsi:type="gmfgen:LabelOffsetAttributes" + x="1" + y="-53"/> + </viewmap> + <modelFacet + xsi:type="gmfgen:FeatureLabelModelFacet" + parser="/0/@labelParsers/@implementations.2" + viewPattern="<<{0}>>" + editorPattern="<<{0}>>" + editPattern="<<{0}>>"> + <metaFeatures + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/> + </modelFacet> + </labels> + <creationConstraints + sourceEnd="/0/@expressionProviders/@providers.0/@expressions.3" + targetEnd="/0/@expressionProviders/@providers.0/@expressions.3"/> + </links> + <links + visualID="8010" + editPartClassName="CommentAnnotatedElementEditPart" + itemSemanticEditPolicyClassName="CommentAnnotatedElementItemSemanticEditPolicy" + createCommandClassName="CommentAnnotatedElementCreateCommand" + reorientCommandClassName="CommentAnnotatedElementReorientCommand"> + <diagramRunTimeClass + href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/> + <elementType + xsi:type="gmfgen:SpecializationType" + uniqueIdentifier="org.eclipse.papyrus.umldi.Comment_AnnotatedElementEdge" + definedExternally="true"/> + <viewmap + xsi:type="gmfgen:FigureViewmap" + figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.edge.SimpleDashedEdgeFigure"/> + <modelFacet + xsi:type="gmfgen:FeatureLinkModelFacet"> + <metaFeature + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Comment/annotatedElement"/> + </modelFacet> + </links> + <links + visualID="8011" + editPartClassName="ConstraintConstrainedElementEditPart" + itemSemanticEditPolicyClassName="ConstraintConstrainedElementItemSemanticEditPolicy" + createCommandClassName="ConstraintConstrainedElementCreateCommand" + reorientCommandClassName="ConstraintConstrainedElementReorientCommand"> + <diagramRunTimeClass + href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/> + <elementType + xsi:type="gmfgen:SpecializationType" + uniqueIdentifier="org.eclipse.papyrus.umldi.Constraint_ConstrainedElementEdge" + definedExternally="true"/> + <viewmap + xsi:type="gmfgen:FigureViewmap" + figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.edge.SimpleDashedEdgeFigure"/> + <modelFacet + xsi:type="gmfgen:FeatureLinkModelFacet"> + <metaFeature + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Constraint/constrainedElement"/> + </modelFacet> + </links> + <links + visualID="8012" + editPartClassName="ConnectorDurationObservationEditPart" + itemSemanticEditPolicyClassName="ConnectorDurationObservationItemSemanticEditPolicy" + createCommandClassName="ConnectorDurationObservationCreateCommand" + reorientCommandClassName="ConnectorDurationObservationReorientCommand"> + <diagramRunTimeClass + href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/> + <elementType + xsi:type="gmfgen:SpecializationType" + uniqueIdentifier="org.eclipse.papyrus.umldi.DurationObservation_EventEdge" + definedExternally="true"/> + <viewmap + xsi:type="gmfgen:FigureViewmap" + figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.edge.SimpleDashedEdgeFigure"/> + <modelFacet + xsi:type="gmfgen:FeatureLinkModelFacet"> + <metaFeature + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/DurationObservation/event"/> + </modelFacet> + </links> + <links + visualID="8013" + editPartClassName="ConnectorTimeObservationEditPart" + itemSemanticEditPolicyClassName="ConnectorTimeObservationItemSemanticEditPolicy" + createCommandClassName="ConnectorTimeObservationCreateCommand" + reorientCommandClassName="ConnectorTimeObservationReorientCommand"> + <diagramRunTimeClass + href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/> + <elementType + xsi:type="gmfgen:SpecializationType" + uniqueIdentifier="org.eclipse.papyrus.umldi.TimeObservation_EventEdge" + definedExternally="true"/> + <viewmap + xsi:type="gmfgen:FigureViewmap" + figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.edge.SimpleDashedEdgeFigure"/> + <modelFacet + xsi:type="gmfgen:FeatureLinkModelFacet"> + <metaFeature + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/TimeObservation/event"/> + </modelFacet> + </links> + <compartments + visualID="7001" + editPartClassName="InteractionCompartmentEditPart" + itemSemanticEditPolicyClassName="InteractionCompartmentItemSemanticEditPolicy" + canonicalEditPolicyClassName="InteractionCompartmentCanonicalEditPolicy" + childNodes="/0/@diagram/@childNodes.0 /0/@diagram/@childNodes.2 /0/@diagram/@childNodes.1 /0/@diagram/@childNodes.3 /0/@diagram/@childNodes.4" + title="InteractionCompartment" + needsTitle="false" + node="/0/@diagram/@topLevelNodes.0" + listLayout="false"> + <diagramRunTimeClass + href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> + <viewmap + xsi:type="gmfgen:ParentAssignedViewmap" + getterName="getCompartmentFigure" + figureQualifiedClassName="org.eclipse.draw2d.RectangleFigure"/> + <behaviour + xsi:type="gmfgen:CustomBehaviour" + key=""RemoveOrphanView"" + editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.OrphanViewPolicy"/> + <behaviour + xsi:type="gmfgen:CustomBehaviour" + key="org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.DRAG_DROP_ROLE" + editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.communication.custom.edit.policies.CustomDiagramDragDropEditPolicy"/> + <behaviour + xsi:type="gmfgen:CustomBehaviour" + key="org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.BorderDisplayEditPolicy.BORDER_DISPLAY_EDITPOLICY" + editPolicyQualifiedClassName="org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.BorderDisplayEditPolicy"/> + </compartments> + <palette + factoryClassName="UMLPaletteFactory"> + <groups + title="Nodes" + description="Nodes" + largeIconPath="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif" + smallIconPath="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif" + id=""communication.group.nodes"" + collapse="true"> + <entries + xsi:type="gmfgen:ToolEntry" + title="Lifeline" + description="Create a Lifeline" + largeIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Lifeline.gif" + smallIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Lifeline.gif" + createMethodName="createLifelineComCreationTool" + id=""communication.tool.lifeline"" + genNodes="/0/@diagram/@childNodes.0"/> + <entries + xsi:type="gmfgen:ToolEntry" + title="Comment" + description="Create new Comment" + largeIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Comment.gif" + smallIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Comment.gif" + createMethodName="createComment7CreationTool" + id=""communication.tool.comment"" + genNodes="/0/@diagram/@childNodes.2"/> + <entries + xsi:type="gmfgen:ToolEntry" + title="Constraint" + description="Create a constraint" + largeIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Constraint.gif" + smallIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Constraint.gif" + createMethodName="createConstraint5CreationTool" + id=""communication.tool.constraint"" + genNodes="/0/@diagram/@childNodes.1"/> + <entries + xsi:type="gmfgen:ToolEntry" + title="Duration Observation" + description="Create a Duration Observation on a Message" + largeIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/DurationObservation.gif" + smallIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/DurationObservation.gif" + createMethodName="createDurationObservation4CreationTool" + id=""communication.tool.durationobservation"" + genNodes="/0/@diagram/@childNodes.4"/> + <entries + xsi:type="gmfgen:ToolEntry" + title="Time Observation" + description="Create a Time Observation" + largeIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/TimeObservation.gif" + smallIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/TimeObservation.gif" + createMethodName="createTimeObservation6CreationTool" + id=""communication.tool.timeobservation"" + qualifiedToolName="" + genNodes="/0/@diagram/@childNodes.3"/> + </groups> + <groups + title="Edges" + description="Edges tools" + largeIconPath="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif" + smallIconPath="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif" + createMethodName="createEdges2Group" + collapse="true"> + <entries + xsi:type="gmfgen:ToolEntry" + title="Message" + description="MessageCreate" + largeIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Message_createMessage.gif" + smallIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Message_createMessage.gif" + createMethodName="createMessageCreateCreationTool" + qualifiedToolName="" + genLinks="/0/@diagram/@links.0"/> + <entries + xsi:type="gmfgen:ToolEntry" + title="Link" + description="Creation of a link for comment, constraint, TimeObservation, DurationObservation" + largeIconPath="icons/obj16/Link.gif" + smallIconPath="icons/obj16/Link.gif" + createMethodName="createLink13CreationTool" + genLinks="/0/@diagram/@links.1 /0/@diagram/@links.2 /0/@diagram/@links.3 /0/@diagram/@links.4"/> + </groups> + </palette> + <preferencePages + xsi:type="gmfgen:GenStandardPreferencePage" + iD="org.eclipse.uml2.uml.diagram.general" + name="UML Diagram"> + <children + xsi:type="gmfgen:GenStandardPreferencePage" + iD="org.eclipse.uml2.uml.diagram.appearance" + name="Appearance" + kind="Appearance" + className="DiagramAppearancePreferencePage"/> + <children + xsi:type="gmfgen:GenStandardPreferencePage" + iD="org.eclipse.uml2.uml.diagram.connections" + name="Connections" + kind="Connections" + className="DiagramConnectionsPreferencePage"/> + <children + xsi:type="gmfgen:GenStandardPreferencePage" + iD="org.eclipse.uml2.uml.diagram.printing" + name="Printing" + kind="Printing" + className="DiagramPrintingPreferencePage"/> + </preferencePages> + </diagram> + <plugin + iD="org.eclipse.papyrus.uml.diagram.communication" + name="org.eclipse.papyrus.uml.diagram.communication" + version="3.0.0.qualifier"> + <requiredPlugins>org.eclipse.draw2d</requiredPlugins> + <requiredPlugins>org.eclipse.papyrus.uml.diagram.common</requiredPlugins> + <requiredPlugins>org.eclipse.gmf.runtime.draw2d.ui</requiredPlugins> + </plugin> + <editor/> + <navigator/> + <diagramUpdater/> + <domainGenModel + href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#/"/> + <expressionProviders> + <providers + xsi:type="gmfgen:GenExpressionInterpreter"> + <expressions + body="let base : String = 'Lifeline' in
let suffixes : Sequence(String) = Sequence {'', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'} in 
let space : Namespace = self.namespace in
let allMissed : Sequence(String) = suffixes->
 select(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s))
 ) in
let firstMissed : String = allMissed->first() in 
let noMisses : Boolean = firstMissed.oclIsUndefined() in
let allNames : Set(String) = 
 if noMisses 
 then 
 space.member->collect(e : NamedElement | 
 if e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base
 then '' 
 else e.name 
 endif)->asSet()->excluding('') else Set{'not in use'} 
 endif in 
let longestName : String = 
 if noMisses
 then allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first() 
 else 'not in use' 
 endif in 
if noMisses then 
 if longestName.oclIsUndefined() 
 then base 
 else longestName.concat('1') 
 endif 
else 
 base.concat(firstMissed) 
endif "/> + <expressions + body="let base : String = 'Interaction' in
let suffixes : Sequence(String) = Sequence {'', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'} in 
let space : Namespace = self.namespace in
let allMissed : Sequence(String) = suffixes->
 select(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s))
 ) in
let firstMissed : String = allMissed->first() in 
let noMisses : Boolean = firstMissed.oclIsUndefined() in
let allNames : Set(String) = 
 if noMisses 
 then 
 space.member->collect(e : NamedElement | 
 if e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base
 then '' 
 else e.name 
 endif)->asSet()->excluding('') else Set{'not in use'} 
 endif in 
let longestName : String = 
 if noMisses
 then allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first() 
 else 'not in use' 
 endif in 
if noMisses then 
 if longestName.oclIsUndefined() 
 then base 
 else longestName.concat('1') 
 endif 
else 
 base.concat(firstMissed) 
endif "/> + <expressions + body="self.messageSort=MessageSort::createMessage and self.sendEvent<>null and self.receiveEvent<>null"/> + <expressions + xsi:type="gmfgen:GenConstraint" + body="self.oclIsKindOf(uml::Lifeline)"/> + <expressions + xsi:type="gmfgen:GenConstraint" + body="self.oclIsKindOf(uml::InteractionFragment) or self.oclIsKindOf(uml::Lifeline)"/> + <expressions + xsi:type="gmfgen:GenConstraint" + body="self.sendEvent<>null and self.receiveEvent<>null"/> + <expressions + body="'OpaqueExpression'"/> + <expressions + body="' '"/> + </providers> + <providers + xsi:type="gmfgen:GenJavaExpressionProvider" + injectExpressionBody="true"> + <expressions + body="return self.getBody();"/> + <expressions + body="return getName(self);"/> + <expressions + body="return getNamedElement(self, "", "t", "");"/> + <expressions + body="return getNamedElement(self, "", self.eClass().getName(), "");"/> + <expressions + body="return getNamedElement(self, "", "d", "");"/> + <expressions + body="return org.eclipse.papyrus.uml.tools.utils.NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());"/> + <expressions + body="org.eclipse.uml2.uml.LiteralString literalString=org.eclipse.uml2.uml.UMLFactory.eINSTANCE.createLiteralString();
literalString.setValue("");
return literalString;"/> + </providers> + <providers + xsi:type="gmfgen:GenLiteralExpressionProvider"> + <expressions + body="0"/> + <expressions + body="1"/> + </providers> + </expressionProviders> + <labelParsers + extensibleViaService="true"> + <implementations + xsi:type="gmfgen:PredefinedParser" + uses="/0/@diagram/@topLevelNodes.0/@labels.0/@modelFacet /0/@diagram/@childNodes.1/@labels.0/@modelFacet /0/@diagram/@childNodes.4/@labels.0/@modelFacet /0/@diagram/@childNodes.3/@labels.0/@modelFacet /0/@diagram/@links.0/@labels.0/@modelFacet /0/@diagram/@topLevelNodes.0/@labels.1/@modelFacet /0/@diagram/@childNodes.0/@labels.1/@modelFacet" + className="MessageFormatParser"/> + <implementations + xsi:type="gmfgen:CustomParser" + uses="/0/@diagram/@childNodes.2/@labels.0/@modelFacet" + qualifiedName="org.eclipse.papyrus.uml.diagram.common.parser.CommentParser"/> + <implementations + xsi:type="gmfgen:CustomParser" + uses="/0/@diagram/@childNodes.3/@labels.1/@modelFacet /0/@diagram/@childNodes.4/@labels.1/@modelFacet /0/@diagram/@links.0/@labels.1/@modelFacet" + qualifiedName="org.eclipse.papyrus.uml.diagram.common.parser.stereotype.AppliedStereotypeParser"/> + <implementations + xsi:type="gmfgen:CustomParser" + uses="/0/@diagram/@childNodes.1/@labels.1/@modelFacet" + qualifiedName="org.eclipse.papyrus.uml.diagram.common.parser.ConstraintParser"/> + <implementations + xsi:type="gmfgen:CustomParser" + uses="/0/@diagram/@childNodes.0/@labels.0/@modelFacet" + qualifiedName="org.eclipse.papyrus.uml.diagram.communication.custom.parser.LifelineCustomParsers"/> + </labelParsers> + <extensions + name="Custom templates" + rootInput="PapyrusUMLCommunicationDiagram"> + <invocations + xsi:type="gmfgen:GenTemplateInvocation" + description="VisualTypeProvider" + templateFqn="aspects::xpt::providers::VisualTypeProvider::VisualTypeProvider" + inputs="/0/@extensions.0" + oclExpression="self.diagram"/> + </extensions> + </gmfgen:GenEditorGenerator> + <papyrusgmfgenextension:PapyrusExtensionRootNode + comment="Papyrus specific extension for GMFGen"> + <extensionNodes + xsi:type="papyrusgmfgenextension:SpecificLocatorExternalLabel" + comment="External node label locator" + classpath="org.eclipse.papyrus.uml.diagram.common.locator.ExternalLabelPositionLocator" + genExternalNodeLabel="/0/@diagram/@childNodes.3/@labels.1 /0/@diagram/@childNodes.4/@labels.1"/> + <extensionNodes + xsi:type="papyrusgmfgenextension:ExtendedGenView" + comment="adding to manange otherNamedElement" + genView="/0/@diagram" + name="OtherNamedElementEditPart" + superOwnedEditPart="org.eclipse.papyrus.uml.diagram.common.editparts.NamedElementEditPart"/> + <extensionNodes + xsi:type="papyrusgmfgenextension:ExtendedGenView" + comment="this is an extension to manage the comment" + genView="/0/@diagram/@childNodes.2" + name="comment extended node" + superOwnedEditPart="org.eclipse.papyrus.uml.diagram.common.editparts.AbstractCommentEditPart"/> + <extensionNodes + xsi:type="papyrusgmfgenextension:ExtendedGenView" + comment="this is an extension for constraint " + genView="/0/@diagram/@childNodes.1" + name="ConstraintEditPart extension" + superOwnedEditPart="org.eclipse.papyrus.uml.diagram.common.editparts.AbstractConstraintEditPart"/> + <extensionNodes + xsi:type="papyrusgmfgenextension:SpecificDiagramUpdater" + comment="InteractionCompartment custom DiagramUpdater" + classpath="org.eclipse.papyrus.uml.diagram.communication.custom.parts.InteractionCompartmentDiagramUpdater" + genNode="/0/@diagram/@compartments.0"/> + <extensionNodes + xsi:type="papyrusgmfgenextension:ExtendedGenView" + comment="add superclass for floating Label" + genView="/0/@diagram/@topLevelNodes.0/@labels.1 /0/@diagram/@childNodes.4/@labels.0 /0/@diagram/@childNodes.3/@labels.0 /0/@diagram/@childNodes.0/@labels.1" + name="FloatingLabelEditPart" + superOwnedEditPart="org.eclipse.papyrus.uml.diagram.common.editparts.FloatingLabelEditPart"/> + <extensionNodes + xsi:type="papyrusgmfgenextension:SpecificLocatorExternalLabel" + comment="Locator for external Floating label of RoundedCompartment EP" + classpath="org.eclipse.papyrus.uml.diagram.common.locator.RoundedRectangleLabelPositionLocator" + genExternalNodeLabel="/0/@diagram/@topLevelNodes.0/@labels.1 /0/@diagram/@childNodes.3/@labels.0 /0/@diagram/@childNodes.4/@labels.0 /0/@diagram/@childNodes.0/@labels.1"/> + <extensionNodes + xsi:type="papyrusgmfgenextension:ExtendedGenView" + comment="Rounded Compartment EditPart" + genView="/0/@diagram/@childNodes.3 /0/@diagram/@childNodes.4 /0/@diagram/@childNodes.0 /0/@diagram/@topLevelNodes.0" + name="RoundedCompartmentEditPart" + superOwnedEditPart="org.eclipse.papyrus.uml.diagram.common.editparts.RoundedCompartmentEditPart"/> + <extensionNodes + xsi:type="papyrusgmfgenextension:ExtendedGenView" + comment="Label in charge to display applied stereotypes on links" + genView="/0/@diagram/@links.2 /0/@diagram/@links.1" + name="UMLConnectionNodeEditPart" + superOwnedEditPart="org.eclipse.papyrus.uml.diagram.common.editparts.UMLConnectionNodeEditPart"/> + </papyrusgmfgenextension:PapyrusExtensionRootNode> + <papyrusgmfgenextension:VisualIDOverride + genView="/0/@diagram" + visualID="Package_CommunicationDiagram"> + <child + genView="/0/@diagram/@childNodes.0" + visualID="Lifeline_Shape"> + <child + genView="/0/@diagram/@childNodes.0/@labels.0" + visualID="Lifeline_NameLabel"/> + <child + genView="/0/@diagram/@childNodes.0/@labels.1" + visualID="Lifeline_FloatingNameLabel"/> + </child> + <child + genView="/0/@diagram/@childNodes.1" + visualID="Constraint_Shape"> + <child + genView="/0/@diagram/@childNodes.1/@labels.0" + visualID="Constraint_NameLabel"/> + <child + genView="/0/@diagram/@childNodes.1/@labels.1" + visualID="Constraint_BodyLabel"/> + </child> + <child + genView="/0/@diagram/@childNodes.2" + visualID="Comment_Shape"> + <child + genView="/0/@diagram/@childNodes.2/@labels.0" + visualID="Comment_BodyLabel"/> + </child> + <child + genView="/0/@diagram/@childNodes.3" + visualID="TimeObservation_Shape"> + <child + genView="/0/@diagram/@childNodes.3/@labels.0" + visualID="TimeObservation_NameLabel"/> + <child + genView="/0/@diagram/@childNodes.3/@labels.1" + visualID="TimeObservation_StereotypeLabel"/> + </child> + <child + genView="/0/@diagram/@childNodes.4" + visualID="DurationObservation_Shape"> + <child + genView="/0/@diagram/@childNodes.4/@labels.0" + visualID="DurationObservation_NameLabel"/> + <child + genView="/0/@diagram/@childNodes.4/@labels.1" + visualID="DurationObservation_StereotypeLabel"/> + </child> + <child + genView="/0/@diagram/@compartments.0" + visualID="Interaction_SubfragmentCompartment"/> + <child + genView="/0/@diagram/@topLevelNodes.0" + visualID="Interaction_Shape"> + <child + genView="/0/@diagram/@topLevelNodes.0/@labels.0" + visualID="Interaction_NameLabel"/> + <child + genView="/0/@diagram/@topLevelNodes.0/@labels.1" + visualID="Interaction_FloatingNameLabel"/> + </child> + <child + genView="/0/@diagram/@links.0" + visualID="Path_Edge"> + <child + genView="/0/@diagram/@links.0/@labels.0" + visualID="Path_MessageLabel"/> + <child + genView="/0/@diagram/@links.0/@labels.1" + visualID="Path_StereotypeLabel"/> + </child> + <child + genView="/0/@diagram/@links.1" + visualID="Comment_AnnotatedElementEdge"/> + <child + genView="/0/@diagram/@links.2" + visualID="Constraint_ConstrainedElementEdge"/> + <child + genView="/0/@diagram/@links.3" + visualID="DurationObservation_EventEdge"/> + <child + genView="/0/@diagram/@links.4" + visualID="TimeObservation_EventEdge"/> + </papyrusgmfgenextension:VisualIDOverride> +</xmi:XMI> diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/plugin.xml b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/plugin.xml index 0a75673c088..e39e7e87fc8 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/plugin.xml +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/plugin.xml @@ -44,205 +44,204 @@ </extension> -<extension point="org.eclipse.gmf.runtime.common.ui.services.markerNavigationProviders" id="markers-navigation">
- <?gmfgen generated="true"?>
- <MarkerNavigationProvider class="org.eclipse.papyrus.uml.diagram.communication.providers.UMLMarkerNavigationProvider">
- <MarkerType name="org.eclipse.papyrus.uml.diagram.communication.diagnostic"/>
- <Priority name="Lowest"/>
- </MarkerNavigationProvider>
- </extension>
+<extension point="org.eclipse.gmf.runtime.common.ui.services.markerNavigationProviders" id="markers-navigation"> + <?gmfgen generated="true"?> + <MarkerNavigationProvider class="org.eclipse.papyrus.uml.diagram.communication.providers.UMLMarkerNavigationProvider"> + <MarkerType name="org.eclipse.papyrus.uml.diagram.communication.diagnostic"/> + <Priority name="Lowest"/> + </MarkerNavigationProvider> + </extension> -<extension id="diagnostic" name="org.eclipse.papyrus.uml.diagram.communication problems" point="org.eclipse.core.resources.markers">
- <?gmfgen generated="true"?>
- <super type="org.eclipse.core.resources.problemmarker"/>
- <super type="org.eclipse.gmf.runtime.common.ui.services.marker"/>
- <persistent value="true"/>
- </extension>
+<extension id="diagnostic" name="org.eclipse.papyrus.uml.diagram.communication problems" point="org.eclipse.core.resources.markers"> + <?gmfgen generated="true"?> + <super type="org.eclipse.core.resources.problemmarker"/> + <super type="org.eclipse.gmf.runtime.common.ui.services.marker"/> + <persistent value="true"/> + </extension> +<extension point="org.eclipse.ui.preferencePages" id="prefpages"> + <?gmfgen generated="true"?> + <page + id="org.eclipse.papyrus.infra.gmfdiag.preferences.diagrams.PapyrusUMLCommunicationDiagram" + name="PapyrusUMLCommunicationDiagram Diagram" + category="org.eclipse.papyrus.infra.gmfdiag.preferences.diagrams" + class="org.eclipse.papyrus.uml.diagram.communication.preferences.DiagramGeneralPreferencePage"> + </page> + <page + id="org.eclipse.papyrus.uml.diagram.communication.preferences.DiagramPrintingPreferencePage" + name="%prefpage.org.eclipse.uml2.uml.diagram.printing" + category="org.eclipse.papyrus.infra.gmfdiag.preferences.diagrams.PapyrusUMLCommunicationDiagram" + class="org.eclipse.papyrus.uml.diagram.communication.preferences.DiagramPrintingPreferencePage"> + </page> + </extension> -<extension point="org.eclipse.ui.preferencePages" id="prefpages">
- <?gmfgen generated="true"?>
- <page
- id="org.eclipse.papyrus.infra.gmfdiag.preferences.diagrams.PapyrusUMLCommunicationDiagram"
- name="PapyrusUMLCommunicationDiagram Diagram"
- category="org.eclipse.papyrus.infra.gmfdiag.preferences.diagrams"
- class="org.eclipse.papyrus.uml.diagram.communication.preferences.DiagramGeneralPreferencePage">
- </page>
- <page
- id="org.eclipse.papyrus.uml.diagram.communication.preferences.DiagramPrintingPreferencePage"
- name="%prefpage.org.eclipse.uml2.uml.diagram.printing"
- category="org.eclipse.papyrus.infra.gmfdiag.preferences.diagrams.PapyrusUMLCommunicationDiagram"
- class="org.eclipse.papyrus.uml.diagram.communication.preferences.DiagramPrintingPreferencePage">
- </page>
- </extension>
+<extension point="org.eclipse.core.runtime.preferences" id="prefs"> + <?gmfgen generated="true"?> + <initializer class="org.eclipse.papyrus.uml.diagram.communication.preferences.DiagramPreferenceInitializer"/> + </extension> -<extension point="org.eclipse.core.runtime.preferences" id="prefs">
- <?gmfgen generated="true"?>
- <initializer class="org.eclipse.papyrus.uml.diagram.communication.preferences.DiagramPreferenceInitializer"/>
- </extension>
+<extension point="org.eclipse.gmf.runtime.diagram.core.viewProviders" id="view-provider"> + <?gmfgen generated="true"?> + <viewProvider class="org.eclipse.papyrus.uml.diagram.communication.providers.UMLViewProvider"> + <Priority name="Lowest"/> + <context viewClass="org.eclipse.gmf.runtime.notation.Diagram" semanticHints="PapyrusUMLCommunicationDiagram"/> + <context viewClass="org.eclipse.gmf.runtime.notation.Node" semanticHints="Interaction_Shape,Lifeline_Shape,Constraint_Shape,Comment_Shape,TimeObservation_Shape,DurationObservation_Shape"/> + <context viewClass="org.eclipse.gmf.runtime.notation.Edge" semanticHints="Path_Edge,Comment_AnnotatedElementEdge,Constraint_ConstrainedElementEdge,DurationObservation_EventEdge,TimeObservation_EventEdge"/> + </viewProvider> + </extension> -<extension point="org.eclipse.gmf.runtime.diagram.core.viewProviders" id="view-provider">
- <?gmfgen generated="true"?>
- <viewProvider class="org.eclipse.papyrus.uml.diagram.communication.providers.UMLViewProvider">
- <Priority name="Lowest"/>
- <context viewClass="org.eclipse.gmf.runtime.notation.Diagram" semanticHints="PapyrusUMLCommunicationDiagram"/>
- <context viewClass="org.eclipse.gmf.runtime.notation.Node" semanticHints="Interaction_Shape,Lifeline_Shape,Constraint_Shape,Comment_Shape,TimeObservation_Shape,DurationObservation_Shape"/>
- <context viewClass="org.eclipse.gmf.runtime.notation.Edge" semanticHints="Path_Edge,Comment_AnnotatedElementEdge,Constraint_ConstrainedElementEdge,DurationObservation_EventEdge,TimeObservation_EventEdge"/>
- </viewProvider>
- </extension>
+<extension point="org.eclipse.gmf.runtime.diagram.ui.editpartProviders" id="ep-provider"> + <?gmfgen generated="true"?> + <editpartProvider class="org.eclipse.papyrus.uml.diagram.communication.providers.UMLEditPartProvider"> + <Priority name="Lowest"/> + <object class="org.eclipse.gmf.runtime.notation.Diagram" id="generated-diagram"> + <method name="getType()" value="PapyrusUMLCommunicationDiagram"/> + </object> + <object class="org.eclipse.gmf.runtime.notation.Node" id="generated-nodes"> + <method name="getType()" value="Interaction_Shape,Lifeline_Shape,Constraint_Shape,Comment_Shape,TimeObservation_Shape,DurationObservation_Shape"/> + </object> + <object class="org.eclipse.gmf.runtime.notation.Edge" id="generated-links"> + <method name="getType()" value="Path_Edge,Comment_AnnotatedElementEdge,Constraint_ConstrainedElementEdge,DurationObservation_EventEdge,TimeObservation_EventEdge"/> + </object> + <object class="org.eclipse.gmf.runtime.notation.Node" id="generated-labels"> + <method name="getType()" value="Interaction_NameLabel,Interaction_FloatingNameLabel,Lifeline_NameLabel,Lifeline_FloatingNameLabel,Constraint_NameLabel,Constraint_BodyLabel,Comment_BodyLabel,TimeObservation_NameLabel,TimeObservation_StereotypeLabel,DurationObservation_NameLabel,DurationObservation_StereotypeLabel"/> + </object> + <object class="org.eclipse.gmf.runtime.notation.Node" id="generated-compartments"> + <method name="getType()" value="Interaction_SubfragmentCompartment"/> + </object> + <context views="generated-diagram,generated-nodes,generated-links,generated-labels,generated-compartments"/> + </editpartProvider> + </extension> -<extension point="org.eclipse.gmf.runtime.diagram.ui.editpartProviders" id="ep-provider">
- <?gmfgen generated="true"?>
- <editpartProvider class="org.eclipse.papyrus.uml.diagram.communication.providers.UMLEditPartProvider">
- <Priority name="Lowest"/>
- <object class="org.eclipse.gmf.runtime.notation.Diagram" id="generated-diagram">
- <method name="getType()" value="PapyrusUMLCommunicationDiagram"/>
- </object>
- <object class="org.eclipse.gmf.runtime.notation.Node" id="generated-nodes">
- <method name="getType()" value="Interaction_Shape,Lifeline_Shape,Constraint_Shape,Comment_Shape,TimeObservation_Shape,DurationObservation_Shape"/>
- </object>
- <object class="org.eclipse.gmf.runtime.notation.Edge" id="generated-links">
- <method name="getType()" value="Path_Edge,Comment_AnnotatedElementEdge,Constraint_ConstrainedElementEdge,DurationObservation_EventEdge,TimeObservation_EventEdge"/>
- </object>
- <object class="org.eclipse.gmf.runtime.notation.Node" id="generated-labels">
- <method name="getType()" value="Interaction_NameLabel,Interaction_FloatingNameLabel,Lifeline_NameLabel,Lifeline_FloatingNameLabel,Constraint_NameLabel,Constraint_BodyLabel,Comment_BodyLabel,TimeObservation_NameLabel,TimeObservation_StereotypeLabel,DurationObservation_NameLabel,DurationObservation_StereotypeLabel"/>
- </object>
- <object class="org.eclipse.gmf.runtime.notation.Node" id="generated-compartments">
- <method name="getType()" value="Interaction_SubfragmentCompartment"/>
- </object>
- <context views="generated-diagram,generated-nodes,generated-links,generated-labels,generated-compartments"/>
- </editpartProvider>
- </extension>
+<extension point="org.eclipse.gmf.runtime.common.ui.services.iconProviders" id="icon-provider"> + <?gmfgen generated="true"?> + <IconProvider class="org.eclipse.papyrus.uml.diagram.communication.providers.UMLIconProvider"> + <Priority name="Lowest"/> + </IconProvider> + </extension> -<extension point="org.eclipse.gmf.runtime.common.ui.services.iconProviders" id="icon-provider">
- <?gmfgen generated="true"?>
- <IconProvider class="org.eclipse.papyrus.uml.diagram.communication.providers.UMLIconProvider">
- <Priority name="Lowest"/>
- </IconProvider>
- </extension>
- -<extension point="org.eclipse.gmf.runtime.common.ui.services.parserProviders" id="parser-provider">
- <?gmfgen generated="true"?>
- <ParserProvider class="org.eclipse.papyrus.uml.diagram.communication.providers.UMLParserProvider">
- <Priority name="Lowest"/>
- </ParserProvider>
- </extension>
+<extension point="org.eclipse.gmf.runtime.common.ui.services.parserProviders" id="parser-provider"> + <?gmfgen generated="true"?> + <ParserProvider class="org.eclipse.papyrus.uml.diagram.communication.providers.UMLParserProvider"> + <Priority name="Lowest"/> + </ParserProvider> + </extension> -<extension point="org.eclipse.core.expressions.propertyTesters" id="navigator-proptest.isURIEditorInput">
- <?gmfgen generated="true"?>
- <propertyTester
- id="org.eclipse.papyrus.uml.diagram.communication.URIEditorInputPropertyTester"
- type="org.eclipse.emf.common.ui.URIEditorInput"
- namespace="org.eclipse.papyrus.uml.diagram.communication"
- properties="isURIEditorInput"
- class="org.eclipse.papyrus.uml.diagram.communication.part.UMLUriEditorInputTester">
- </propertyTester>
- </extension>
+<extension point="org.eclipse.core.expressions.propertyTesters" id="navigator-proptest.isURIEditorInput"> + <?gmfgen generated="true"?> + <propertyTester + id="org.eclipse.papyrus.uml.diagram.communication.URIEditorInputPropertyTester" + type="org.eclipse.emf.common.ui.URIEditorInput" + namespace="org.eclipse.papyrus.uml.diagram.communication" + properties="isURIEditorInput" + class="org.eclipse.papyrus.uml.diagram.communication.part.UMLUriEditorInputTester"> + </propertyTester> + </extension> -<extension point="org.eclipse.ui.navigator.viewer" id="navigator-viewbinding">
- <?gmfgen generated="true"?>
- <viewerContentBinding viewerId="org.eclipse.ui.navigator.ProjectExplorer">
- <includes>
- <contentExtension pattern="org.eclipse.papyrus.uml.diagram.communication.resourceContent"/>
- <contentExtension pattern="org.eclipse.papyrus.uml.diagram.communication.domainResourceContent"/>
- <contentExtension pattern="org.eclipse.papyrus.uml.diagram.communication.navigatorLinkHelper"/>
- </includes>
- </viewerContentBinding>
- <viewerActionBinding viewerId="org.eclipse.ui.navigator.ProjectExplorer">
- <includes>
- <actionExtension pattern="org.eclipse.papyrus.uml.diagram.communication.navigatorActionProvider"/>
- </includes>
- </viewerActionBinding>
- </extension>
+<extension point="org.eclipse.ui.navigator.viewer" id="navigator-viewbinding"> + <?gmfgen generated="true"?> + <viewerContentBinding viewerId="org.eclipse.ui.navigator.ProjectExplorer"> + <includes> + <contentExtension pattern="org.eclipse.papyrus.uml.diagram.communication.resourceContent"/> + <contentExtension pattern="org.eclipse.papyrus.uml.diagram.communication.domainResourceContent"/> + <contentExtension pattern="org.eclipse.papyrus.uml.diagram.communication.navigatorLinkHelper"/> + </includes> + </viewerContentBinding> + <viewerActionBinding viewerId="org.eclipse.ui.navigator.ProjectExplorer"> + <includes> + <actionExtension pattern="org.eclipse.papyrus.uml.diagram.communication.navigatorActionProvider"/> + </includes> + </viewerActionBinding> + </extension> -<extension point="org.eclipse.ui.navigator.navigatorContent" id="navigator-content">
- <?gmfgen generated="true"?>
- <navigatorContent
- id="org.eclipse.papyrus.uml.diagram.communication.resourceContent"
- name="%navigatorContentName"
- priority="normal"
- contentProvider="org.eclipse.papyrus.uml.diagram.communication.navigator.UMLNavigatorContentProvider"
- labelProvider="org.eclipse.papyrus.uml.diagram.communication.navigator.UMLNavigatorLabelProvider"
- icon="icons/obj16/UMLDiagramFile.gif"
- activeByDefault="true">
- <triggerPoints>
- <or>
- <and>
- <instanceof value="org.eclipse.core.resources.IFile"/>
- <test property="org.eclipse.core.resources.extension" value="PapyrusUMLCommunication_diagram"/>
- </and>
- <instanceof value="org.eclipse.papyrus.uml.diagram.communication.navigator.UMLAbstractNavigatorItem"/>
- </or>
- </triggerPoints>
- <possibleChildren>
- <or>
- <instanceof value="org.eclipse.papyrus.uml.diagram.communication.navigator.UMLAbstractNavigatorItem"/>
- </or>
- </possibleChildren>
- <commonSorter
- id="org.eclipse.papyrus.uml.diagram.communication.navigatorSorter"
- class="org.eclipse.papyrus.uml.diagram.communication.navigator.UMLNavigatorSorter">
- <parentExpression>
- <or>
- <and>
- <instanceof value="org.eclipse.core.resources.IFile"/>
- <test property="org.eclipse.core.resources.extension" value="PapyrusUMLCommunication_diagram"/>
- </and>
- <instanceof value="org.eclipse.papyrus.uml.diagram.communication.navigator.UMLAbstractNavigatorItem"/>
- </or>
- </parentExpression>
- </commonSorter>
- </navigatorContent>
- <navigatorContent
- id="org.eclipse.papyrus.uml.diagram.communication.domainResourceContent"
- name="%domainNavigatorContentName"
- priority="normal"
- contentProvider="org.eclipse.papyrus.uml.diagram.communication.navigator.UMLDomainNavigatorContentProvider"
- labelProvider="org.eclipse.papyrus.uml.diagram.communication.navigator.UMLDomainNavigatorLabelProvider"
- icon="icons/obj16/UMLDiagramFile.gif"
- activeByDefault="true">
- <triggerPoints>
- <or>
- <and>
- <instanceof value="org.eclipse.core.resources.IFile"/>
- <test property="org.eclipse.core.resources.extension" value="PapyrusUMLCommunication"/>
- </and>
- <instanceof value="org.eclipse.papyrus.uml.diagram.communication.navigator.UMLDomainNavigatorItem"/>
- </or>
- </triggerPoints>
- <possibleChildren>
- <instanceof value="org.eclipse.papyrus.uml.diagram.communication.navigator.UMLDomainNavigatorItem"/>
- </possibleChildren>
- </navigatorContent>
- <actionProvider
- id="org.eclipse.papyrus.uml.diagram.communication.navigatorActionProvider"
- class="org.eclipse.papyrus.uml.diagram.communication.navigator.UMLNavigatorActionProvider">
- <enablement>
- <or>
- <instanceof value="org.eclipse.papyrus.uml.diagram.communication.navigator.UMLAbstractNavigatorItem"/>
- </or>
- </enablement>
- </actionProvider>
- </extension>
+<extension point="org.eclipse.ui.navigator.navigatorContent" id="navigator-content"> + <?gmfgen generated="true"?> + <navigatorContent + id="org.eclipse.papyrus.uml.diagram.communication.resourceContent" + name="%navigatorContentName" + priority="normal" + contentProvider="org.eclipse.papyrus.uml.diagram.communication.navigator.UMLNavigatorContentProvider" + labelProvider="org.eclipse.papyrus.uml.diagram.communication.navigator.UMLNavigatorLabelProvider" + icon="icons/obj16/UMLDiagramFile.gif" + activeByDefault="true"> + <triggerPoints> + <or> + <and> + <instanceof value="org.eclipse.core.resources.IFile"/> + <test property="org.eclipse.core.resources.extension" value="PapyrusUMLCommunication_diagram"/> + </and> + <instanceof value="org.eclipse.papyrus.uml.diagram.communication.navigator.UMLAbstractNavigatorItem"/> + </or> + </triggerPoints> + <possibleChildren> + <or> + <instanceof value="org.eclipse.papyrus.uml.diagram.communication.navigator.UMLAbstractNavigatorItem"/> + </or> + </possibleChildren> + <commonSorter + id="org.eclipse.papyrus.uml.diagram.communication.navigatorSorter" + class="org.eclipse.papyrus.uml.diagram.communication.navigator.UMLNavigatorSorter"> + <parentExpression> + <or> + <and> + <instanceof value="org.eclipse.core.resources.IFile"/> + <test property="org.eclipse.core.resources.extension" value="PapyrusUMLCommunication_diagram"/> + </and> + <instanceof value="org.eclipse.papyrus.uml.diagram.communication.navigator.UMLAbstractNavigatorItem"/> + </or> + </parentExpression> + </commonSorter> + </navigatorContent> + <navigatorContent + id="org.eclipse.papyrus.uml.diagram.communication.domainResourceContent" + name="%domainNavigatorContentName" + priority="normal" + contentProvider="org.eclipse.papyrus.uml.diagram.communication.navigator.UMLDomainNavigatorContentProvider" + labelProvider="org.eclipse.papyrus.uml.diagram.communication.navigator.UMLDomainNavigatorLabelProvider" + icon="icons/obj16/UMLDiagramFile.gif" + activeByDefault="true"> + <triggerPoints> + <or> + <and> + <instanceof value="org.eclipse.core.resources.IFile"/> + <test property="org.eclipse.core.resources.extension" value="PapyrusUMLCommunication"/> + </and> + <instanceof value="org.eclipse.papyrus.uml.diagram.communication.navigator.UMLDomainNavigatorItem"/> + </or> + </triggerPoints> + <possibleChildren> + <instanceof value="org.eclipse.papyrus.uml.diagram.communication.navigator.UMLDomainNavigatorItem"/> + </possibleChildren> + </navigatorContent> + <actionProvider + id="org.eclipse.papyrus.uml.diagram.communication.navigatorActionProvider" + class="org.eclipse.papyrus.uml.diagram.communication.navigator.UMLNavigatorActionProvider"> + <enablement> + <or> + <instanceof value="org.eclipse.papyrus.uml.diagram.communication.navigator.UMLAbstractNavigatorItem"/> + </or> + </enablement> + </actionProvider> + </extension> -<extension point="org.eclipse.ui.navigator.linkHelper" id="navigator-linkhelper">
- <?gmfgen generated="true"?>
- <linkHelper
- id="org.eclipse.papyrus.uml.diagram.communication.navigatorLinkHelper"
- class="org.eclipse.papyrus.uml.diagram.communication.navigator.UMLNavigatorLinkHelper">
- <editorInputEnablement>
- <and>
- <instanceof value="org.eclipse.emf.common.ui.URIEditorInput"/>
- <test property="org.eclipse.papyrus.uml.diagram.communication.isURIEditorInput"/>
- </and>
- </editorInputEnablement>
- <selectionEnablement>
- <instanceof value="org.eclipse.papyrus.uml.diagram.communication.navigator.UMLAbstractNavigatorItem"/>
- </selectionEnablement>
- </linkHelper>
- </extension>
+<extension point="org.eclipse.ui.navigator.linkHelper" id="navigator-linkhelper"> + <?gmfgen generated="true"?> + <linkHelper + id="org.eclipse.papyrus.uml.diagram.communication.navigatorLinkHelper" + class="org.eclipse.papyrus.uml.diagram.communication.navigator.UMLNavigatorLinkHelper"> + <editorInputEnablement> + <and> + <instanceof value="org.eclipse.emf.common.ui.URIEditorInput"/> + <test property="org.eclipse.papyrus.uml.diagram.communication.isURIEditorInput"/> + </and> + </editorInputEnablement> + <selectionEnablement> + <instanceof value="org.eclipse.papyrus.uml.diagram.communication.navigator.UMLAbstractNavigatorItem"/> + </selectionEnablement> + </linkHelper> + </extension> @@ -267,15 +266,15 @@ <context views="generated-diagram,generated-nodes,generated-links,generated-labels,generated-compartments"/> </editpartProvider> </extension> -<extension point="org.eclipse.ui.contexts" id="ui-context">
- <?gmfgen generated="true"?>
- <context
- description="%context.description"
- id="org.eclipse.papyrus.uml.diagram.communication.ui.diagramContext"
- name="%context.name"
- parentId="org.eclipse.gmf.runtime.diagram.ui.diagramContext">
- </context>
- </extension>
+<extension point="org.eclipse.ui.contexts" id="ui-context"> + <?gmfgen generated="true"?> + <context + description="%context.description" + id="org.eclipse.papyrus.uml.diagram.communication.ui.diagramContext" + name="%context.name" + parentId="org.eclipse.gmf.runtime.diagram.ui.diagramContext"> + </context> + </extension> <extension point="org.eclipse.ui.popupMenus"> <objectContribution @@ -293,48 +292,48 @@ </action> </objectContribution> </extension> -<extension point="org.eclipse.ui.menus" id="context-menus">
- <?gmfgen generated="true"?>
- <!-- menuContribution locationURI="menu:org.eclipse.ui.main.menu?after=">
- </menuContribution>
- <menuContribution locationURI="toolbar:org.eclipse.ui.main.toolbar?after=">
- </menuContribution -->
- </extension>
+<extension point="org.eclipse.ui.menus" id="context-menus"> + <?gmfgen generated="true"?> + <!-- menuContribution locationURI="menu:org.eclipse.ui.main.menu?after="> + </menuContribution> + <menuContribution locationURI="toolbar:org.eclipse.ui.main.toolbar?after="> + </menuContribution --> + </extension> -<extension id="validationDecoratorProvider" name="ValidationDecorations" point="org.eclipse.gmf.runtime.diagram.ui.decoratorProviders">
- <?gmfgen generated="true"?>
- <decoratorProvider class="org.eclipse.papyrus.uml.diagram.communication.providers.UMLValidationDecoratorProvider">
- <Priority name="Lowest"/>
- <object class="org.eclipse.gmf.runtime.diagram.ui.editparts.IPrimaryEditPart(org.eclipse.gmf.runtime.diagram.ui)" id="PRIMARY_VIEW"/>
- <context decoratorTargets="PRIMARY_VIEW"/>
- </decoratorProvider>
- </extension>
-<extension point="org.eclipse.papyrus.infra.gmfdiag.common.notationTypesMapping">
- <?gmfgen generated="true"?>
- <diagramMappings diagramID="PapyrusUMLCommunicationDiagram">
- <mapping type="PapyrusUMLCommunicationDiagram" humanReadableType="CommunicationDiagram"/>
- <mapping
- humanReadableType="Interaction"
- type="Interaction_SubfragmentCompartment">
- </mapping>
- <mapping
- humanReadableType="Floating Label"
- type="Lifeline_FloatingNameLabel">
- </mapping>
- <mapping
- humanReadableType="Floating Label"
- type="TimeObservation_NameLabel">
- </mapping>
- <mapping
- humanReadableType="Floating Label"
- type="DurationObservation_NameLabel">
- </mapping>
- <mapping
- humanReadableType="Floating Label"
- type="Interaction_FloatingNameLabel">
- </mapping>
- </diagramMappings>
-</extension>
+<extension id="validationDecoratorProvider" name="ValidationDecorations" point="org.eclipse.gmf.runtime.diagram.ui.decoratorProviders"> + <?gmfgen generated="true"?> + <decoratorProvider class="org.eclipse.papyrus.uml.diagram.communication.providers.UMLValidationDecoratorProvider"> + <Priority name="Lowest"/> + <object class="org.eclipse.gmf.runtime.diagram.ui.editparts.IPrimaryEditPart(org.eclipse.gmf.runtime.diagram.ui)" id="PRIMARY_VIEW"/> + <context decoratorTargets="PRIMARY_VIEW"/> + </decoratorProvider> + </extension> +<extension point="org.eclipse.papyrus.infra.gmfdiag.common.notationTypesMapping"> + <?gmfgen generated="true"?> + <diagramMappings diagramID="PapyrusUMLCommunicationDiagram"> + <mapping type="PapyrusUMLCommunicationDiagram" humanReadableType="CommunicationDiagram"/> + <mapping + humanReadableType="Interaction" + type="Interaction_SubfragmentCompartment"> + </mapping> + <mapping + humanReadableType="Floating Label" + type="Lifeline_FloatingNameLabel"> + </mapping> + <mapping + humanReadableType="Floating Label" + type="TimeObservation_NameLabel"> + </mapping> + <mapping + humanReadableType="Floating Label" + type="DurationObservation_NameLabel"> + </mapping> + <mapping + humanReadableType="Floating Label" + type="Interaction_FloatingNameLabel"> + </mapping> + </diagramMappings> +</extension> <extension @@ -371,13 +370,13 @@ target="1.3.0"> </diagramReconciler> </extension> - <extension point="org.eclipse.papyrus.infra.gmfdiag.common.visualTypeProviders">
- <?gmfgen generated="true"?>
- <visualTypeProvider
- class="org.eclipse.papyrus.uml.diagram.communication.providers.UMLVisualTypeProvider"
- diagramType="PapyrusUMLCommunicationDiagram">
- </visualTypeProvider>
- </extension>
+ <extension point="org.eclipse.papyrus.infra.gmfdiag.common.visualTypeProviders"> + <?gmfgen generated="true"?> + <visualTypeProvider + class="org.eclipse.papyrus.uml.diagram.communication.providers.UMLVisualTypeProvider" + diagramType="PapyrusUMLCommunicationDiagram"> + </visualTypeProvider> + </extension> </plugin> diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/helpers/PackageEditHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/helpers/PackageEditHelper.java index 66f51f04577..41978665e27 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/helpers/PackageEditHelper.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/helpers/PackageEditHelper.java @@ -1,18 +1,18 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.edit.helpers;
-
-/**
- * @generated
- */
-public class PackageEditHelper extends UMLBaseEditHelper {
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.edit.helpers; + +/** + * @generated + */ +public class PackageEditHelper extends UMLBaseEditHelper { +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/helpers/UMLBaseEditHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/helpers/UMLBaseEditHelper.java index b3e75fdf888..06f87e6f677 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/helpers/UMLBaseEditHelper.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/helpers/UMLBaseEditHelper.java @@ -1,21 +1,21 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.edit.helpers;
-
-import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.edit.helpers.GeneratedEditHelperBase;
-
-/**
- * @generated
- */
-public class UMLBaseEditHelper extends GeneratedEditHelperBase {
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.edit.helpers; + +import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.edit.helpers.GeneratedEditHelperBase; + +/** + * @generated + */ +public class UMLBaseEditHelper extends GeneratedEditHelperBase { + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/AppliedStereotypeMessageEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/AppliedStereotypeMessageEditPart.java index 68f816b304e..efd86da4900 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/AppliedStereotypeMessageEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/AppliedStereotypeMessageEditPart.java @@ -1,793 +1,793 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.ConnectionLocator;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.ICustomDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IControlParserForDirectEdit;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusLabelEditPart;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.PapyrusLinkLabelDragPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.parsers.ParserUtil;
-import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.uml.diagram.communication.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.uml.diagram.communication.providers.UMLElementTypes;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.uml2.uml.Feature;
-
-/**
- * @generated
- */
-public class AppliedStereotypeMessageEditPart extends PapyrusLabelEditPart
- implements ITextAwareEditPart, IControlParserForDirectEdit {
-
- /**
- * @generated
- */
- public static final String VISUAL_ID = "Path_StereotypeLabel";
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
- /**
- * 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
- */
- static {
- registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.communication.edit.parts.AppliedStereotypeMessageEditPart.VISUAL_ID), new Point(1, -53));
- }
-
- /**
- * @generated
- */
- public AppliedStereotypeMessageEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated Papyrus Generation
- */
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PapyrusLinkLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- public int getKeyPoint() {
- return ConnectionLocator.MIDDLE;
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if (figure instanceof WrappingLabel) {
- return ((WrappingLabel) figure).getText();
- } else if (figure instanceof ILabelFigure) {
- return ((ILabelFigure) figure).getText();
- } else {
- return ((Label) figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if (figure instanceof WrappingLabel) {
- ((WrappingLabel) figure).setText(text);
- } else if (figure instanceof ILabelFigure) {
- ((ILabelFigure) figure).setText(text);
- } else {
- ((Label) figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if (figure instanceof WrappingLabel) {
- return ((WrappingLabel) figure).getIcon();
- } else if (figure instanceof ILabelFigure) {
- return ((ILabelFigure) figure).getIcon();
- } else {
- return ((Label) figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if (figure instanceof WrappingLabel) {
- ((WrappingLabel) figure).setIcon(icon);
- } else if (figure instanceof ILabelFigure) {
- ((ILabelFigure) figure).setIcon(icon);
- } else {
- ((Label) figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(IFigure figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List<?> getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- public void setParser(IParser parser) {
- this.parser = parser;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if (parserElement != null && getParser() != null) {
- text = getParser().getPrintString(
- ParserUtil.getParserAdapter(getParserElement(), this),
- getParserOptions().intValue());
- }
- if (text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if (getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(
- ParserUtil.getParserAdapter(getParserElement(), this),
- getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- @Override
- public String isValid(final Object value) {
- if (value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(ParserUtil.getParserAdapter(getParserElement(), AppliedStereotypeMessageEditPart.this), (String) value));
- }
- });
- return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if (getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(ParserUtil.getParserAdapter(getParserElement(), this));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if (parser == null) {
- parser = ParserUtil.getParser(UMLElementTypes.Path_Edge, getParserElement(), this, VISUAL_ID);
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if (manager == null) {
- setManager(new MultilineLabelDirectEditManager(this,
- MultilineLabelDirectEditManager.getTextCellEditorClass(this),
- UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- BusyIndicator.showWhile(Display.getDefault(), new java.lang.Runnable() {
-
- @Override
- public void run() {
- getManager().show();
- }
- });
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if (getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(char initialCharacter) {
- if (getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager) getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch (directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if (configuration == null || configuration.getLanguage() == null) {
- // Create default edit manager
- 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));
- initializeDirectEditManager(theRequest);
- return;
- } else if (configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if (configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if (configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if (Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
- initializeDirectEditManager(theRequest);
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void initializeDirectEditManager(final Request request) {
- // 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);
- performDirectEdit(initialChar.charValue());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if (maskLabelPolicy == null) {
- maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
- }
- if (maskLabelPolicy == null) {
- View view = (View) getModel();
- if (view.isVisible()) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- } else {
- setLabelTextHelper(getFigure(), ""); //$NON-NLS-1$
- setLabelIconHelper(getFigure(), null);
- }
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
- if (style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
- }
- if (resolveSemanticElement() instanceof Feature) {
- if (((Feature) resolveSemanticElement()).isStatic()) {
- ((WrappingLabel) getFigure()).setTextUnderline(true);
- } else {
- ((WrappingLabel) getFigure()).setTextUnderline(false);
- }
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
- if (style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
- if (style != null) {
- FontData fontData = new FontData(
- style.getFontName(), style.getFontHeight(),
- (style.isBold() ? SWT.BOLD : SWT.NORMAL) |
- (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if (getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
- for (int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if (parserElements != null) {
- for (int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if (accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- @Override
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return getPrimaryView();
- }
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if (checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if (checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if (configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if (languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
- } else {
- 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(), 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
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- @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);
- performDirectEdit(initialChar.charValue());
- } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest) theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- Object feature = event.getFeature();
- if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer) event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) ||
- NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) ||
- NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) ||
- NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if (getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser) getParser();
- if (modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if (resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
-
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.edit.parts; + +import java.util.Collections; +import java.util.List; + +import org.eclipse.draw2d.ConnectionLocator; +import org.eclipse.draw2d.IFigure; +import org.eclipse.draw2d.Label; +import org.eclipse.draw2d.geometry.Point; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.transaction.RecordingCommand; +import org.eclipse.emf.transaction.RunnableWithResult; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.gef.AccessibleEditPart; +import org.eclipse.gef.EditPolicy; +import org.eclipse.gef.Request; +import org.eclipse.gef.requests.DirectEditRequest; +import org.eclipse.gef.tools.DirectEditManager; +import org.eclipse.gmf.runtime.common.ui.services.parser.IParser; +import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus; +import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions; +import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy; +import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry; +import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants; +import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager; +import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; +import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser; +import org.eclipse.gmf.runtime.notation.FontStyle; +import org.eclipse.gmf.runtime.notation.NotationPackage; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.text.contentassist.IContentAssistProcessor; +import org.eclipse.jface.viewers.ICellEditorValidator; +import org.eclipse.jface.window.Window; +import org.eclipse.papyrus.extensionpoints.editors.Activator; +import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.configuration.ICustomDirectEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog; +import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog; +import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper; +import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil; +import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds; +import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IControlParserForDirectEdit; +import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusLabelEditPart; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.PapyrusLinkLabelDragPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.parsers.ParserUtil; +import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager; +import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition; +import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure; +import org.eclipse.papyrus.uml.diagram.communication.edit.policies.UMLTextSelectionEditPolicy; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry; +import org.eclipse.papyrus.uml.diagram.communication.providers.UMLElementTypes; +import org.eclipse.swt.SWT; +import org.eclipse.swt.accessibility.AccessibleEvent; +import org.eclipse.swt.custom.BusyIndicator; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.graphics.FontData; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.widgets.Display; +import org.eclipse.ui.PlatformUI; +import org.eclipse.uml2.uml.Feature; + +/** + * @generated + */ +public class AppliedStereotypeMessageEditPart extends PapyrusLabelEditPart + implements ITextAwareEditPart, IControlParserForDirectEdit { + + /** + * @generated + */ + public static final String VISUAL_ID = "Path_StereotypeLabel"; + + /** + * @generated + */ + private DirectEditManager manager; + + /** + * @generated + */ + private IParser parser; + + /** + * @generated + */ + private List<?> parserElements; + + /** + * @generated + */ + private String defaultText; + + /** + * 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 + */ + static { + registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.communication.edit.parts.AppliedStereotypeMessageEditPart.VISUAL_ID), new Point(1, -53)); + } + + /** + * @generated + */ + public AppliedStereotypeMessageEditPart(View view) { + super(view); + } + + /** + * @generated Papyrus Generation + */ + @Override + protected void createDefaultEditPolicies() { + super.createDefaultEditPolicies(); + installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy()); + installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy()); + installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PapyrusLinkLabelDragPolicy()); + } + + /** + * @generated + */ + public int getKeyPoint() { + return ConnectionLocator.MIDDLE; + } + + /** + * @generated + */ + protected String getLabelTextHelper(IFigure figure) { + if (figure instanceof WrappingLabel) { + return ((WrappingLabel) figure).getText(); + } else if (figure instanceof ILabelFigure) { + return ((ILabelFigure) figure).getText(); + } else { + return ((Label) figure).getText(); + } + } + + /** + * @generated + */ + protected void setLabelTextHelper(IFigure figure, String text) { + if (figure instanceof WrappingLabel) { + ((WrappingLabel) figure).setText(text); + } else if (figure instanceof ILabelFigure) { + ((ILabelFigure) figure).setText(text); + } else { + ((Label) figure).setText(text); + } + } + + /** + * @generated + */ + protected Image getLabelIconHelper(IFigure figure) { + if (figure instanceof WrappingLabel) { + return ((WrappingLabel) figure).getIcon(); + } else if (figure instanceof ILabelFigure) { + return ((ILabelFigure) figure).getIcon(); + } else { + return ((Label) figure).getIcon(); + } + } + + /** + * @generated + */ + protected void setLabelIconHelper(IFigure figure, Image icon) { + if (figure instanceof WrappingLabel) { + ((WrappingLabel) figure).setIcon(icon); + } else if (figure instanceof ILabelFigure) { + ((ILabelFigure) figure).setIcon(icon); + } else { + ((Label) figure).setIcon(icon); + } + } + + /** + * @generated + */ + public void setLabel(IFigure figure) { + unregisterVisuals(); + setFigure(figure); + defaultText = getLabelTextHelper(figure); + registerVisuals(); + refreshVisuals(); + } + + /** + * @generated + */ + protected List<?> getModelChildren() { + return Collections.EMPTY_LIST; + } + + /** + * @generated + */ + public IGraphicalEditPart getChildBySemanticHint(String semanticHint) { + return null; + } + + /** + * @generated + */ + public void setParser(IParser parser) { + this.parser = parser; + } + + /** + * @generated + */ + protected EObject getParserElement() { + return resolveSemanticElement(); + } + + /** + * @generated + */ + protected Image getLabelIcon() { + return null; + } + + /** + * @generated + */ + protected String getLabelText() { + String text = null; + EObject parserElement = getParserElement(); + if (parserElement != null && getParser() != null) { + text = getParser().getPrintString( + ParserUtil.getParserAdapter(getParserElement(), this), + getParserOptions().intValue()); + } + if (text == null || text.length() == 0) { + text = defaultText; + } + return text; + } + + /** + * @generated + */ + public void setLabelText(String text) { + setLabelTextHelper(getFigure(), text); + Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); + if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); + } + Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE); + if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback(); + } + } + + /** + * @generated + */ + public String getEditText() { + if (getParserElement() == null || getParser() == null) { + return ""; //$NON-NLS-1$ + } + return getParser().getEditString( + ParserUtil.getParserAdapter(getParserElement(), this), + getParserOptions().intValue()); + } + + /** + * @generated + */ + protected boolean isEditable() { + return getParser() != null; + } + + /** + * @generated + */ + public ICellEditorValidator getEditTextValidator() { + return new ICellEditorValidator() { + + @Override + public String isValid(final Object value) { + if (value instanceof String) { + final EObject element = getParserElement(); + final IParser parser = getParser(); + try { + IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive( + new RunnableWithResult.Impl<java.lang.Object>() { + + @Override + public void run() { + setResult(parser.isValidEditString(ParserUtil.getParserAdapter(getParserElement(), AppliedStereotypeMessageEditPart.this), (String) value)); + } + }); + return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage(); + } catch (InterruptedException ie) { + ie.printStackTrace(); + } + } + + // shouldn't get here + return null; + } + }; + } + + /** + * @generated + */ + public IContentAssistProcessor getCompletionProcessor() { + if (getParserElement() == null || getParser() == null) { + return null; + } + return getParser().getCompletionProcessor(ParserUtil.getParserAdapter(getParserElement(), this)); + } + + /** + * @generated + */ + public ParserOptions getParserOptions() { + return ParserOptions.NONE; + } + + /** + * @generated + */ + public IParser getParser() { + if (parser == null) { + parser = ParserUtil.getParser(UMLElementTypes.Path_Edge, getParserElement(), this, VISUAL_ID); + } + return parser; + } + + /** + * @generated + */ + protected DirectEditManager getManager() { + if (manager == null) { + setManager(new MultilineLabelDirectEditManager(this, + MultilineLabelDirectEditManager.getTextCellEditorClass(this), + UMLEditPartFactory.getTextCellEditorLocator(this))); + } + return manager; + } + + /** + * @generated + */ + protected void setManager(DirectEditManager manager) { + this.manager = manager; + } + + /** + * @generated + */ + protected void performDirectEdit() { + BusyIndicator.showWhile(Display.getDefault(), new java.lang.Runnable() { + + @Override + public void run() { + getManager().show(); + } + }); + } + + /** + * @generated + */ + protected void performDirectEdit(Point eventLocation) { + if (getManager() instanceof TextDirectEditManager) { + ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint()); + } + } + + /** + * @generated + */ + protected void performDirectEdit(char initialCharacter) { + if (getManager() instanceof TextDirectEditManager) { + ((TextDirectEditManager) getManager()).show(initialCharacter); + } else { + performDirectEdit(); + } + } + + /** + * @generated + */ + protected void performDirectEditRequest(Request request) { + + final Request theRequest = request; + + if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) { + directEditionMode = getDirectEditionType(); + } + switch (directEditionMode) { + case IDirectEdition.NO_DIRECT_EDITION: + // no direct edition mode => does nothing + return; + case IDirectEdition.EXTENDED_DIRECT_EDITOR: + updateExtendedEditorConfiguration(); + if (configuration == null || configuration.getLanguage() == null) { + // Create default edit manager + 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)); + initializeDirectEditManager(theRequest); + return; + } else if (configuration instanceof IPopupEditorConfiguration) { + IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this); + helper.showEditor(); + return; + } else if (configuration instanceof IAdvancedEditorConfiguration) { + dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement())); + } else if (configuration instanceof IDirectEditorConfiguration) { + dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration); + } else { + return; + } + final Dialog finalDialog = dialog; + + if (Window.OK == dialog.open()) { + TransactionalEditingDomain domain = getEditingDomain(); + RecordingCommand command = new RecordingCommand(domain, "Edit Label") { + + @Override + protected void doExecute() { + configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue()); + + } + }; + domain.getCommandStack().execute(command); + } + } + break; + case IDirectEdition.DEFAULT_DIRECT_EDITOR: + initializeDirectEditManager(theRequest); + break; + default: + break; + } + } + + /** + * @generated + */ + protected void initializeDirectEditManager(final Request request) { + // 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); + performDirectEdit(initialChar.charValue()); + } else { + performDirectEdit(); + } + } + } + }); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + /** + * @generated + */ + protected void refreshVisuals() { + super.refreshVisuals(); + refreshLabel(); + refreshFont(); + refreshFontColor(); + refreshUnderline(); + refreshStrikeThrough(); + } + + /** + * @generated + */ + protected void refreshLabel() { + EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY); + if (maskLabelPolicy == null) { + maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL); + } + if (maskLabelPolicy == null) { + View view = (View) getModel(); + if (view.isVisible()) { + setLabelTextHelper(getFigure(), getLabelText()); + setLabelIconHelper(getFigure(), getLabelIcon()); + } else { + setLabelTextHelper(getFigure(), ""); //$NON-NLS-1$ + setLabelIconHelper(getFigure(), null); + } + } + Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); + if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); + } + Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE); + if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback(); + } + } + + /** + * @generated + */ + protected void refreshUnderline() { + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( + NotationPackage.eINSTANCE.getFontStyle()); + if (style != null && getFigure() instanceof WrappingLabel) { + ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline()); + } + if (resolveSemanticElement() instanceof Feature) { + if (((Feature) resolveSemanticElement()).isStatic()) { + ((WrappingLabel) getFigure()).setTextUnderline(true); + } else { + ((WrappingLabel) getFigure()).setTextUnderline(false); + } + } + } + + /** + * @generated + */ + protected void refreshStrikeThrough() { + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( + NotationPackage.eINSTANCE.getFontStyle()); + if (style != null && getFigure() instanceof WrappingLabel) { + ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough()); + } + } + + /** + * @generated + */ + protected void refreshFont() { + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( + NotationPackage.eINSTANCE.getFontStyle()); + if (style != null) { + FontData fontData = new FontData( + style.getFontName(), style.getFontHeight(), + (style.isBold() ? SWT.BOLD : SWT.NORMAL) | + (style.isItalic() ? SWT.ITALIC : SWT.NORMAL)); + setFont(fontData); + } + } + + /** + * @generated + */ + protected void setFontColor(Color color) { + getFigure().setForegroundColor(color); + } + + /** + * @generated + */ + protected void addSemanticListeners() { + if (getParser() instanceof ISemanticParser) { + EObject element = resolveSemanticElement(); + parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element); + for (int i = 0; i < parserElements.size(); i++) { + addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$ + } + } else { + super.addSemanticListeners(); + } + } + + /** + * @generated + */ + protected void removeSemanticListeners() { + if (parserElements != null) { + for (int i = 0; i < parserElements.size(); i++) { + removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$ + } + } else { + super.removeSemanticListeners(); + } + } + + /** + * @generated + */ + protected AccessibleEditPart getAccessibleEditPart() { + if (accessibleEP == null) { + accessibleEP = new AccessibleGraphicalEditPart() { + + @Override + public void getName(AccessibleEvent e) { + e.result = getLabelTextHelper(getFigure()); + } + }; + } + return accessibleEP; + } + + /** + * @generated + */ + private View getFontStyleOwnerView() { + return getPrimaryView(); + } + + /** + * Returns the kind of associated editor for direct edition. + * + * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition + * @generated + */ + public int getDirectEditionType() { + if (checkExtendedEditor()) { + initExtendedEditorConfiguration(); + return IDirectEdition.EXTENDED_DIRECT_EDITOR; + } + if (checkDefaultEdition()) { + return IDirectEdition.DEFAULT_DIRECT_EDITOR; + } + + // not a named element. no specific editor => do nothing + return IDirectEdition.NO_DIRECT_EDITION; + } + + /** + * Checks if an extended editor is present. + * + * @return <code>true</code> if an extended editor is present. + * @generated + */ + protected boolean checkExtendedEditor() { + if (resolveSemanticElement() != null) { + return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this); + } + return false; + } + + /** + * Checks if a default direct edition is available + * + * @return <code>true</code> if a default direct edition is available + * @generated + */ + protected boolean checkDefaultEdition() { + return (getParser() != null); + } + + /** + * Initializes the extended editor configuration + * @generated + */ + protected void initExtendedEditorConfiguration() { + if (configuration == null) { + final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName()); + if (languagePreferred != null && !languagePreferred.equals("")) { + configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this); + } else { + 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(), 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 + * @generated + */ + protected void performDefaultDirectEditorEdit(final Request theRequest) { + // initialize the direct edit manager + try { + getEditingDomain().runExclusive(new Runnable() { + + @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); + performDirectEdit(initialChar.charValue()); + } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) { + DirectEditRequest editRequest = (DirectEditRequest) theRequest; + performDirectEdit(editRequest.getLocation()); + } else { + performDirectEdit(); + } + } + } + }); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + /** + * @generated + */ + protected void handleNotificationEvent(Notification event) { + Object feature = event.getFeature(); + if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) { + Integer c = (Integer) event.getNewValue(); + setFontColor(DiagramColorRegistry.getInstance().getColor(c)); + } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) { + refreshUnderline(); + } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) { + refreshStrikeThrough(); + } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || + NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || + NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || + NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) { + refreshFont(); + } else { + if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) { + refreshLabel(); + } + if (getParser() instanceof ISemanticParser) { + ISemanticParser modelParser = (ISemanticParser) getParser(); + if (modelParser.areSemanticElementsAffected(null, event)) { + removeSemanticListeners(); + if (resolveSemanticElement() != null) { + addSemanticListeners(); + } + refreshLabel(); + } + } + } + + super.handleNotificationEvent(event); + } + + /** + * @generated + */ + protected IFigure createFigure() { + // Parent should assign one using setLabel() method + return null; + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/CommentAnnotatedElementEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/CommentAnnotatedElementEditPart.java index 9520f453575..79215817b65 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/CommentAnnotatedElementEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/CommentAnnotatedElementEditPart.java @@ -1,66 +1,66 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.edit.parts;
-
-import org.eclipse.draw2d.Connection;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.editparts.UMLConnectionNodeEditPart;
-import org.eclipse.papyrus.uml.diagram.common.figure.edge.SimpleDashedEdgeFigure;
-
-/**
- * @generated
- */
-public class CommentAnnotatedElementEditPart extends UMLConnectionNodeEditPart implements ITreeBranchEditPart {
-
- /**
- * @generated
- */
- public static final String VISUAL_ID = "Comment_AnnotatedElementEdge";
-
- /**
- * @generated
- */
- public CommentAnnotatedElementEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
- }
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected Connection createConnectionFigure() {
- return new SimpleDashedEdgeFigure();
- }
-
- /**
- * @generated
- */
- public SimpleDashedEdgeFigure getPrimaryShape() {
- return (SimpleDashedEdgeFigure) getFigure();
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.edit.parts; + +import org.eclipse.draw2d.Connection; +import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy; +import org.eclipse.papyrus.uml.diagram.common.editparts.UMLConnectionNodeEditPart; +import org.eclipse.papyrus.uml.diagram.common.figure.edge.SimpleDashedEdgeFigure; + +/** + * @generated + */ +public class CommentAnnotatedElementEditPart extends UMLConnectionNodeEditPart implements ITreeBranchEditPart { + + /** + * @generated + */ + public static final String VISUAL_ID = "Comment_AnnotatedElementEdge"; + + /** + * @generated + */ + public CommentAnnotatedElementEditPart(View view) { + super(view); + } + + /** + * @generated + */ + protected void createDefaultEditPolicies() { + super.createDefaultEditPolicies(); + installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy()); + } + + /** + * Creates figure for this edit part. + * + * Body of this method does not depend on settings in generation model + * so you may safely remove <i>generated</i> tag and modify it. + * + * @generated + */ + protected Connection createConnectionFigure() { + return new SimpleDashedEdgeFigure(); + } + + /** + * @generated + */ + public SimpleDashedEdgeFigure getPrimaryShape() { + return (SimpleDashedEdgeFigure) getFigure(); + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/CommentBodyEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/CommentBodyEditPartCN.java index 840f187a768..643ae4d5938 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/CommentBodyEditPartCN.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/CommentBodyEditPartCN.java @@ -1,830 +1,830 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.ICustomDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IControlParserForDirectEdit;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusCompartmentEditPart;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.parsers.ParserUtil;
-import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.edit.policies.DefaultNodeLabelDragPolicy;
-import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.uml.diagram.communication.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.uml.diagram.communication.providers.UMLElementTypes;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.uml2.uml.Feature;
-
-/**
- * @generated
- */
-public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart
- implements ITextAwareEditPart, IControlParserForDirectEdit {
-
- /**
- * @generated
- */
- public static final String VISUAL_ID = "Comment_BodyLabel";
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
- /**
- * 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
- */
- public CommentBodyEditPartCN(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DefaultNodeLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if (figure instanceof WrappingLabel) {
- return ((WrappingLabel) figure).getText();
- } else if (figure instanceof ILabelFigure) {
- return ((ILabelFigure) figure).getText();
- } else {
- return ((Label) figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if (figure instanceof WrappingLabel) {
- ((WrappingLabel) figure).setText(text);
- } else if (figure instanceof ILabelFigure) {
- ((ILabelFigure) figure).setText(text);
- } else {
- ((Label) figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if (figure instanceof WrappingLabel) {
- return ((WrappingLabel) figure).getIcon();
- } else if (figure instanceof ILabelFigure) {
- return ((ILabelFigure) figure).getIcon();
- } else {
- return ((Label) figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if (figure instanceof WrappingLabel) {
- ((WrappingLabel) figure).setIcon(icon);
- } else if (figure instanceof ILabelFigure) {
- ((ILabelFigure) figure).setIcon(icon);
- } else {
- ((Label) figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(IFigure figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List<?> getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- public void setParser(IParser parser) {
- this.parser = parser;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if (parserElement != null && getParser() != null) {
- text = getParser().getPrintString(
- ParserUtil.getParserAdapter(getParserElement(), this),
- getParserOptions().intValue());
- }
- if (text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if (getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(
- ParserUtil.getParserAdapter(getParserElement(), this),
- getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- @Override
- public String isValid(final Object value) {
- if (value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(ParserUtil.getParserAdapter(getParserElement(), CommentBodyEditPartCN.this), (String) value));
- }
- });
- return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if (getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(ParserUtil.getParserAdapter(getParserElement(), this));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if (parser == null) {
- parser = ParserUtil.getParser(UMLElementTypes.Comment_Shape, getParserElement(), this, VISUAL_ID);
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if (manager == null) {
- setManager(new MultilineLabelDirectEditManager(this,
- MultilineLabelDirectEditManager.getTextCellEditorClass(this),
- UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- BusyIndicator.showWhile(Display.getDefault(), new java.lang.Runnable() {
-
- @Override
- public void run() {
- getManager().show();
- }
- });
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if (getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(char initialCharacter) {
- if (getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager) getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch (directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if (configuration == null || configuration.getLanguage() == null) {
- // Create default edit manager
- 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));
- initializeDirectEditManager(theRequest);
- return;
- } else if (configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if (configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if (configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if (Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
- initializeDirectEditManager(theRequest);
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void initializeDirectEditManager(final Request request) {
- // 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);
- performDirectEdit(initialChar.charValue());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if (maskLabelPolicy == null) {
- maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
- }
- if (maskLabelPolicy == null) {
- View view = (View) getModel();
- if (view.isVisible()) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- } else {
- setLabelTextHelper(getFigure(), ""); //$NON-NLS-1$
- setLabelIconHelper(getFigure(), null);
- }
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
- if (style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
- }
- if (resolveSemanticElement() instanceof Feature) {
- if (((Feature) resolveSemanticElement()).isStatic()) {
- ((WrappingLabel) getFigure()).setTextUnderline(true);
- } else {
- ((WrappingLabel) getFigure()).setTextUnderline(false);
- }
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
- if (style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
- if (style != null) {
- FontData fontData = new FontData(
- style.getFontName(), style.getFontHeight(),
- (style.isBold() ? SWT.BOLD : SWT.NORMAL) |
- (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if (getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
- for (int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if (parserElements != null) {
- for (int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if (accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- @Override
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return getPrimaryView();
- }
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if (checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if (checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if (configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if (languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
- } else {
- 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(), 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
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- @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);
- performDirectEdit(initialChar.charValue());
- } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest) theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * @generated
- */
- protected void addNotationalListeners() {
- super.addNotationalListeners();
- addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- protected void removeNotationalListeners() {
- super.removeNotationalListeners();
- removeListenerFilter("PrimaryView"); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- refreshLabel();
- Object feature = event.getFeature();
- if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer) event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) ||
- NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) ||
- NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) ||
- NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if (getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser) getParser();
- if (modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if (resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
- /**
- * @generated
- */
- private static final String ADD_PARENT_MODEL = "AddParentModel";
-
- /**
- * @generated
- */
- public void activate() {
- super.activate();
- addOwnerElementListeners();
- }
-
- /**
- * @generated
- */
- protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
-
- }
-
- /**
- * @generated
- */
- public void deactivate() {
- removeOwnerElementListeners();
- super.deactivate();
-
- }
-
- /**
- * @generated
- */
- protected void removeOwnerElementListeners() {
- removeListenerFilter(ADD_PARENT_MODEL);
-
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.edit.parts; + +import java.util.Collections; +import java.util.List; + +import org.eclipse.draw2d.IFigure; +import org.eclipse.draw2d.Label; +import org.eclipse.draw2d.geometry.Point; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.transaction.RecordingCommand; +import org.eclipse.emf.transaction.RunnableWithResult; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.gef.AccessibleEditPart; +import org.eclipse.gef.EditPolicy; +import org.eclipse.gef.Request; +import org.eclipse.gef.requests.DirectEditRequest; +import org.eclipse.gef.tools.DirectEditManager; +import org.eclipse.gmf.runtime.common.ui.services.parser.IParser; +import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus; +import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions; +import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy; +import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry; +import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants; +import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager; +import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; +import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser; +import org.eclipse.gmf.runtime.notation.FontStyle; +import org.eclipse.gmf.runtime.notation.NotationPackage; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.text.contentassist.IContentAssistProcessor; +import org.eclipse.jface.viewers.ICellEditorValidator; +import org.eclipse.jface.window.Window; +import org.eclipse.papyrus.extensionpoints.editors.Activator; +import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.configuration.ICustomDirectEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog; +import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog; +import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper; +import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil; +import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds; +import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IControlParserForDirectEdit; +import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusCompartmentEditPart; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.parsers.ParserUtil; +import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.edit.policies.DefaultNodeLabelDragPolicy; +import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager; +import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition; +import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure; +import org.eclipse.papyrus.uml.diagram.communication.edit.policies.UMLTextSelectionEditPolicy; +import org.eclipse.papyrus.uml.diagram.communication.providers.UMLElementTypes; +import org.eclipse.swt.SWT; +import org.eclipse.swt.accessibility.AccessibleEvent; +import org.eclipse.swt.custom.BusyIndicator; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.graphics.FontData; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.widgets.Display; +import org.eclipse.ui.PlatformUI; +import org.eclipse.uml2.uml.Feature; + +/** + * @generated + */ +public class CommentBodyEditPartCN extends PapyrusCompartmentEditPart + implements ITextAwareEditPart, IControlParserForDirectEdit { + + /** + * @generated + */ + public static final String VISUAL_ID = "Comment_BodyLabel"; + + /** + * @generated + */ + private DirectEditManager manager; + + /** + * @generated + */ + private IParser parser; + + /** + * @generated + */ + private List<?> parserElements; + + /** + * @generated + */ + private String defaultText; + + /** + * 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 + */ + public CommentBodyEditPartCN(View view) { + super(view); + } + + /** + * @generated + */ + protected void createDefaultEditPolicies() { + super.createDefaultEditPolicies(); + installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy()); + installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy()); + installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DefaultNodeLabelDragPolicy()); + } + + /** + * @generated + */ + protected String getLabelTextHelper(IFigure figure) { + if (figure instanceof WrappingLabel) { + return ((WrappingLabel) figure).getText(); + } else if (figure instanceof ILabelFigure) { + return ((ILabelFigure) figure).getText(); + } else { + return ((Label) figure).getText(); + } + } + + /** + * @generated + */ + protected void setLabelTextHelper(IFigure figure, String text) { + if (figure instanceof WrappingLabel) { + ((WrappingLabel) figure).setText(text); + } else if (figure instanceof ILabelFigure) { + ((ILabelFigure) figure).setText(text); + } else { + ((Label) figure).setText(text); + } + } + + /** + * @generated + */ + protected Image getLabelIconHelper(IFigure figure) { + if (figure instanceof WrappingLabel) { + return ((WrappingLabel) figure).getIcon(); + } else if (figure instanceof ILabelFigure) { + return ((ILabelFigure) figure).getIcon(); + } else { + return ((Label) figure).getIcon(); + } + } + + /** + * @generated + */ + protected void setLabelIconHelper(IFigure figure, Image icon) { + if (figure instanceof WrappingLabel) { + ((WrappingLabel) figure).setIcon(icon); + } else if (figure instanceof ILabelFigure) { + ((ILabelFigure) figure).setIcon(icon); + } else { + ((Label) figure).setIcon(icon); + } + } + + /** + * @generated + */ + public void setLabel(IFigure figure) { + unregisterVisuals(); + setFigure(figure); + defaultText = getLabelTextHelper(figure); + registerVisuals(); + refreshVisuals(); + } + + /** + * @generated + */ + protected List<?> getModelChildren() { + return Collections.EMPTY_LIST; + } + + /** + * @generated + */ + public IGraphicalEditPart getChildBySemanticHint(String semanticHint) { + return null; + } + + /** + * @generated + */ + public void setParser(IParser parser) { + this.parser = parser; + } + + /** + * @generated + */ + protected EObject getParserElement() { + return resolveSemanticElement(); + } + + /** + * @generated + */ + protected Image getLabelIcon() { + return null; + } + + /** + * @generated + */ + protected String getLabelText() { + String text = null; + EObject parserElement = getParserElement(); + if (parserElement != null && getParser() != null) { + text = getParser().getPrintString( + ParserUtil.getParserAdapter(getParserElement(), this), + getParserOptions().intValue()); + } + if (text == null || text.length() == 0) { + text = defaultText; + } + return text; + } + + /** + * @generated + */ + public void setLabelText(String text) { + setLabelTextHelper(getFigure(), text); + Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); + if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); + } + Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE); + if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback(); + } + } + + /** + * @generated + */ + public String getEditText() { + if (getParserElement() == null || getParser() == null) { + return ""; //$NON-NLS-1$ + } + return getParser().getEditString( + ParserUtil.getParserAdapter(getParserElement(), this), + getParserOptions().intValue()); + } + + /** + * @generated + */ + protected boolean isEditable() { + return getParser() != null; + } + + /** + * @generated + */ + public ICellEditorValidator getEditTextValidator() { + return new ICellEditorValidator() { + + @Override + public String isValid(final Object value) { + if (value instanceof String) { + final EObject element = getParserElement(); + final IParser parser = getParser(); + try { + IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive( + new RunnableWithResult.Impl<java.lang.Object>() { + + @Override + public void run() { + setResult(parser.isValidEditString(ParserUtil.getParserAdapter(getParserElement(), CommentBodyEditPartCN.this), (String) value)); + } + }); + return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage(); + } catch (InterruptedException ie) { + ie.printStackTrace(); + } + } + + // shouldn't get here + return null; + } + }; + } + + /** + * @generated + */ + public IContentAssistProcessor getCompletionProcessor() { + if (getParserElement() == null || getParser() == null) { + return null; + } + return getParser().getCompletionProcessor(ParserUtil.getParserAdapter(getParserElement(), this)); + } + + /** + * @generated + */ + public ParserOptions getParserOptions() { + return ParserOptions.NONE; + } + + /** + * @generated + */ + public IParser getParser() { + if (parser == null) { + parser = ParserUtil.getParser(UMLElementTypes.Comment_Shape, getParserElement(), this, VISUAL_ID); + } + return parser; + } + + /** + * @generated + */ + protected DirectEditManager getManager() { + if (manager == null) { + setManager(new MultilineLabelDirectEditManager(this, + MultilineLabelDirectEditManager.getTextCellEditorClass(this), + UMLEditPartFactory.getTextCellEditorLocator(this))); + } + return manager; + } + + /** + * @generated + */ + protected void setManager(DirectEditManager manager) { + this.manager = manager; + } + + /** + * @generated + */ + protected void performDirectEdit() { + BusyIndicator.showWhile(Display.getDefault(), new java.lang.Runnable() { + + @Override + public void run() { + getManager().show(); + } + }); + } + + /** + * @generated + */ + protected void performDirectEdit(Point eventLocation) { + if (getManager() instanceof TextDirectEditManager) { + ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint()); + } + } + + /** + * @generated + */ + protected void performDirectEdit(char initialCharacter) { + if (getManager() instanceof TextDirectEditManager) { + ((TextDirectEditManager) getManager()).show(initialCharacter); + } else { + performDirectEdit(); + } + } + + /** + * @generated + */ + protected void performDirectEditRequest(Request request) { + + final Request theRequest = request; + + if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) { + directEditionMode = getDirectEditionType(); + } + switch (directEditionMode) { + case IDirectEdition.NO_DIRECT_EDITION: + // no direct edition mode => does nothing + return; + case IDirectEdition.EXTENDED_DIRECT_EDITOR: + updateExtendedEditorConfiguration(); + if (configuration == null || configuration.getLanguage() == null) { + // Create default edit manager + 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)); + initializeDirectEditManager(theRequest); + return; + } else if (configuration instanceof IPopupEditorConfiguration) { + IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this); + helper.showEditor(); + return; + } else if (configuration instanceof IAdvancedEditorConfiguration) { + dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement())); + } else if (configuration instanceof IDirectEditorConfiguration) { + dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration); + } else { + return; + } + final Dialog finalDialog = dialog; + + if (Window.OK == dialog.open()) { + TransactionalEditingDomain domain = getEditingDomain(); + RecordingCommand command = new RecordingCommand(domain, "Edit Label") { + + @Override + protected void doExecute() { + configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue()); + + } + }; + domain.getCommandStack().execute(command); + } + } + break; + case IDirectEdition.DEFAULT_DIRECT_EDITOR: + initializeDirectEditManager(theRequest); + break; + default: + break; + } + } + + /** + * @generated + */ + protected void initializeDirectEditManager(final Request request) { + // 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); + performDirectEdit(initialChar.charValue()); + } else { + performDirectEdit(); + } + } + } + }); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + /** + * @generated + */ + protected void refreshVisuals() { + super.refreshVisuals(); + refreshLabel(); + refreshFont(); + refreshFontColor(); + refreshUnderline(); + refreshStrikeThrough(); + } + + /** + * @generated + */ + protected void refreshLabel() { + EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY); + if (maskLabelPolicy == null) { + maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL); + } + if (maskLabelPolicy == null) { + View view = (View) getModel(); + if (view.isVisible()) { + setLabelTextHelper(getFigure(), getLabelText()); + setLabelIconHelper(getFigure(), getLabelIcon()); + } else { + setLabelTextHelper(getFigure(), ""); //$NON-NLS-1$ + setLabelIconHelper(getFigure(), null); + } + } + Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); + if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); + } + Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE); + if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback(); + } + } + + /** + * @generated + */ + protected void refreshUnderline() { + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( + NotationPackage.eINSTANCE.getFontStyle()); + if (style != null && getFigure() instanceof WrappingLabel) { + ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline()); + } + if (resolveSemanticElement() instanceof Feature) { + if (((Feature) resolveSemanticElement()).isStatic()) { + ((WrappingLabel) getFigure()).setTextUnderline(true); + } else { + ((WrappingLabel) getFigure()).setTextUnderline(false); + } + } + } + + /** + * @generated + */ + protected void refreshStrikeThrough() { + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( + NotationPackage.eINSTANCE.getFontStyle()); + if (style != null && getFigure() instanceof WrappingLabel) { + ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough()); + } + } + + /** + * @generated + */ + protected void refreshFont() { + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( + NotationPackage.eINSTANCE.getFontStyle()); + if (style != null) { + FontData fontData = new FontData( + style.getFontName(), style.getFontHeight(), + (style.isBold() ? SWT.BOLD : SWT.NORMAL) | + (style.isItalic() ? SWT.ITALIC : SWT.NORMAL)); + setFont(fontData); + } + } + + /** + * @generated + */ + protected void setFontColor(Color color) { + getFigure().setForegroundColor(color); + } + + /** + * @generated + */ + protected void addSemanticListeners() { + if (getParser() instanceof ISemanticParser) { + EObject element = resolveSemanticElement(); + parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element); + for (int i = 0; i < parserElements.size(); i++) { + addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$ + } + } else { + super.addSemanticListeners(); + } + } + + /** + * @generated + */ + protected void removeSemanticListeners() { + if (parserElements != null) { + for (int i = 0; i < parserElements.size(); i++) { + removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$ + } + } else { + super.removeSemanticListeners(); + } + } + + /** + * @generated + */ + protected AccessibleEditPart getAccessibleEditPart() { + if (accessibleEP == null) { + accessibleEP = new AccessibleGraphicalEditPart() { + + @Override + public void getName(AccessibleEvent e) { + e.result = getLabelTextHelper(getFigure()); + } + }; + } + return accessibleEP; + } + + /** + * @generated + */ + private View getFontStyleOwnerView() { + return getPrimaryView(); + } + + /** + * Returns the kind of associated editor for direct edition. + * + * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition + * @generated + */ + public int getDirectEditionType() { + if (checkExtendedEditor()) { + initExtendedEditorConfiguration(); + return IDirectEdition.EXTENDED_DIRECT_EDITOR; + } + if (checkDefaultEdition()) { + return IDirectEdition.DEFAULT_DIRECT_EDITOR; + } + + // not a named element. no specific editor => do nothing + return IDirectEdition.NO_DIRECT_EDITION; + } + + /** + * Checks if an extended editor is present. + * + * @return <code>true</code> if an extended editor is present. + * @generated + */ + protected boolean checkExtendedEditor() { + if (resolveSemanticElement() != null) { + return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this); + } + return false; + } + + /** + * Checks if a default direct edition is available + * + * @return <code>true</code> if a default direct edition is available + * @generated + */ + protected boolean checkDefaultEdition() { + return (getParser() != null); + } + + /** + * Initializes the extended editor configuration + * @generated + */ + protected void initExtendedEditorConfiguration() { + if (configuration == null) { + final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName()); + if (languagePreferred != null && !languagePreferred.equals("")) { + configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this); + } else { + 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(), 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 + * @generated + */ + protected void performDefaultDirectEditorEdit(final Request theRequest) { + // initialize the direct edit manager + try { + getEditingDomain().runExclusive(new Runnable() { + + @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); + performDirectEdit(initialChar.charValue()); + } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) { + DirectEditRequest editRequest = (DirectEditRequest) theRequest; + performDirectEdit(editRequest.getLocation()); + } else { + performDirectEdit(); + } + } + } + }); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + /** + * @generated + */ + protected void addNotationalListeners() { + super.addNotationalListeners(); + addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$ + } + + /** + * @generated + */ + protected void removeNotationalListeners() { + super.removeNotationalListeners(); + removeListenerFilter("PrimaryView"); //$NON-NLS-1$ + } + + /** + * @generated + */ + protected void handleNotificationEvent(Notification event) { + refreshLabel(); + Object feature = event.getFeature(); + if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) { + Integer c = (Integer) event.getNewValue(); + setFontColor(DiagramColorRegistry.getInstance().getColor(c)); + } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) { + refreshUnderline(); + } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) { + refreshStrikeThrough(); + } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || + NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || + NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || + NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) { + refreshFont(); + } else { + if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) { + refreshLabel(); + } + if (getParser() instanceof ISemanticParser) { + ISemanticParser modelParser = (ISemanticParser) getParser(); + if (modelParser.areSemanticElementsAffected(null, event)) { + removeSemanticListeners(); + if (resolveSemanticElement() != null) { + addSemanticListeners(); + } + refreshLabel(); + } + } + } + super.handleNotificationEvent(event); + } + + /** + * @generated + */ + protected IFigure createFigure() { + // Parent should assign one using setLabel() method + return null; + } + + /** + * @generated + */ + private static final String ADD_PARENT_MODEL = "AddParentModel"; + + /** + * @generated + */ + public void activate() { + super.activate(); + addOwnerElementListeners(); + } + + /** + * @generated + */ + protected void addOwnerElementListeners() { + addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel())); + + } + + /** + * @generated + */ + public void deactivate() { + removeOwnerElementListeners(); + super.deactivate(); + + } + + /** + * @generated + */ + protected void removeOwnerElementListeners() { + removeListenerFilter(ADD_PARENT_MODEL); + + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/CommentEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/CommentEditPartCN.java index 65b7f115839..1b8769dbfe6 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/CommentEditPartCN.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/CommentEditPartCN.java @@ -1,267 +1,265 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.edit.parts;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.LayoutEditPolicy;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-import org.eclipse.gef.requests.CreateRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
-import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultGraphicalNodeEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.PapyrusReflowableShapeEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.IPapyrusNodeFigure;
-import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.RoundedRectangleNodePlateFigure;
-import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.SelectableBorderedNodeFigure;
-import org.eclipse.papyrus.uml.diagram.common.editparts.AbstractCommentEditPart;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.HTMLCornerBentFigure;
-import org.eclipse.papyrus.uml.diagram.communication.edit.policies.OpenDiagramEditPolicy;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * @generated
- */
-public class CommentEditPartCN extends AbstractCommentEditPart {
-
- /**
- * @generated
- */
- public static final String VISUAL_ID = "Comment_Shape";
-
- /**
- * @generated
- */
- protected IFigure contentPane;
-
- /**
- * @generated
- */
- protected IFigure primaryShape;
-
- /**
- * @generated
- */
- public CommentEditPartCN(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- 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.OPEN_ROLE,
- new OpenDiagramEditPolicy());
- installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PapyrusReflowableShapeEditPolicy());
- // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
- // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
- }
-
- /**
- * @generated
- */
- protected LayoutEditPolicy createLayoutEditPolicy() {
- org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
-
- @Override
- protected EditPolicy createChildEditPolicy(EditPart child) {
- EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (result == null) {
- result = new NonResizableEditPolicy();
- }
- return result;
- }
-
- @Override
- protected Command getMoveChildrenCommand(Request request) {
- return null;
- }
-
- @Override
- protected Command getCreateCommand(CreateRequest request) {
- return null;
- }
- };
- return lep;
- }
-
- /**
- *Papyrus codeGen
- *@generated
- **/
- protected void handleNotificationEvent(Notification event) {
- super.handleNotificationEvent(event);
-
- }
-
- /**
- * @generated
- */
- protected IFigure createNodeShape() {
- return primaryShape = new HTMLCornerBentFigure();
- }
-
- /**
- * org.eclipse.papyrus.uml.diagram.common.figure.node.HTMLCornerBentFigure
- * @generated
- */
- public HTMLCornerBentFigure getPrimaryShape() {
- return (HTMLCornerBentFigure) primaryShape;
- }
-
- /**
- * @generated
- */
- protected boolean addFixedChild(EditPart childEditPart) {
- if (childEditPart instanceof CommentBodyEditPartCN) {
- ((CommentBodyEditPartCN) childEditPart).setLabel(getPrimaryShape().getCornerBentFigure());
- return true;
- }
-
-
- return false;
- }
-
- /**
- * @generated
- */
- protected boolean removeFixedChild(EditPart childEditPart) {
- if (childEditPart instanceof CommentBodyEditPartCN) {
- return true;
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected void addChildVisual(EditPart childEditPart, int index) {
- if (addFixedChild(childEditPart)) {
- return;
- }
- super.addChildVisual(childEditPart, -1);
- }
-
- /**
- * @generated
- */
- protected void removeChildVisual(EditPart childEditPart) {
- if (removeFixedChild(childEditPart)) {
- return;
- }
- super.removeChildVisual(childEditPart);
- }
-
- /**
- * @generated
- */
- protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- return getContentPane();
- }
-
- /**
- * @generated
- */
- protected NodeFigure createNodePlate() {
- RoundedRectangleNodePlateFigure result = new RoundedRectangleNodePlateFigure(40, 40);
- return result;
- }
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected NodeFigure createNodeFigure() {
- 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
- * @generated
- */
- protected IFigure setupContentPane(IFigure nodeShape) {
- if (nodeShape.getLayoutManager() == null) {
- ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
- layout.setSpacing(5);
- nodeShape.setLayoutManager(layout);
- }
- return nodeShape; // use nodeShape itself as contentPane
- }
-
- /**
- * @generated
- */
- public IFigure getContentPane() {
- if (contentPane != null) {
- return contentPane;
- }
- return super.getContentPane();
- }
-
- /**
- * @generated
- */
- protected void setForegroundColor(Color color) {
- if (primaryShape != null) {
- primaryShape.setForegroundColor(color);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineWidth(int width) {
- super.setLineWidth(width);
- }
-
- /**
- * @generated
- */
- protected void setLineType(int style) {
- if (primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
- }
- }
-
- /**
- * @generated
- */
- public EditPart getPrimaryChildEditPart() {
- return getChildBySemanticHint(UMLVisualIDRegistry.getType(CommentBodyEditPartCN.VISUAL_ID));
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.edit.parts; + +import org.eclipse.draw2d.IFigure; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.gef.EditPart; +import org.eclipse.gef.EditPolicy; +import org.eclipse.gef.Request; +import org.eclipse.gef.commands.Command; +import org.eclipse.gef.editpolicies.LayoutEditPolicy; +import org.eclipse.gef.editpolicies.NonResizableEditPolicy; +import org.eclipse.gef.requests.CreateRequest; +import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; +import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout; +import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultGraphicalNodeEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.PapyrusReflowableShapeEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.IPapyrusNodeFigure; +import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.RoundedRectangleNodePlateFigure; +import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.SelectableBorderedNodeFigure; +import org.eclipse.papyrus.uml.diagram.common.editparts.AbstractCommentEditPart; +import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy; +import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy; +import org.eclipse.papyrus.uml.diagram.common.figure.node.HTMLCornerBentFigure; +import org.eclipse.papyrus.uml.diagram.communication.edit.policies.OpenDiagramEditPolicy; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry; +import org.eclipse.swt.graphics.Color; + +/** + * @generated + */ +public class CommentEditPartCN extends AbstractCommentEditPart { + + /** + * @generated + */ + public static final String VISUAL_ID = "Comment_Shape"; + + /** + * @generated + */ + protected IFigure contentPane; + + /** + * @generated + */ + protected IFigure primaryShape; + + /** + * @generated + */ + public CommentEditPartCN(View view) { + super(view); + } + + /** + * @generated + */ + 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()); + // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies + // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); + } + + /** + * @generated + */ + protected LayoutEditPolicy createLayoutEditPolicy() { + org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() { + + @Override + protected EditPolicy createChildEditPolicy(EditPart child) { + EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); + if (result == null) { + result = new NonResizableEditPolicy(); + } + return result; + } + + @Override + protected Command getMoveChildrenCommand(Request request) { + return null; + } + + @Override + protected Command getCreateCommand(CreateRequest request) { + return null; + } + }; + return lep; + } + + /** + *Papyrus codeGen + *@generated + **/ + protected void handleNotificationEvent(Notification event) { + super.handleNotificationEvent(event); + + } + + /** + * @generated + */ + protected IFigure createNodeShape() { + return primaryShape = new HTMLCornerBentFigure(); + } + + /** + * org.eclipse.papyrus.uml.diagram.common.figure.node.HTMLCornerBentFigure + * @generated + */ + public HTMLCornerBentFigure getPrimaryShape() { + return (HTMLCornerBentFigure) primaryShape; + } + + /** + * @generated + */ + protected boolean addFixedChild(EditPart childEditPart) { + if (childEditPart instanceof CommentBodyEditPartCN) { + ((CommentBodyEditPartCN) childEditPart).setLabel(getPrimaryShape().getCornerBentFigure()); + return true; + } + + + return false; + } + + /** + * @generated + */ + protected boolean removeFixedChild(EditPart childEditPart) { + if (childEditPart instanceof CommentBodyEditPartCN) { + return true; + } + return false; + } + + /** + * @generated + */ + protected void addChildVisual(EditPart childEditPart, int index) { + if (addFixedChild(childEditPart)) { + return; + } + super.addChildVisual(childEditPart, -1); + } + + /** + * @generated + */ + protected void removeChildVisual(EditPart childEditPart) { + if (removeFixedChild(childEditPart)) { + return; + } + super.removeChildVisual(childEditPart); + } + + /** + * @generated + */ + protected IFigure getContentPaneFor(IGraphicalEditPart editPart) { + return getContentPane(); + } + + /** + * @generated + */ + protected NodeFigure createNodePlate() { + RoundedRectangleNodePlateFigure result = new RoundedRectangleNodePlateFigure(40, 40); + return result; + } + + /** + * Creates figure for this edit part. + * + * Body of this method does not depend on settings in generation model + * so you may safely remove <i>generated</i> tag and modify it. + * + * @generated + */ + protected NodeFigure createNodeFigure() { + 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 + * @generated + */ + protected IFigure setupContentPane(IFigure nodeShape) { + if (nodeShape.getLayoutManager() == null) { + ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout(); + layout.setSpacing(5); + nodeShape.setLayoutManager(layout); + } + return nodeShape; // use nodeShape itself as contentPane + } + + /** + * @generated + */ + public IFigure getContentPane() { + if (contentPane != null) { + return contentPane; + } + return super.getContentPane(); + } + + /** + * @generated + */ + protected void setForegroundColor(Color color) { + if (primaryShape != null) { + primaryShape.setForegroundColor(color); + } + } + + /** + * @generated + */ + protected void setLineWidth(int width) { + super.setLineWidth(width); + } + + /** + * @generated + */ + protected void setLineType(int style) { + if (primaryShape instanceof IPapyrusNodeFigure) { + ((IPapyrusNodeFigure) primaryShape).setLineStyle(style); + } + } + + /** + * @generated + */ + public EditPart getPrimaryChildEditPart() { + return getChildBySemanticHint(UMLVisualIDRegistry.getType(CommentBodyEditPartCN.VISUAL_ID)); + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/ConnectorDurationObservationEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/ConnectorDurationObservationEditPart.java index 346cdc77867..4a695f24db9 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/ConnectorDurationObservationEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/ConnectorDurationObservationEditPart.java @@ -1,66 +1,66 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.edit.parts;
-
-import org.eclipse.draw2d.Connection;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpart.ConnectionEditPart;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.figure.edge.SimpleDashedEdgeFigure;
-
-/**
- * @generated
- */
-public class ConnectorDurationObservationEditPart extends ConnectionEditPart implements ITreeBranchEditPart {
-
- /**
- * @generated
- */
- public static final String VISUAL_ID = "DurationObservation_EventEdge";
-
- /**
- * @generated
- */
- public ConnectorDurationObservationEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
- }
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected Connection createConnectionFigure() {
- return new SimpleDashedEdgeFigure();
- }
-
- /**
- * @generated
- */
- public SimpleDashedEdgeFigure getPrimaryShape() {
- return (SimpleDashedEdgeFigure) getFigure();
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.edit.parts; + +import org.eclipse.draw2d.Connection; +import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.papyrus.infra.gmfdiag.common.editpart.ConnectionEditPart; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy; +import org.eclipse.papyrus.uml.diagram.common.figure.edge.SimpleDashedEdgeFigure; + +/** + * @generated + */ +public class ConnectorDurationObservationEditPart extends ConnectionEditPart implements ITreeBranchEditPart { + + /** + * @generated + */ + public static final String VISUAL_ID = "DurationObservation_EventEdge"; + + /** + * @generated + */ + public ConnectorDurationObservationEditPart(View view) { + super(view); + } + + /** + * @generated + */ + protected void createDefaultEditPolicies() { + super.createDefaultEditPolicies(); + installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy()); + } + + /** + * Creates figure for this edit part. + * + * Body of this method does not depend on settings in generation model + * so you may safely remove <i>generated</i> tag and modify it. + * + * @generated + */ + protected Connection createConnectionFigure() { + return new SimpleDashedEdgeFigure(); + } + + /** + * @generated + */ + public SimpleDashedEdgeFigure getPrimaryShape() { + return (SimpleDashedEdgeFigure) getFigure(); + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/ConnectorTimeObservationEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/ConnectorTimeObservationEditPart.java index 87946f4e7c3..a6d7f87e860 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/ConnectorTimeObservationEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/ConnectorTimeObservationEditPart.java @@ -1,66 +1,66 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.edit.parts;
-
-import org.eclipse.draw2d.Connection;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpart.ConnectionEditPart;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.figure.edge.SimpleDashedEdgeFigure;
-
-/**
- * @generated
- */
-public class ConnectorTimeObservationEditPart extends ConnectionEditPart implements ITreeBranchEditPart {
-
- /**
- * @generated
- */
- public static final String VISUAL_ID = "TimeObservation_EventEdge";
-
- /**
- * @generated
- */
- public ConnectorTimeObservationEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
- }
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected Connection createConnectionFigure() {
- return new SimpleDashedEdgeFigure();
- }
-
- /**
- * @generated
- */
- public SimpleDashedEdgeFigure getPrimaryShape() {
- return (SimpleDashedEdgeFigure) getFigure();
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.edit.parts; + +import org.eclipse.draw2d.Connection; +import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.papyrus.infra.gmfdiag.common.editpart.ConnectionEditPart; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy; +import org.eclipse.papyrus.uml.diagram.common.figure.edge.SimpleDashedEdgeFigure; + +/** + * @generated + */ +public class ConnectorTimeObservationEditPart extends ConnectionEditPart implements ITreeBranchEditPart { + + /** + * @generated + */ + public static final String VISUAL_ID = "TimeObservation_EventEdge"; + + /** + * @generated + */ + public ConnectorTimeObservationEditPart(View view) { + super(view); + } + + /** + * @generated + */ + protected void createDefaultEditPolicies() { + super.createDefaultEditPolicies(); + installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy()); + } + + /** + * Creates figure for this edit part. + * + * Body of this method does not depend on settings in generation model + * so you may safely remove <i>generated</i> tag and modify it. + * + * @generated + */ + protected Connection createConnectionFigure() { + return new SimpleDashedEdgeFigure(); + } + + /** + * @generated + */ + public SimpleDashedEdgeFigure getPrimaryShape() { + return (SimpleDashedEdgeFigure) getFigure(); + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/ConstraintBodyEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/ConstraintBodyEditPartCN.java index 3cac77b5349..448ff28dac9 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/ConstraintBodyEditPartCN.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/ConstraintBodyEditPartCN.java @@ -1,830 +1,830 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.ICustomDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IControlParserForDirectEdit;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusCompartmentEditPart;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.parsers.ParserUtil;
-import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.edit.policies.DefaultNodeLabelDragPolicy;
-import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.uml.diagram.communication.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.uml.diagram.communication.providers.UMLElementTypes;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.uml2.uml.Feature;
-
-/**
- * @generated
- */
-public class ConstraintBodyEditPartCN extends PapyrusCompartmentEditPart
- implements ITextAwareEditPart, IControlParserForDirectEdit {
-
- /**
- * @generated
- */
- public static final String VISUAL_ID = "Constraint_BodyLabel";
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
- /**
- * 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
- */
- public ConstraintBodyEditPartCN(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DefaultNodeLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if (figure instanceof WrappingLabel) {
- return ((WrappingLabel) figure).getText();
- } else if (figure instanceof ILabelFigure) {
- return ((ILabelFigure) figure).getText();
- } else {
- return ((Label) figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if (figure instanceof WrappingLabel) {
- ((WrappingLabel) figure).setText(text);
- } else if (figure instanceof ILabelFigure) {
- ((ILabelFigure) figure).setText(text);
- } else {
- ((Label) figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if (figure instanceof WrappingLabel) {
- return ((WrappingLabel) figure).getIcon();
- } else if (figure instanceof ILabelFigure) {
- return ((ILabelFigure) figure).getIcon();
- } else {
- return ((Label) figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if (figure instanceof WrappingLabel) {
- ((WrappingLabel) figure).setIcon(icon);
- } else if (figure instanceof ILabelFigure) {
- ((ILabelFigure) figure).setIcon(icon);
- } else {
- ((Label) figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(IFigure figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List<?> getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- public void setParser(IParser parser) {
- this.parser = parser;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if (parserElement != null && getParser() != null) {
- text = getParser().getPrintString(
- ParserUtil.getParserAdapter(getParserElement(), this),
- getParserOptions().intValue());
- }
- if (text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if (getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(
- ParserUtil.getParserAdapter(getParserElement(), this),
- getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- @Override
- public String isValid(final Object value) {
- if (value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(ParserUtil.getParserAdapter(getParserElement(), ConstraintBodyEditPartCN.this), (String) value));
- }
- });
- return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if (getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(ParserUtil.getParserAdapter(getParserElement(), this));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if (parser == null) {
- parser = ParserUtil.getParser(UMLElementTypes.Constraint_Shape, getParserElement(), this, VISUAL_ID);
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if (manager == null) {
- setManager(new MultilineLabelDirectEditManager(this,
- MultilineLabelDirectEditManager.getTextCellEditorClass(this),
- UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- BusyIndicator.showWhile(Display.getDefault(), new java.lang.Runnable() {
-
- @Override
- public void run() {
- getManager().show();
- }
- });
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if (getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(char initialCharacter) {
- if (getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager) getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch (directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if (configuration == null || configuration.getLanguage() == null) {
- // Create default edit manager
- 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));
- initializeDirectEditManager(theRequest);
- return;
- } else if (configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if (configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if (configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if (Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
- initializeDirectEditManager(theRequest);
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void initializeDirectEditManager(final Request request) {
- // 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);
- performDirectEdit(initialChar.charValue());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if (maskLabelPolicy == null) {
- maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
- }
- if (maskLabelPolicy == null) {
- View view = (View) getModel();
- if (view.isVisible()) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- } else {
- setLabelTextHelper(getFigure(), ""); //$NON-NLS-1$
- setLabelIconHelper(getFigure(), null);
- }
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
- if (style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
- }
- if (resolveSemanticElement() instanceof Feature) {
- if (((Feature) resolveSemanticElement()).isStatic()) {
- ((WrappingLabel) getFigure()).setTextUnderline(true);
- } else {
- ((WrappingLabel) getFigure()).setTextUnderline(false);
- }
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
- if (style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
- if (style != null) {
- FontData fontData = new FontData(
- style.getFontName(), style.getFontHeight(),
- (style.isBold() ? SWT.BOLD : SWT.NORMAL) |
- (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if (getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
- for (int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if (parserElements != null) {
- for (int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if (accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- @Override
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return getPrimaryView();
- }
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if (checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if (checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if (configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if (languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
- } else {
- 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(), 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
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- @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);
- performDirectEdit(initialChar.charValue());
- } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest) theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * @generated
- */
- protected void addNotationalListeners() {
- super.addNotationalListeners();
- addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- protected void removeNotationalListeners() {
- super.removeNotationalListeners();
- removeListenerFilter("PrimaryView"); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- refreshLabel();
- Object feature = event.getFeature();
- if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer) event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) ||
- NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) ||
- NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) ||
- NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if (getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser) getParser();
- if (modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if (resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
- /**
- * @generated
- */
- private static final String ADD_PARENT_MODEL = "AddParentModel";
-
- /**
- * @generated
- */
- public void activate() {
- super.activate();
- addOwnerElementListeners();
- }
-
- /**
- * @generated
- */
- protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
-
- }
-
- /**
- * @generated
- */
- public void deactivate() {
- removeOwnerElementListeners();
- super.deactivate();
-
- }
-
- /**
- * @generated
- */
- protected void removeOwnerElementListeners() {
- removeListenerFilter(ADD_PARENT_MODEL);
-
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.edit.parts; + +import java.util.Collections; +import java.util.List; + +import org.eclipse.draw2d.IFigure; +import org.eclipse.draw2d.Label; +import org.eclipse.draw2d.geometry.Point; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.transaction.RecordingCommand; +import org.eclipse.emf.transaction.RunnableWithResult; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.gef.AccessibleEditPart; +import org.eclipse.gef.EditPolicy; +import org.eclipse.gef.Request; +import org.eclipse.gef.requests.DirectEditRequest; +import org.eclipse.gef.tools.DirectEditManager; +import org.eclipse.gmf.runtime.common.ui.services.parser.IParser; +import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus; +import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions; +import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy; +import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry; +import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants; +import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager; +import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; +import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser; +import org.eclipse.gmf.runtime.notation.FontStyle; +import org.eclipse.gmf.runtime.notation.NotationPackage; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.text.contentassist.IContentAssistProcessor; +import org.eclipse.jface.viewers.ICellEditorValidator; +import org.eclipse.jface.window.Window; +import org.eclipse.papyrus.extensionpoints.editors.Activator; +import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.configuration.ICustomDirectEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog; +import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog; +import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper; +import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil; +import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds; +import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IControlParserForDirectEdit; +import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusCompartmentEditPart; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.parsers.ParserUtil; +import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.edit.policies.DefaultNodeLabelDragPolicy; +import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager; +import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition; +import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure; +import org.eclipse.papyrus.uml.diagram.communication.edit.policies.UMLTextSelectionEditPolicy; +import org.eclipse.papyrus.uml.diagram.communication.providers.UMLElementTypes; +import org.eclipse.swt.SWT; +import org.eclipse.swt.accessibility.AccessibleEvent; +import org.eclipse.swt.custom.BusyIndicator; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.graphics.FontData; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.widgets.Display; +import org.eclipse.ui.PlatformUI; +import org.eclipse.uml2.uml.Feature; + +/** + * @generated + */ +public class ConstraintBodyEditPartCN extends PapyrusCompartmentEditPart + implements ITextAwareEditPart, IControlParserForDirectEdit { + + /** + * @generated + */ + public static final String VISUAL_ID = "Constraint_BodyLabel"; + + /** + * @generated + */ + private DirectEditManager manager; + + /** + * @generated + */ + private IParser parser; + + /** + * @generated + */ + private List<?> parserElements; + + /** + * @generated + */ + private String defaultText; + + /** + * 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 + */ + public ConstraintBodyEditPartCN(View view) { + super(view); + } + + /** + * @generated + */ + protected void createDefaultEditPolicies() { + super.createDefaultEditPolicies(); + installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy()); + installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy()); + installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DefaultNodeLabelDragPolicy()); + } + + /** + * @generated + */ + protected String getLabelTextHelper(IFigure figure) { + if (figure instanceof WrappingLabel) { + return ((WrappingLabel) figure).getText(); + } else if (figure instanceof ILabelFigure) { + return ((ILabelFigure) figure).getText(); + } else { + return ((Label) figure).getText(); + } + } + + /** + * @generated + */ + protected void setLabelTextHelper(IFigure figure, String text) { + if (figure instanceof WrappingLabel) { + ((WrappingLabel) figure).setText(text); + } else if (figure instanceof ILabelFigure) { + ((ILabelFigure) figure).setText(text); + } else { + ((Label) figure).setText(text); + } + } + + /** + * @generated + */ + protected Image getLabelIconHelper(IFigure figure) { + if (figure instanceof WrappingLabel) { + return ((WrappingLabel) figure).getIcon(); + } else if (figure instanceof ILabelFigure) { + return ((ILabelFigure) figure).getIcon(); + } else { + return ((Label) figure).getIcon(); + } + } + + /** + * @generated + */ + protected void setLabelIconHelper(IFigure figure, Image icon) { + if (figure instanceof WrappingLabel) { + ((WrappingLabel) figure).setIcon(icon); + } else if (figure instanceof ILabelFigure) { + ((ILabelFigure) figure).setIcon(icon); + } else { + ((Label) figure).setIcon(icon); + } + } + + /** + * @generated + */ + public void setLabel(IFigure figure) { + unregisterVisuals(); + setFigure(figure); + defaultText = getLabelTextHelper(figure); + registerVisuals(); + refreshVisuals(); + } + + /** + * @generated + */ + protected List<?> getModelChildren() { + return Collections.EMPTY_LIST; + } + + /** + * @generated + */ + public IGraphicalEditPart getChildBySemanticHint(String semanticHint) { + return null; + } + + /** + * @generated + */ + public void setParser(IParser parser) { + this.parser = parser; + } + + /** + * @generated + */ + protected EObject getParserElement() { + return resolveSemanticElement(); + } + + /** + * @generated + */ + protected Image getLabelIcon() { + return null; + } + + /** + * @generated + */ + protected String getLabelText() { + String text = null; + EObject parserElement = getParserElement(); + if (parserElement != null && getParser() != null) { + text = getParser().getPrintString( + ParserUtil.getParserAdapter(getParserElement(), this), + getParserOptions().intValue()); + } + if (text == null || text.length() == 0) { + text = defaultText; + } + return text; + } + + /** + * @generated + */ + public void setLabelText(String text) { + setLabelTextHelper(getFigure(), text); + Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); + if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); + } + Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE); + if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback(); + } + } + + /** + * @generated + */ + public String getEditText() { + if (getParserElement() == null || getParser() == null) { + return ""; //$NON-NLS-1$ + } + return getParser().getEditString( + ParserUtil.getParserAdapter(getParserElement(), this), + getParserOptions().intValue()); + } + + /** + * @generated + */ + protected boolean isEditable() { + return getParser() != null; + } + + /** + * @generated + */ + public ICellEditorValidator getEditTextValidator() { + return new ICellEditorValidator() { + + @Override + public String isValid(final Object value) { + if (value instanceof String) { + final EObject element = getParserElement(); + final IParser parser = getParser(); + try { + IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive( + new RunnableWithResult.Impl<java.lang.Object>() { + + @Override + public void run() { + setResult(parser.isValidEditString(ParserUtil.getParserAdapter(getParserElement(), ConstraintBodyEditPartCN.this), (String) value)); + } + }); + return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage(); + } catch (InterruptedException ie) { + ie.printStackTrace(); + } + } + + // shouldn't get here + return null; + } + }; + } + + /** + * @generated + */ + public IContentAssistProcessor getCompletionProcessor() { + if (getParserElement() == null || getParser() == null) { + return null; + } + return getParser().getCompletionProcessor(ParserUtil.getParserAdapter(getParserElement(), this)); + } + + /** + * @generated + */ + public ParserOptions getParserOptions() { + return ParserOptions.NONE; + } + + /** + * @generated + */ + public IParser getParser() { + if (parser == null) { + parser = ParserUtil.getParser(UMLElementTypes.Constraint_Shape, getParserElement(), this, VISUAL_ID); + } + return parser; + } + + /** + * @generated + */ + protected DirectEditManager getManager() { + if (manager == null) { + setManager(new MultilineLabelDirectEditManager(this, + MultilineLabelDirectEditManager.getTextCellEditorClass(this), + UMLEditPartFactory.getTextCellEditorLocator(this))); + } + return manager; + } + + /** + * @generated + */ + protected void setManager(DirectEditManager manager) { + this.manager = manager; + } + + /** + * @generated + */ + protected void performDirectEdit() { + BusyIndicator.showWhile(Display.getDefault(), new java.lang.Runnable() { + + @Override + public void run() { + getManager().show(); + } + }); + } + + /** + * @generated + */ + protected void performDirectEdit(Point eventLocation) { + if (getManager() instanceof TextDirectEditManager) { + ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint()); + } + } + + /** + * @generated + */ + protected void performDirectEdit(char initialCharacter) { + if (getManager() instanceof TextDirectEditManager) { + ((TextDirectEditManager) getManager()).show(initialCharacter); + } else { + performDirectEdit(); + } + } + + /** + * @generated + */ + protected void performDirectEditRequest(Request request) { + + final Request theRequest = request; + + if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) { + directEditionMode = getDirectEditionType(); + } + switch (directEditionMode) { + case IDirectEdition.NO_DIRECT_EDITION: + // no direct edition mode => does nothing + return; + case IDirectEdition.EXTENDED_DIRECT_EDITOR: + updateExtendedEditorConfiguration(); + if (configuration == null || configuration.getLanguage() == null) { + // Create default edit manager + 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)); + initializeDirectEditManager(theRequest); + return; + } else if (configuration instanceof IPopupEditorConfiguration) { + IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this); + helper.showEditor(); + return; + } else if (configuration instanceof IAdvancedEditorConfiguration) { + dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement())); + } else if (configuration instanceof IDirectEditorConfiguration) { + dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration); + } else { + return; + } + final Dialog finalDialog = dialog; + + if (Window.OK == dialog.open()) { + TransactionalEditingDomain domain = getEditingDomain(); + RecordingCommand command = new RecordingCommand(domain, "Edit Label") { + + @Override + protected void doExecute() { + configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue()); + + } + }; + domain.getCommandStack().execute(command); + } + } + break; + case IDirectEdition.DEFAULT_DIRECT_EDITOR: + initializeDirectEditManager(theRequest); + break; + default: + break; + } + } + + /** + * @generated + */ + protected void initializeDirectEditManager(final Request request) { + // 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); + performDirectEdit(initialChar.charValue()); + } else { + performDirectEdit(); + } + } + } + }); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + /** + * @generated + */ + protected void refreshVisuals() { + super.refreshVisuals(); + refreshLabel(); + refreshFont(); + refreshFontColor(); + refreshUnderline(); + refreshStrikeThrough(); + } + + /** + * @generated + */ + protected void refreshLabel() { + EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY); + if (maskLabelPolicy == null) { + maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL); + } + if (maskLabelPolicy == null) { + View view = (View) getModel(); + if (view.isVisible()) { + setLabelTextHelper(getFigure(), getLabelText()); + setLabelIconHelper(getFigure(), getLabelIcon()); + } else { + setLabelTextHelper(getFigure(), ""); //$NON-NLS-1$ + setLabelIconHelper(getFigure(), null); + } + } + Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); + if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); + } + Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE); + if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback(); + } + } + + /** + * @generated + */ + protected void refreshUnderline() { + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( + NotationPackage.eINSTANCE.getFontStyle()); + if (style != null && getFigure() instanceof WrappingLabel) { + ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline()); + } + if (resolveSemanticElement() instanceof Feature) { + if (((Feature) resolveSemanticElement()).isStatic()) { + ((WrappingLabel) getFigure()).setTextUnderline(true); + } else { + ((WrappingLabel) getFigure()).setTextUnderline(false); + } + } + } + + /** + * @generated + */ + protected void refreshStrikeThrough() { + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( + NotationPackage.eINSTANCE.getFontStyle()); + if (style != null && getFigure() instanceof WrappingLabel) { + ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough()); + } + } + + /** + * @generated + */ + protected void refreshFont() { + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( + NotationPackage.eINSTANCE.getFontStyle()); + if (style != null) { + FontData fontData = new FontData( + style.getFontName(), style.getFontHeight(), + (style.isBold() ? SWT.BOLD : SWT.NORMAL) | + (style.isItalic() ? SWT.ITALIC : SWT.NORMAL)); + setFont(fontData); + } + } + + /** + * @generated + */ + protected void setFontColor(Color color) { + getFigure().setForegroundColor(color); + } + + /** + * @generated + */ + protected void addSemanticListeners() { + if (getParser() instanceof ISemanticParser) { + EObject element = resolveSemanticElement(); + parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element); + for (int i = 0; i < parserElements.size(); i++) { + addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$ + } + } else { + super.addSemanticListeners(); + } + } + + /** + * @generated + */ + protected void removeSemanticListeners() { + if (parserElements != null) { + for (int i = 0; i < parserElements.size(); i++) { + removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$ + } + } else { + super.removeSemanticListeners(); + } + } + + /** + * @generated + */ + protected AccessibleEditPart getAccessibleEditPart() { + if (accessibleEP == null) { + accessibleEP = new AccessibleGraphicalEditPart() { + + @Override + public void getName(AccessibleEvent e) { + e.result = getLabelTextHelper(getFigure()); + } + }; + } + return accessibleEP; + } + + /** + * @generated + */ + private View getFontStyleOwnerView() { + return getPrimaryView(); + } + + /** + * Returns the kind of associated editor for direct edition. + * + * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition + * @generated + */ + public int getDirectEditionType() { + if (checkExtendedEditor()) { + initExtendedEditorConfiguration(); + return IDirectEdition.EXTENDED_DIRECT_EDITOR; + } + if (checkDefaultEdition()) { + return IDirectEdition.DEFAULT_DIRECT_EDITOR; + } + + // not a named element. no specific editor => do nothing + return IDirectEdition.NO_DIRECT_EDITION; + } + + /** + * Checks if an extended editor is present. + * + * @return <code>true</code> if an extended editor is present. + * @generated + */ + protected boolean checkExtendedEditor() { + if (resolveSemanticElement() != null) { + return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this); + } + return false; + } + + /** + * Checks if a default direct edition is available + * + * @return <code>true</code> if a default direct edition is available + * @generated + */ + protected boolean checkDefaultEdition() { + return (getParser() != null); + } + + /** + * Initializes the extended editor configuration + * @generated + */ + protected void initExtendedEditorConfiguration() { + if (configuration == null) { + final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName()); + if (languagePreferred != null && !languagePreferred.equals("")) { + configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this); + } else { + 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(), 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 + * @generated + */ + protected void performDefaultDirectEditorEdit(final Request theRequest) { + // initialize the direct edit manager + try { + getEditingDomain().runExclusive(new Runnable() { + + @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); + performDirectEdit(initialChar.charValue()); + } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) { + DirectEditRequest editRequest = (DirectEditRequest) theRequest; + performDirectEdit(editRequest.getLocation()); + } else { + performDirectEdit(); + } + } + } + }); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + /** + * @generated + */ + protected void addNotationalListeners() { + super.addNotationalListeners(); + addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$ + } + + /** + * @generated + */ + protected void removeNotationalListeners() { + super.removeNotationalListeners(); + removeListenerFilter("PrimaryView"); //$NON-NLS-1$ + } + + /** + * @generated + */ + protected void handleNotificationEvent(Notification event) { + refreshLabel(); + Object feature = event.getFeature(); + if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) { + Integer c = (Integer) event.getNewValue(); + setFontColor(DiagramColorRegistry.getInstance().getColor(c)); + } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) { + refreshUnderline(); + } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) { + refreshStrikeThrough(); + } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || + NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || + NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || + NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) { + refreshFont(); + } else { + if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) { + refreshLabel(); + } + if (getParser() instanceof ISemanticParser) { + ISemanticParser modelParser = (ISemanticParser) getParser(); + if (modelParser.areSemanticElementsAffected(null, event)) { + removeSemanticListeners(); + if (resolveSemanticElement() != null) { + addSemanticListeners(); + } + refreshLabel(); + } + } + } + super.handleNotificationEvent(event); + } + + /** + * @generated + */ + protected IFigure createFigure() { + // Parent should assign one using setLabel() method + return null; + } + + /** + * @generated + */ + private static final String ADD_PARENT_MODEL = "AddParentModel"; + + /** + * @generated + */ + public void activate() { + super.activate(); + addOwnerElementListeners(); + } + + /** + * @generated + */ + protected void addOwnerElementListeners() { + addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel())); + + } + + /** + * @generated + */ + public void deactivate() { + removeOwnerElementListeners(); + super.deactivate(); + + } + + /** + * @generated + */ + protected void removeOwnerElementListeners() { + removeListenerFilter(ADD_PARENT_MODEL); + + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/ConstraintConstrainedElementEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/ConstraintConstrainedElementEditPart.java index 0a79d8b5b37..12c7e56bbf0 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/ConstraintConstrainedElementEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/ConstraintConstrainedElementEditPart.java @@ -1,66 +1,66 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.edit.parts;
-
-import org.eclipse.draw2d.Connection;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.editparts.UMLConnectionNodeEditPart;
-import org.eclipse.papyrus.uml.diagram.common.figure.edge.SimpleDashedEdgeFigure;
-
-/**
- * @generated
- */
-public class ConstraintConstrainedElementEditPart extends UMLConnectionNodeEditPart implements ITreeBranchEditPart {
-
- /**
- * @generated
- */
- public static final String VISUAL_ID = "Constraint_ConstrainedElementEdge";
-
- /**
- * @generated
- */
- public ConstraintConstrainedElementEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
- }
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected Connection createConnectionFigure() {
- return new SimpleDashedEdgeFigure();
- }
-
- /**
- * @generated
- */
- public SimpleDashedEdgeFigure getPrimaryShape() {
- return (SimpleDashedEdgeFigure) getFigure();
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.edit.parts; + +import org.eclipse.draw2d.Connection; +import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy; +import org.eclipse.papyrus.uml.diagram.common.editparts.UMLConnectionNodeEditPart; +import org.eclipse.papyrus.uml.diagram.common.figure.edge.SimpleDashedEdgeFigure; + +/** + * @generated + */ +public class ConstraintConstrainedElementEditPart extends UMLConnectionNodeEditPart implements ITreeBranchEditPart { + + /** + * @generated + */ + public static final String VISUAL_ID = "Constraint_ConstrainedElementEdge"; + + /** + * @generated + */ + public ConstraintConstrainedElementEditPart(View view) { + super(view); + } + + /** + * @generated + */ + protected void createDefaultEditPolicies() { + super.createDefaultEditPolicies(); + installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy()); + } + + /** + * Creates figure for this edit part. + * + * Body of this method does not depend on settings in generation model + * so you may safely remove <i>generated</i> tag and modify it. + * + * @generated + */ + protected Connection createConnectionFigure() { + return new SimpleDashedEdgeFigure(); + } + + /** + * @generated + */ + public SimpleDashedEdgeFigure getPrimaryShape() { + return (SimpleDashedEdgeFigure) getFigure(); + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/ConstraintEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/ConstraintEditPartCN.java index e073d658cc3..22b0e1e7bf6 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/ConstraintEditPartCN.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/ConstraintEditPartCN.java @@ -1,266 +1,266 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.edit.parts;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.LayoutEditPolicy;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-import org.eclipse.gef.requests.CreateRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
-import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultGraphicalNodeEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.IPapyrusNodeFigure;
-import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.RoundedRectangleNodePlateFigure;
-import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.SelectableBorderedNodeFigure;
-import org.eclipse.papyrus.uml.diagram.common.editparts.AbstractConstraintEditPart;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.ConstraintFigure;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * @generated
- */
-public class ConstraintEditPartCN extends AbstractConstraintEditPart {
-
- /**
- * @generated
- */
- public static final String VISUAL_ID = "Constraint_Shape";
-
- /**
- * @generated
- */
- protected IFigure contentPane;
-
- /**
- * @generated
- */
- protected IFigure primaryShape;
-
- /**
- * @generated
- */
- public ConstraintEditPartCN(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
-
- installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
-
- installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
- // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
- // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
- }
-
- /**
- * @generated
- */
- protected LayoutEditPolicy createLayoutEditPolicy() {
- org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
-
- @Override
- protected EditPolicy createChildEditPolicy(EditPart child) {
- EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (result == null) {
- result = new NonResizableEditPolicy();
- }
- return result;
- }
-
- @Override
- protected Command getMoveChildrenCommand(Request request) {
- return null;
- }
-
- @Override
- protected Command getCreateCommand(CreateRequest request) {
- return null;
- }
- };
- return lep;
- }
-
- /**
- *Papyrus codeGen
- *@generated
- **/
- protected void handleNotificationEvent(Notification event) {
- super.handleNotificationEvent(event);
-
- }
-
- /**
- * @generated
- */
- protected IFigure createNodeShape() {
- return primaryShape = new ConstraintFigure();
- }
-
- /**
- * org.eclipse.papyrus.uml.diagram.common.figure.node.ConstraintFigure
- * @generated
- */
- public ConstraintFigure getPrimaryShape() {
- return (ConstraintFigure) primaryShape;
- }
-
- /**
- * @generated
- */
- protected boolean addFixedChild(EditPart childEditPart) {
- if (childEditPart instanceof ConstraintNameEditPartCN) {
- ((ConstraintNameEditPartCN) childEditPart).setLabel(getPrimaryShape().getNameLabel());
- return true;
- }
- if (childEditPart instanceof ConstraintBodyEditPartCN) {
- ((ConstraintBodyEditPartCN) childEditPart).setLabel(getPrimaryShape().getConstraintFigure());
- return true;
- }
-
-
- return false;
- }
-
- /**
- * @generated
- */
- protected boolean removeFixedChild(EditPart childEditPart) {
- if (childEditPart instanceof ConstraintNameEditPartCN) {
- return true;
- }
- if (childEditPart instanceof ConstraintBodyEditPartCN) {
- return true;
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected void addChildVisual(EditPart childEditPart, int index) {
- if (addFixedChild(childEditPart)) {
- return;
- }
- super.addChildVisual(childEditPart, -1);
- }
-
- /**
- * @generated
- */
- protected void removeChildVisual(EditPart childEditPart) {
- if (removeFixedChild(childEditPart)) {
- return;
- }
- super.removeChildVisual(childEditPart);
- }
-
- /**
- * @generated
- */
- protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- return getContentPane();
- }
-
- /**
- * @generated
- */
- protected NodeFigure createNodePlate() {
- RoundedRectangleNodePlateFigure result = new RoundedRectangleNodePlateFigure(40, 40);
- return result;
- }
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected NodeFigure createNodeFigure() {
- 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
- * @generated
- */
- protected IFigure setupContentPane(IFigure nodeShape) {
- if (nodeShape.getLayoutManager() == null) {
- ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
- layout.setSpacing(5);
- nodeShape.setLayoutManager(layout);
- }
- return nodeShape; // use nodeShape itself as contentPane
- }
-
- /**
- * @generated
- */
- public IFigure getContentPane() {
- if (contentPane != null) {
- return contentPane;
- }
- return super.getContentPane();
- }
-
- /**
- * @generated
- */
- protected void setForegroundColor(Color color) {
- if (primaryShape != null) {
- primaryShape.setForegroundColor(color);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineWidth(int width) {
- super.setLineWidth(width);
- }
-
- /**
- * @generated
- */
- protected void setLineType(int style) {
- if (primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
- }
- }
-
- /**
- * @generated
- */
- public EditPart getPrimaryChildEditPart() {
- return getChildBySemanticHint(UMLVisualIDRegistry.getType(ConstraintNameEditPartCN.VISUAL_ID));
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.edit.parts; + +import org.eclipse.draw2d.IFigure; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.gef.EditPart; +import org.eclipse.gef.EditPolicy; +import org.eclipse.gef.Request; +import org.eclipse.gef.commands.Command; +import org.eclipse.gef.editpolicies.LayoutEditPolicy; +import org.eclipse.gef.editpolicies.NonResizableEditPolicy; +import org.eclipse.gef.requests.CreateRequest; +import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; +import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout; +import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultGraphicalNodeEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.IPapyrusNodeFigure; +import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.RoundedRectangleNodePlateFigure; +import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.SelectableBorderedNodeFigure; +import org.eclipse.papyrus.uml.diagram.common.editparts.AbstractConstraintEditPart; +import org.eclipse.papyrus.uml.diagram.common.figure.node.ConstraintFigure; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry; +import org.eclipse.swt.graphics.Color; + +/** + * @generated + */ +public class ConstraintEditPartCN extends AbstractConstraintEditPart { + + /** + * @generated + */ + public static final String VISUAL_ID = "Constraint_Shape"; + + /** + * @generated + */ + protected IFigure contentPane; + + /** + * @generated + */ + protected IFigure primaryShape; + + /** + * @generated + */ + public ConstraintEditPartCN(View view) { + super(view); + } + + /** + * @generated + */ + protected void createDefaultEditPolicies() { + super.createDefaultEditPolicies(); + installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy()); + + installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); + + installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); + // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies + // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); + } + + /** + * @generated + */ + protected LayoutEditPolicy createLayoutEditPolicy() { + org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() { + + @Override + protected EditPolicy createChildEditPolicy(EditPart child) { + EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); + if (result == null) { + result = new NonResizableEditPolicy(); + } + return result; + } + + @Override + protected Command getMoveChildrenCommand(Request request) { + return null; + } + + @Override + protected Command getCreateCommand(CreateRequest request) { + return null; + } + }; + return lep; + } + + /** + *Papyrus codeGen + *@generated + **/ + protected void handleNotificationEvent(Notification event) { + super.handleNotificationEvent(event); + + } + + /** + * @generated + */ + protected IFigure createNodeShape() { + return primaryShape = new ConstraintFigure(); + } + + /** + * org.eclipse.papyrus.uml.diagram.common.figure.node.ConstraintFigure + * @generated + */ + public ConstraintFigure getPrimaryShape() { + return (ConstraintFigure) primaryShape; + } + + /** + * @generated + */ + protected boolean addFixedChild(EditPart childEditPart) { + if (childEditPart instanceof ConstraintNameEditPartCN) { + ((ConstraintNameEditPartCN) childEditPart).setLabel(getPrimaryShape().getNameLabel()); + return true; + } + if (childEditPart instanceof ConstraintBodyEditPartCN) { + ((ConstraintBodyEditPartCN) childEditPart).setLabel(getPrimaryShape().getConstraintFigure()); + return true; + } + + + return false; + } + + /** + * @generated + */ + protected boolean removeFixedChild(EditPart childEditPart) { + if (childEditPart instanceof ConstraintNameEditPartCN) { + return true; + } + if (childEditPart instanceof ConstraintBodyEditPartCN) { + return true; + } + return false; + } + + /** + * @generated + */ + protected void addChildVisual(EditPart childEditPart, int index) { + if (addFixedChild(childEditPart)) { + return; + } + super.addChildVisual(childEditPart, -1); + } + + /** + * @generated + */ + protected void removeChildVisual(EditPart childEditPart) { + if (removeFixedChild(childEditPart)) { + return; + } + super.removeChildVisual(childEditPart); + } + + /** + * @generated + */ + protected IFigure getContentPaneFor(IGraphicalEditPart editPart) { + return getContentPane(); + } + + /** + * @generated + */ + protected NodeFigure createNodePlate() { + RoundedRectangleNodePlateFigure result = new RoundedRectangleNodePlateFigure(40, 40); + return result; + } + + /** + * Creates figure for this edit part. + * + * Body of this method does not depend on settings in generation model + * so you may safely remove <i>generated</i> tag and modify it. + * + * @generated + */ + protected NodeFigure createNodeFigure() { + 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 + * @generated + */ + protected IFigure setupContentPane(IFigure nodeShape) { + if (nodeShape.getLayoutManager() == null) { + ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout(); + layout.setSpacing(5); + nodeShape.setLayoutManager(layout); + } + return nodeShape; // use nodeShape itself as contentPane + } + + /** + * @generated + */ + public IFigure getContentPane() { + if (contentPane != null) { + return contentPane; + } + return super.getContentPane(); + } + + /** + * @generated + */ + protected void setForegroundColor(Color color) { + if (primaryShape != null) { + primaryShape.setForegroundColor(color); + } + } + + /** + * @generated + */ + protected void setLineWidth(int width) { + super.setLineWidth(width); + } + + /** + * @generated + */ + protected void setLineType(int style) { + if (primaryShape instanceof IPapyrusNodeFigure) { + ((IPapyrusNodeFigure) primaryShape).setLineStyle(style); + } + } + + /** + * @generated + */ + public EditPart getPrimaryChildEditPart() { + return getChildBySemanticHint(UMLVisualIDRegistry.getType(ConstraintNameEditPartCN.VISUAL_ID)); + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/ConstraintNameEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/ConstraintNameEditPartCN.java index a4a6e206de0..a4ad7f6c8fe 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/ConstraintNameEditPartCN.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/ConstraintNameEditPartCN.java @@ -1,837 +1,837 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.ICustomDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.papyrus.infra.emf.appearance.helper.AppearanceHelper;
-import org.eclipse.papyrus.infra.emf.appearance.helper.VisualInformationPapyrusConstants;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IControlParserForDirectEdit;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusCompartmentEditPart;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.parsers.ParserUtil;
-import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.edit.policies.DefaultNodeLabelDragPolicy;
-import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil;
-import org.eclipse.papyrus.uml.diagram.communication.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.uml.diagram.communication.providers.UMLElementTypes;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.uml2.uml.Feature;
-
-/**
- * @generated
- */
-public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart
- implements ITextAwareEditPart, IControlParserForDirectEdit {
-
- /**
- * @generated
- */
- public static final String VISUAL_ID = "Constraint_NameLabel";
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
- /**
- * 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
- */
- public ConstraintNameEditPartCN(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DefaultNodeLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if (figure instanceof WrappingLabel) {
- return ((WrappingLabel) figure).getText();
- } else if (figure instanceof ILabelFigure) {
- return ((ILabelFigure) figure).getText();
- } else {
- return ((Label) figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if (figure instanceof WrappingLabel) {
- ((WrappingLabel) figure).setText(text);
- } else if (figure instanceof ILabelFigure) {
- ((ILabelFigure) figure).setText(text);
- } else {
- ((Label) figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if (figure instanceof WrappingLabel) {
- return ((WrappingLabel) figure).getIcon();
- } else if (figure instanceof ILabelFigure) {
- return ((ILabelFigure) figure).getIcon();
- } else {
- return ((Label) figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if (figure instanceof WrappingLabel) {
- ((WrappingLabel) figure).setIcon(icon);
- } else if (figure instanceof ILabelFigure) {
- ((ILabelFigure) figure).setIcon(icon);
- } else {
- ((Label) figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(IFigure figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List<?> getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- public void setParser(IParser parser) {
- this.parser = parser;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramEditPartsUtil.getIcon(getParserElement(), getViewer());
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if (parserElement != null && getParser() != null) {
- text = getParser().getPrintString(
- ParserUtil.getParserAdapter(getParserElement(), this),
- getParserOptions().intValue());
- }
- if (text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if (getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(
- ParserUtil.getParserAdapter(getParserElement(), this),
- getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- @Override
- public String isValid(final Object value) {
- if (value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(ParserUtil.getParserAdapter(getParserElement(), ConstraintNameEditPartCN.this), (String) value));
- }
- });
- return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if (getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(ParserUtil.getParserAdapter(getParserElement(), this));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if (parser == null) {
- parser = ParserUtil.getParser(UMLElementTypes.Constraint_Shape, getParserElement(), this, VISUAL_ID);
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if (manager == null) {
- setManager(new MultilineLabelDirectEditManager(this,
- MultilineLabelDirectEditManager.getTextCellEditorClass(this),
- UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- BusyIndicator.showWhile(Display.getDefault(), new java.lang.Runnable() {
-
- @Override
- public void run() {
- getManager().show();
- }
- });
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if (getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(char initialCharacter) {
- if (getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager) getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch (directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if (configuration == null || configuration.getLanguage() == null) {
- // Create default edit manager
- 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));
- initializeDirectEditManager(theRequest);
- return;
- } else if (configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if (configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if (configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if (Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
- initializeDirectEditManager(theRequest);
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void initializeDirectEditManager(final Request request) {
- // 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);
- performDirectEdit(initialChar.charValue());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if (maskLabelPolicy == null) {
- maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
- }
- if (maskLabelPolicy == null) {
- View view = (View) getModel();
- if (view.isVisible()) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- } else {
- setLabelTextHelper(getFigure(), ""); //$NON-NLS-1$
- setLabelIconHelper(getFigure(), null);
- }
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
- if (style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
- }
- if (resolveSemanticElement() instanceof Feature) {
- if (((Feature) resolveSemanticElement()).isStatic()) {
- ((WrappingLabel) getFigure()).setTextUnderline(true);
- } else {
- ((WrappingLabel) getFigure()).setTextUnderline(false);
- }
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
- if (style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
- if (style != null) {
- FontData fontData = new FontData(
- style.getFontName(), style.getFontHeight(),
- (style.isBold() ? SWT.BOLD : SWT.NORMAL) |
- (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if (getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
- for (int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if (parserElements != null) {
- for (int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if (accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- @Override
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return getPrimaryView();
- }
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if (checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if (checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if (configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if (languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
- } else {
- 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(), 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
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- @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);
- performDirectEdit(initialChar.charValue());
- } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest) theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * @generated
- */
- protected void addNotationalListeners() {
- super.addNotationalListeners();
- addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- protected void removeNotationalListeners() {
- super.removeNotationalListeners();
- removeListenerFilter("PrimaryView"); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- refreshLabel();
- Object feature = event.getFeature();
- if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer) event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) ||
- NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) ||
- NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) ||
- NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if (getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser) getParser();
- if (modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if (resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
- if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
- refreshLabel();
- }
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
- /**
- * @generated
- */
- private static final String ADD_PARENT_MODEL = "AddParentModel";
-
- /**
- * @generated
- */
- public void activate() {
- super.activate();
- addOwnerElementListeners();
- }
-
- /**
- * @generated
- */
- protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
-
- }
-
- /**
- * @generated
- */
- public void deactivate() {
- removeOwnerElementListeners();
- super.deactivate();
-
- }
-
- /**
- * @generated
- */
- protected void removeOwnerElementListeners() {
- removeListenerFilter(ADD_PARENT_MODEL);
-
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.edit.parts; + +import java.util.Collections; +import java.util.List; + +import org.eclipse.draw2d.IFigure; +import org.eclipse.draw2d.Label; +import org.eclipse.draw2d.geometry.Point; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EAnnotation; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.transaction.RecordingCommand; +import org.eclipse.emf.transaction.RunnableWithResult; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.gef.AccessibleEditPart; +import org.eclipse.gef.EditPolicy; +import org.eclipse.gef.Request; +import org.eclipse.gef.requests.DirectEditRequest; +import org.eclipse.gef.tools.DirectEditManager; +import org.eclipse.gmf.runtime.common.ui.services.parser.IParser; +import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus; +import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions; +import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy; +import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry; +import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants; +import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager; +import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; +import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser; +import org.eclipse.gmf.runtime.notation.FontStyle; +import org.eclipse.gmf.runtime.notation.NotationPackage; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.text.contentassist.IContentAssistProcessor; +import org.eclipse.jface.viewers.ICellEditorValidator; +import org.eclipse.jface.window.Window; +import org.eclipse.papyrus.extensionpoints.editors.Activator; +import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.configuration.ICustomDirectEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog; +import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog; +import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper; +import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil; +import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds; +import org.eclipse.papyrus.infra.emf.appearance.helper.AppearanceHelper; +import org.eclipse.papyrus.infra.emf.appearance.helper.VisualInformationPapyrusConstants; +import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IControlParserForDirectEdit; +import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusCompartmentEditPart; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.parsers.ParserUtil; +import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.edit.policies.DefaultNodeLabelDragPolicy; +import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager; +import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition; +import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure; +import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil; +import org.eclipse.papyrus.uml.diagram.communication.edit.policies.UMLTextSelectionEditPolicy; +import org.eclipse.papyrus.uml.diagram.communication.providers.UMLElementTypes; +import org.eclipse.swt.SWT; +import org.eclipse.swt.accessibility.AccessibleEvent; +import org.eclipse.swt.custom.BusyIndicator; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.graphics.FontData; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.widgets.Display; +import org.eclipse.ui.PlatformUI; +import org.eclipse.uml2.uml.Feature; + +/** + * @generated + */ +public class ConstraintNameEditPartCN extends PapyrusCompartmentEditPart + implements ITextAwareEditPart, IControlParserForDirectEdit { + + /** + * @generated + */ + public static final String VISUAL_ID = "Constraint_NameLabel"; + + /** + * @generated + */ + private DirectEditManager manager; + + /** + * @generated + */ + private IParser parser; + + /** + * @generated + */ + private List<?> parserElements; + + /** + * @generated + */ + private String defaultText; + + /** + * 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 + */ + public ConstraintNameEditPartCN(View view) { + super(view); + } + + /** + * @generated + */ + protected void createDefaultEditPolicies() { + super.createDefaultEditPolicies(); + installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy()); + installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy()); + installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DefaultNodeLabelDragPolicy()); + } + + /** + * @generated + */ + protected String getLabelTextHelper(IFigure figure) { + if (figure instanceof WrappingLabel) { + return ((WrappingLabel) figure).getText(); + } else if (figure instanceof ILabelFigure) { + return ((ILabelFigure) figure).getText(); + } else { + return ((Label) figure).getText(); + } + } + + /** + * @generated + */ + protected void setLabelTextHelper(IFigure figure, String text) { + if (figure instanceof WrappingLabel) { + ((WrappingLabel) figure).setText(text); + } else if (figure instanceof ILabelFigure) { + ((ILabelFigure) figure).setText(text); + } else { + ((Label) figure).setText(text); + } + } + + /** + * @generated + */ + protected Image getLabelIconHelper(IFigure figure) { + if (figure instanceof WrappingLabel) { + return ((WrappingLabel) figure).getIcon(); + } else if (figure instanceof ILabelFigure) { + return ((ILabelFigure) figure).getIcon(); + } else { + return ((Label) figure).getIcon(); + } + } + + /** + * @generated + */ + protected void setLabelIconHelper(IFigure figure, Image icon) { + if (figure instanceof WrappingLabel) { + ((WrappingLabel) figure).setIcon(icon); + } else if (figure instanceof ILabelFigure) { + ((ILabelFigure) figure).setIcon(icon); + } else { + ((Label) figure).setIcon(icon); + } + } + + /** + * @generated + */ + public void setLabel(IFigure figure) { + unregisterVisuals(); + setFigure(figure); + defaultText = getLabelTextHelper(figure); + registerVisuals(); + refreshVisuals(); + } + + /** + * @generated + */ + protected List<?> getModelChildren() { + return Collections.EMPTY_LIST; + } + + /** + * @generated + */ + public IGraphicalEditPart getChildBySemanticHint(String semanticHint) { + return null; + } + + /** + * @generated + */ + public void setParser(IParser parser) { + this.parser = parser; + } + + /** + * @generated + */ + protected EObject getParserElement() { + return resolveSemanticElement(); + } + + /** + * @generated + */ + protected Image getLabelIcon() { + return org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramEditPartsUtil.getIcon(getParserElement(), getViewer()); + } + + /** + * @generated + */ + protected String getLabelText() { + String text = null; + EObject parserElement = getParserElement(); + if (parserElement != null && getParser() != null) { + text = getParser().getPrintString( + ParserUtil.getParserAdapter(getParserElement(), this), + getParserOptions().intValue()); + } + if (text == null || text.length() == 0) { + text = defaultText; + } + return text; + } + + /** + * @generated + */ + public void setLabelText(String text) { + setLabelTextHelper(getFigure(), text); + Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); + if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); + } + Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE); + if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback(); + } + } + + /** + * @generated + */ + public String getEditText() { + if (getParserElement() == null || getParser() == null) { + return ""; //$NON-NLS-1$ + } + return getParser().getEditString( + ParserUtil.getParserAdapter(getParserElement(), this), + getParserOptions().intValue()); + } + + /** + * @generated + */ + protected boolean isEditable() { + return getParser() != null; + } + + /** + * @generated + */ + public ICellEditorValidator getEditTextValidator() { + return new ICellEditorValidator() { + + @Override + public String isValid(final Object value) { + if (value instanceof String) { + final EObject element = getParserElement(); + final IParser parser = getParser(); + try { + IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive( + new RunnableWithResult.Impl<java.lang.Object>() { + + @Override + public void run() { + setResult(parser.isValidEditString(ParserUtil.getParserAdapter(getParserElement(), ConstraintNameEditPartCN.this), (String) value)); + } + }); + return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage(); + } catch (InterruptedException ie) { + ie.printStackTrace(); + } + } + + // shouldn't get here + return null; + } + }; + } + + /** + * @generated + */ + public IContentAssistProcessor getCompletionProcessor() { + if (getParserElement() == null || getParser() == null) { + return null; + } + return getParser().getCompletionProcessor(ParserUtil.getParserAdapter(getParserElement(), this)); + } + + /** + * @generated + */ + public ParserOptions getParserOptions() { + return ParserOptions.NONE; + } + + /** + * @generated + */ + public IParser getParser() { + if (parser == null) { + parser = ParserUtil.getParser(UMLElementTypes.Constraint_Shape, getParserElement(), this, VISUAL_ID); + } + return parser; + } + + /** + * @generated + */ + protected DirectEditManager getManager() { + if (manager == null) { + setManager(new MultilineLabelDirectEditManager(this, + MultilineLabelDirectEditManager.getTextCellEditorClass(this), + UMLEditPartFactory.getTextCellEditorLocator(this))); + } + return manager; + } + + /** + * @generated + */ + protected void setManager(DirectEditManager manager) { + this.manager = manager; + } + + /** + * @generated + */ + protected void performDirectEdit() { + BusyIndicator.showWhile(Display.getDefault(), new java.lang.Runnable() { + + @Override + public void run() { + getManager().show(); + } + }); + } + + /** + * @generated + */ + protected void performDirectEdit(Point eventLocation) { + if (getManager() instanceof TextDirectEditManager) { + ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint()); + } + } + + /** + * @generated + */ + protected void performDirectEdit(char initialCharacter) { + if (getManager() instanceof TextDirectEditManager) { + ((TextDirectEditManager) getManager()).show(initialCharacter); + } else { + performDirectEdit(); + } + } + + /** + * @generated + */ + protected void performDirectEditRequest(Request request) { + + final Request theRequest = request; + + if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) { + directEditionMode = getDirectEditionType(); + } + switch (directEditionMode) { + case IDirectEdition.NO_DIRECT_EDITION: + // no direct edition mode => does nothing + return; + case IDirectEdition.EXTENDED_DIRECT_EDITOR: + updateExtendedEditorConfiguration(); + if (configuration == null || configuration.getLanguage() == null) { + // Create default edit manager + 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)); + initializeDirectEditManager(theRequest); + return; + } else if (configuration instanceof IPopupEditorConfiguration) { + IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this); + helper.showEditor(); + return; + } else if (configuration instanceof IAdvancedEditorConfiguration) { + dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement())); + } else if (configuration instanceof IDirectEditorConfiguration) { + dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration); + } else { + return; + } + final Dialog finalDialog = dialog; + + if (Window.OK == dialog.open()) { + TransactionalEditingDomain domain = getEditingDomain(); + RecordingCommand command = new RecordingCommand(domain, "Edit Label") { + + @Override + protected void doExecute() { + configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue()); + + } + }; + domain.getCommandStack().execute(command); + } + } + break; + case IDirectEdition.DEFAULT_DIRECT_EDITOR: + initializeDirectEditManager(theRequest); + break; + default: + break; + } + } + + /** + * @generated + */ + protected void initializeDirectEditManager(final Request request) { + // 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); + performDirectEdit(initialChar.charValue()); + } else { + performDirectEdit(); + } + } + } + }); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + /** + * @generated + */ + protected void refreshVisuals() { + super.refreshVisuals(); + refreshLabel(); + refreshFont(); + refreshFontColor(); + refreshUnderline(); + refreshStrikeThrough(); + } + + /** + * @generated + */ + protected void refreshLabel() { + EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY); + if (maskLabelPolicy == null) { + maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL); + } + if (maskLabelPolicy == null) { + View view = (View) getModel(); + if (view.isVisible()) { + setLabelTextHelper(getFigure(), getLabelText()); + setLabelIconHelper(getFigure(), getLabelIcon()); + } else { + setLabelTextHelper(getFigure(), ""); //$NON-NLS-1$ + setLabelIconHelper(getFigure(), null); + } + } + Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); + if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); + } + Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE); + if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback(); + } + } + + /** + * @generated + */ + protected void refreshUnderline() { + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( + NotationPackage.eINSTANCE.getFontStyle()); + if (style != null && getFigure() instanceof WrappingLabel) { + ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline()); + } + if (resolveSemanticElement() instanceof Feature) { + if (((Feature) resolveSemanticElement()).isStatic()) { + ((WrappingLabel) getFigure()).setTextUnderline(true); + } else { + ((WrappingLabel) getFigure()).setTextUnderline(false); + } + } + } + + /** + * @generated + */ + protected void refreshStrikeThrough() { + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( + NotationPackage.eINSTANCE.getFontStyle()); + if (style != null && getFigure() instanceof WrappingLabel) { + ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough()); + } + } + + /** + * @generated + */ + protected void refreshFont() { + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( + NotationPackage.eINSTANCE.getFontStyle()); + if (style != null) { + FontData fontData = new FontData( + style.getFontName(), style.getFontHeight(), + (style.isBold() ? SWT.BOLD : SWT.NORMAL) | + (style.isItalic() ? SWT.ITALIC : SWT.NORMAL)); + setFont(fontData); + } + } + + /** + * @generated + */ + protected void setFontColor(Color color) { + getFigure().setForegroundColor(color); + } + + /** + * @generated + */ + protected void addSemanticListeners() { + if (getParser() instanceof ISemanticParser) { + EObject element = resolveSemanticElement(); + parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element); + for (int i = 0; i < parserElements.size(); i++) { + addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$ + } + } else { + super.addSemanticListeners(); + } + } + + /** + * @generated + */ + protected void removeSemanticListeners() { + if (parserElements != null) { + for (int i = 0; i < parserElements.size(); i++) { + removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$ + } + } else { + super.removeSemanticListeners(); + } + } + + /** + * @generated + */ + protected AccessibleEditPart getAccessibleEditPart() { + if (accessibleEP == null) { + accessibleEP = new AccessibleGraphicalEditPart() { + + @Override + public void getName(AccessibleEvent e) { + e.result = getLabelTextHelper(getFigure()); + } + }; + } + return accessibleEP; + } + + /** + * @generated + */ + private View getFontStyleOwnerView() { + return getPrimaryView(); + } + + /** + * Returns the kind of associated editor for direct edition. + * + * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition + * @generated + */ + public int getDirectEditionType() { + if (checkExtendedEditor()) { + initExtendedEditorConfiguration(); + return IDirectEdition.EXTENDED_DIRECT_EDITOR; + } + if (checkDefaultEdition()) { + return IDirectEdition.DEFAULT_DIRECT_EDITOR; + } + + // not a named element. no specific editor => do nothing + return IDirectEdition.NO_DIRECT_EDITION; + } + + /** + * Checks if an extended editor is present. + * + * @return <code>true</code> if an extended editor is present. + * @generated + */ + protected boolean checkExtendedEditor() { + if (resolveSemanticElement() != null) { + return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this); + } + return false; + } + + /** + * Checks if a default direct edition is available + * + * @return <code>true</code> if a default direct edition is available + * @generated + */ + protected boolean checkDefaultEdition() { + return (getParser() != null); + } + + /** + * Initializes the extended editor configuration + * @generated + */ + protected void initExtendedEditorConfiguration() { + if (configuration == null) { + final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName()); + if (languagePreferred != null && !languagePreferred.equals("")) { + configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this); + } else { + 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(), 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 + * @generated + */ + protected void performDefaultDirectEditorEdit(final Request theRequest) { + // initialize the direct edit manager + try { + getEditingDomain().runExclusive(new Runnable() { + + @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); + performDirectEdit(initialChar.charValue()); + } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) { + DirectEditRequest editRequest = (DirectEditRequest) theRequest; + performDirectEdit(editRequest.getLocation()); + } else { + performDirectEdit(); + } + } + } + }); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + /** + * @generated + */ + protected void addNotationalListeners() { + super.addNotationalListeners(); + addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$ + } + + /** + * @generated + */ + protected void removeNotationalListeners() { + super.removeNotationalListeners(); + removeListenerFilter("PrimaryView"); //$NON-NLS-1$ + } + + /** + * @generated + */ + protected void handleNotificationEvent(Notification event) { + refreshLabel(); + Object feature = event.getFeature(); + if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) { + Integer c = (Integer) event.getNewValue(); + setFontColor(DiagramColorRegistry.getInstance().getColor(c)); + } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) { + refreshUnderline(); + } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) { + refreshStrikeThrough(); + } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || + NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || + NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || + NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) { + refreshFont(); + } else { + if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) { + refreshLabel(); + } + if (getParser() instanceof ISemanticParser) { + ISemanticParser modelParser = (ISemanticParser) getParser(); + if (modelParser.areSemanticElementsAffected(null, event)) { + removeSemanticListeners(); + if (resolveSemanticElement() != null) { + addSemanticListeners(); + } + refreshLabel(); + } + } + } + if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) { + refreshLabel(); + } + super.handleNotificationEvent(event); + } + + /** + * @generated + */ + protected IFigure createFigure() { + // Parent should assign one using setLabel() method + return null; + } + + /** + * @generated + */ + private static final String ADD_PARENT_MODEL = "AddParentModel"; + + /** + * @generated + */ + public void activate() { + super.activate(); + addOwnerElementListeners(); + } + + /** + * @generated + */ + protected void addOwnerElementListeners() { + addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel())); + + } + + /** + * @generated + */ + public void deactivate() { + removeOwnerElementListeners(); + super.deactivate(); + + } + + /** + * @generated + */ + protected void removeOwnerElementListeners() { + removeListenerFilter(ADD_PARENT_MODEL); + + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/DurationObservationEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/DurationObservationEditPartCN.java index 5d485e5db9d..6c765e9a40b 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/DurationObservationEditPartCN.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/DurationObservationEditPartCN.java @@ -1,268 +1,268 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.LayoutEditPolicy;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-import org.eclipse.gef.handles.MoveHandle;
-import org.eclipse.gef.requests.CreateRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.BorderItemSelectionEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
-import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
-import org.eclipse.gmf.runtime.notation.BasicCompartment;
-import org.eclipse.gmf.runtime.notation.Edge;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultGraphicalNodeEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.GetChildLayoutEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.IPapyrusNodeFigure;
-import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.RoundedRectangleNodePlateFigure;
-import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.SelectableBorderedNodeFigure;
-import org.eclipse.papyrus.uml.diagram.common.editparts.RoundedCompartmentEditPart;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeIconlDisplayEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure;
-import org.eclipse.papyrus.uml.diagram.common.locator.ExternalLabelPositionLocator;
-import org.eclipse.papyrus.uml.diagram.common.locator.RoundedRectangleLabelPositionLocator;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * @generated
- */
-public class DurationObservationEditPartCN extends RoundedCompartmentEditPart {
-
- /**
- * @generated
- */
- public static final String VISUAL_ID = "DurationObservation_Shape";
-
- /**
- * @generated
- */
- protected IFigure contentPane;
-
- /**
- * @generated
- */
- protected IFigure primaryShape;
-
- /**
- * @generated
- */
- public DurationObservationEditPartCN(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- 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(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
- installEditPolicy(EditPolicy.LAYOUT_ROLE, new GetChildLayoutEditPolicy());
- // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
- // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
- }
-
- /**
- * @generated
- */
- protected LayoutEditPolicy createLayoutEditPolicy() {
- org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
-
- @Override
- protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View) child.getModel();
- String vid = UMLVisualIDRegistry.getVisualID(childView);
- if (vid != null) {
- switch (vid) {
- case DurationObservationLabelEditPartCN.VISUAL_ID:
- case DurationObservationStereotypeLabelEditPartCN.VISUAL_ID:
- return new BorderItemSelectionEditPolicy() {
-
- @Override
- protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
- mh.setBorder(null);
- return Collections.singletonList(mh);
- }
- };
- }
- }
- EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (result == null) {
- result = new NonResizableEditPolicy();
- }
- return result;
- }
-
- @Override
- protected Command getMoveChildrenCommand(Request request) {
- return null;
- }
-
- @Override
- protected Command getCreateCommand(CreateRequest request) {
- return null;
- }
- };
- return lep;
- }
-
- /**
- *Papyrus codeGen
- *@generated
- **/
- protected void handleNotificationEvent(Notification event) {
- /*
- * when a node have external node labels, the methods refreshChildren() remove the EditPart corresponding to the Label from the EditPart
- * Registry. After that, we can't reset the visibility to true (using the Show/Hide Label Action)!
- */
- if (NotationPackage.eINSTANCE.getView_Visible().equals(event.getFeature())) {
- Object notifier = event.getNotifier();
- List<?> modelChildren = ((View) getModel()).getChildren();
- if (false == notifier instanceof Edge
- && false == notifier instanceof BasicCompartment) {
- if (modelChildren.contains(event.getNotifier())) {
- return;
- }
- }
- }
- super.handleNotificationEvent(event);
-
- }
-
- /**
- * @generated
- */
- protected IFigure createNodeShape() {
- return primaryShape = new RoundedCompartmentFigure();
- }
-
- /**
- * org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure
- * @generated
- */
- public RoundedCompartmentFigure getPrimaryShape() {
- return (RoundedCompartmentFigure) primaryShape;
- }
-
- /**
- * @generated
- */
- protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if (borderItemEditPart instanceof DurationObservationLabelEditPartCN) {
- IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
- borderItemContainer.add(borderItemEditPart.getFigure(), locator);
- } else if (borderItemEditPart instanceof DurationObservationStereotypeLabelEditPartCN) {
- IBorderItemLocator locator = new ExternalLabelPositionLocator(getMainFigure());
- borderItemContainer.add(borderItemEditPart.getFigure(), locator);
- } else {
- super.addBorderItem(borderItemContainer, borderItemEditPart);
- }
- }
-
- /**
- * @generated
- */
- protected NodeFigure createNodePlate() {
- RoundedRectangleNodePlateFigure result = new RoundedRectangleNodePlateFigure(20, 20);
- return result;
- }
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected NodeFigure createMainFigure() {
- 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
- * @generated
- */
- protected IFigure setupContentPane(IFigure nodeShape) {
- return nodeShape; // use nodeShape itself as contentPane
- }
-
- /**
- * @generated
- */
- public IFigure getContentPane() {
- if (contentPane != null) {
- return contentPane;
- }
- return super.getContentPane();
- }
-
- /**
- * @generated
- */
- protected void setForegroundColor(Color color) {
- if (primaryShape != null) {
- primaryShape.setForegroundColor(color);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineWidth(int width) {
- super.setLineWidth(width);
- }
-
- /**
- * @generated
- */
- protected void setLineType(int style) {
- if (primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
- }
- }
-
- /**
- * @generated
- */
- public EditPart getPrimaryChildEditPart() {
- return getChildBySemanticHint(UMLVisualIDRegistry.getType(DurationObservationLabelEditPartCN.VISUAL_ID));
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.edit.parts; + +import java.util.Collections; +import java.util.List; + +import org.eclipse.draw2d.IFigure; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.gef.EditPart; +import org.eclipse.gef.EditPolicy; +import org.eclipse.gef.GraphicalEditPart; +import org.eclipse.gef.Request; +import org.eclipse.gef.commands.Command; +import org.eclipse.gef.editpolicies.LayoutEditPolicy; +import org.eclipse.gef.editpolicies.NonResizableEditPolicy; +import org.eclipse.gef.handles.MoveHandle; +import org.eclipse.gef.requests.CreateRequest; +import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.BorderItemSelectionEditPolicy; +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; +import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator; +import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure; +import org.eclipse.gmf.runtime.notation.BasicCompartment; +import org.eclipse.gmf.runtime.notation.Edge; +import org.eclipse.gmf.runtime.notation.NotationPackage; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultGraphicalNodeEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.GetChildLayoutEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.IPapyrusNodeFigure; +import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.RoundedRectangleNodePlateFigure; +import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.SelectableBorderedNodeFigure; +import org.eclipse.papyrus.uml.diagram.common.editparts.RoundedCompartmentEditPart; +import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeIconlDisplayEditPolicy; +import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy; +import org.eclipse.papyrus.uml.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy; +import org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure; +import org.eclipse.papyrus.uml.diagram.common.locator.ExternalLabelPositionLocator; +import org.eclipse.papyrus.uml.diagram.common.locator.RoundedRectangleLabelPositionLocator; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry; +import org.eclipse.swt.graphics.Color; + +/** + * @generated + */ +public class DurationObservationEditPartCN extends RoundedCompartmentEditPart { + + /** + * @generated + */ + public static final String VISUAL_ID = "DurationObservation_Shape"; + + /** + * @generated + */ + protected IFigure contentPane; + + /** + * @generated + */ + protected IFigure primaryShape; + + /** + * @generated + */ + public DurationObservationEditPartCN(View view) { + super(view); + } + + /** + * @generated + */ + 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(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy()); + installEditPolicy(EditPolicy.LAYOUT_ROLE, new GetChildLayoutEditPolicy()); + // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies + // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); + } + + /** + * @generated + */ + protected LayoutEditPolicy createLayoutEditPolicy() { + org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() { + + @Override + protected EditPolicy createChildEditPolicy(EditPart child) { + View childView = (View) child.getModel(); + String vid = UMLVisualIDRegistry.getVisualID(childView); + if (vid != null) { + switch (vid) { + case DurationObservationLabelEditPartCN.VISUAL_ID: + case DurationObservationStereotypeLabelEditPartCN.VISUAL_ID: + return new BorderItemSelectionEditPolicy() { + + @Override + protected List<?> createSelectionHandles() { + MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost()); + mh.setBorder(null); + return Collections.singletonList(mh); + } + }; + } + } + EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); + if (result == null) { + result = new NonResizableEditPolicy(); + } + return result; + } + + @Override + protected Command getMoveChildrenCommand(Request request) { + return null; + } + + @Override + protected Command getCreateCommand(CreateRequest request) { + return null; + } + }; + return lep; + } + + /** + *Papyrus codeGen + *@generated + **/ + protected void handleNotificationEvent(Notification event) { + /* + * when a node have external node labels, the methods refreshChildren() remove the EditPart corresponding to the Label from the EditPart + * Registry. After that, we can't reset the visibility to true (using the Show/Hide Label Action)! + */ + if (NotationPackage.eINSTANCE.getView_Visible().equals(event.getFeature())) { + Object notifier = event.getNotifier(); + List<?> modelChildren = ((View) getModel()).getChildren(); + if (false == notifier instanceof Edge + && false == notifier instanceof BasicCompartment) { + if (modelChildren.contains(event.getNotifier())) { + return; + } + } + } + super.handleNotificationEvent(event); + + } + + /** + * @generated + */ + protected IFigure createNodeShape() { + return primaryShape = new RoundedCompartmentFigure(); + } + + /** + * org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure + * @generated + */ + public RoundedCompartmentFigure getPrimaryShape() { + return (RoundedCompartmentFigure) primaryShape; + } + + /** + * @generated + */ + protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) { + if (borderItemEditPart instanceof DurationObservationLabelEditPartCN) { + IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure()); + borderItemContainer.add(borderItemEditPart.getFigure(), locator); + } else if (borderItemEditPart instanceof DurationObservationStereotypeLabelEditPartCN) { + IBorderItemLocator locator = new ExternalLabelPositionLocator(getMainFigure()); + borderItemContainer.add(borderItemEditPart.getFigure(), locator); + } else { + super.addBorderItem(borderItemContainer, borderItemEditPart); + } + } + + /** + * @generated + */ + protected NodeFigure createNodePlate() { + RoundedRectangleNodePlateFigure result = new RoundedRectangleNodePlateFigure(20, 20); + return result; + } + + /** + * Creates figure for this edit part. + * + * Body of this method does not depend on settings in generation model + * so you may safely remove <i>generated</i> tag and modify it. + * + * @generated + */ + protected NodeFigure createMainFigure() { + 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 + * @generated + */ + protected IFigure setupContentPane(IFigure nodeShape) { + return nodeShape; // use nodeShape itself as contentPane + } + + /** + * @generated + */ + public IFigure getContentPane() { + if (contentPane != null) { + return contentPane; + } + return super.getContentPane(); + } + + /** + * @generated + */ + protected void setForegroundColor(Color color) { + if (primaryShape != null) { + primaryShape.setForegroundColor(color); + } + } + + /** + * @generated + */ + protected void setLineWidth(int width) { + super.setLineWidth(width); + } + + /** + * @generated + */ + protected void setLineType(int style) { + if (primaryShape instanceof IPapyrusNodeFigure) { + ((IPapyrusNodeFigure) primaryShape).setLineStyle(style); + } + } + + /** + * @generated + */ + public EditPart getPrimaryChildEditPart() { + return getChildBySemanticHint(UMLVisualIDRegistry.getType(DurationObservationLabelEditPartCN.VISUAL_ID)); + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/DurationObservationLabelEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/DurationObservationLabelEditPartCN.java index c3e015f838b..b0514978a95 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/DurationObservationLabelEditPartCN.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/DurationObservationLabelEditPartCN.java @@ -1,817 +1,817 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.ICustomDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.ExternalLabelPrimaryDragRoleEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.PapyrusWrappingLabel;
-import org.eclipse.papyrus.infra.gmfdiag.common.parsers.ParserUtil;
-import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.uml.diagram.common.editparts.FloatingLabelEditPart;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.uml.diagram.communication.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.uml.diagram.communication.providers.UMLElementTypes;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.uml2.uml.Feature;
-
-/**
- * @generated
- */
-public class DurationObservationLabelEditPartCN extends FloatingLabelEditPart
- implements ITextAwareEditPart, IBorderItemEditPart {
-
- /**
- * @generated
- */
- public static final String VISUAL_ID = "DurationObservation_NameLabel";
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
- /**
- * 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
- */
- static {
- registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.communication.edit.parts.DurationObservationLabelEditPartCN.VISUAL_ID), new Point(0, 0));
- }
-
- /**
- * @generated
- */
- public DurationObservationLabelEditPartCN(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ExternalLabelPrimaryDragRoleEditPolicy());
- }
-
- /**
- * @generated
- */
- public IBorderItemLocator getBorderItemLocator() {
- IFigure parentFigure = getFigure().getParent();
- if (parentFigure != null && parentFigure.getLayoutManager() != null) {
- Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator) constraint;
- }
- return null;
- }
-
- /**
- * @generated
- */
- public void refreshBounds() {
- int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
- int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
- getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height));
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if (figure instanceof WrappingLabel) {
- return ((WrappingLabel) figure).getText();
- } else if (figure instanceof ILabelFigure) {
- return ((ILabelFigure) figure).getText();
- } else {
- return ((Label) figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if (figure instanceof WrappingLabel) {
- ((WrappingLabel) figure).setText(text);
- } else if (figure instanceof ILabelFigure) {
- ((ILabelFigure) figure).setText(text);
- } else {
- ((Label) figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if (figure instanceof WrappingLabel) {
- return ((WrappingLabel) figure).getIcon();
- } else if (figure instanceof ILabelFigure) {
- return ((ILabelFigure) figure).getIcon();
- } else {
- return ((Label) figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if (figure instanceof WrappingLabel) {
- ((WrappingLabel) figure).setIcon(icon);
- } else if (figure instanceof ILabelFigure) {
- ((ILabelFigure) figure).setIcon(icon);
- } else {
- ((Label) figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(IFigure figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List<?> getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- public void setParser(IParser parser) {
- this.parser = parser;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if (parserElement != null && getParser() != null) {
- text = getParser().getPrintString(
- ParserUtil.getParserAdapter(getParserElement(), this),
- getParserOptions().intValue());
- }
- if (text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if (getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(
- ParserUtil.getParserAdapter(getParserElement(), this),
- getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- @Override
- public String isValid(final Object value) {
- if (value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(ParserUtil.getParserAdapter(getParserElement(), DurationObservationLabelEditPartCN.this), (String) value));
- }
- });
- return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if (getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(ParserUtil.getParserAdapter(getParserElement(), this));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if (parser == null) {
- parser = ParserUtil.getParser(UMLElementTypes.DurationObservation_Shape, getParserElement(), this, VISUAL_ID);
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if (manager == null) {
- setManager(new MultilineLabelDirectEditManager(this,
- MultilineLabelDirectEditManager.getTextCellEditorClass(this),
- UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- BusyIndicator.showWhile(Display.getDefault(), new java.lang.Runnable() {
-
- @Override
- public void run() {
- getManager().show();
- }
- });
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if (getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(char initialCharacter) {
- if (getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager) getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch (directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if (configuration == null || configuration.getLanguage() == null) {
- // Create default edit manager
- 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));
- initializeDirectEditManager(theRequest);
- return;
- } else if (configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if (configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if (configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if (Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
- initializeDirectEditManager(theRequest);
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void initializeDirectEditManager(final Request request) {
- // 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);
- performDirectEdit(initialChar.charValue());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if (maskLabelPolicy == null) {
- maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
- }
- if (maskLabelPolicy == null) {
- View view = (View) getModel();
- if (view.isVisible()) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- } else {
- setLabelTextHelper(getFigure(), ""); //$NON-NLS-1$
- setLabelIconHelper(getFigure(), null);
- }
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
- if (style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
- }
- if (resolveSemanticElement() instanceof Feature) {
- if (((Feature) resolveSemanticElement()).isStatic()) {
- ((WrappingLabel) getFigure()).setTextUnderline(true);
- } else {
- ((WrappingLabel) getFigure()).setTextUnderline(false);
- }
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
- if (style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
- if (style != null) {
- FontData fontData = new FontData(
- style.getFontName(), style.getFontHeight(),
- (style.isBold() ? SWT.BOLD : SWT.NORMAL) |
- (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if (getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
- for (int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if (parserElements != null) {
- for (int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if (accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- @Override
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return getPrimaryView();
- }
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if (checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if (checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if (configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if (languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
- } else {
- 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(), 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
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- @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);
- performDirectEdit(initialChar.charValue());
- } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest) theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- Object feature = event.getFeature();
- if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer) event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) ||
- NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) ||
- NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) ||
- NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if (getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser) getParser();
- if (modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if (resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- IFigure label = createFigurePrim();
- defaultText = getLabelTextHelper(label);
- return label;
- }
-
- /**
- * @generated
- */
- protected IFigure createFigurePrim() {
- return new PapyrusWrappingLabel();
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.edit.parts; + +import java.util.Collections; +import java.util.List; + +import org.eclipse.draw2d.IFigure; +import org.eclipse.draw2d.Label; +import org.eclipse.draw2d.geometry.Point; +import org.eclipse.draw2d.geometry.Rectangle; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.transaction.RecordingCommand; +import org.eclipse.emf.transaction.RunnableWithResult; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.gef.AccessibleEditPart; +import org.eclipse.gef.EditPolicy; +import org.eclipse.gef.Request; +import org.eclipse.gef.requests.DirectEditRequest; +import org.eclipse.gef.tools.DirectEditManager; +import org.eclipse.gmf.runtime.common.ui.services.parser.IParser; +import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus; +import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions; +import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy; +import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator; +import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry; +import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants; +import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager; +import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; +import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser; +import org.eclipse.gmf.runtime.notation.FontStyle; +import org.eclipse.gmf.runtime.notation.NotationPackage; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.text.contentassist.IContentAssistProcessor; +import org.eclipse.jface.viewers.ICellEditorValidator; +import org.eclipse.jface.window.Window; +import org.eclipse.papyrus.extensionpoints.editors.Activator; +import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.configuration.ICustomDirectEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog; +import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog; +import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper; +import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil; +import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.ExternalLabelPrimaryDragRoleEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.PapyrusWrappingLabel; +import org.eclipse.papyrus.infra.gmfdiag.common.parsers.ParserUtil; +import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager; +import org.eclipse.papyrus.uml.diagram.common.editparts.FloatingLabelEditPart; +import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition; +import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure; +import org.eclipse.papyrus.uml.diagram.communication.edit.policies.UMLTextSelectionEditPolicy; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry; +import org.eclipse.papyrus.uml.diagram.communication.providers.UMLElementTypes; +import org.eclipse.swt.SWT; +import org.eclipse.swt.accessibility.AccessibleEvent; +import org.eclipse.swt.custom.BusyIndicator; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.graphics.FontData; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.widgets.Display; +import org.eclipse.ui.PlatformUI; +import org.eclipse.uml2.uml.Feature; + +/** + * @generated + */ +public class DurationObservationLabelEditPartCN extends FloatingLabelEditPart + implements ITextAwareEditPart, IBorderItemEditPart { + + /** + * @generated + */ + public static final String VISUAL_ID = "DurationObservation_NameLabel"; + + /** + * @generated + */ + private DirectEditManager manager; + + /** + * @generated + */ + private IParser parser; + + /** + * @generated + */ + private List<?> parserElements; + + /** + * @generated + */ + private String defaultText; + + /** + * 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 + */ + static { + registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.communication.edit.parts.DurationObservationLabelEditPartCN.VISUAL_ID), new Point(0, 0)); + } + + /** + * @generated + */ + public DurationObservationLabelEditPartCN(View view) { + super(view); + } + + /** + * @generated + */ + protected void createDefaultEditPolicies() { + super.createDefaultEditPolicies(); + installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy()); + installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy()); + installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ExternalLabelPrimaryDragRoleEditPolicy()); + } + + /** + * @generated + */ + public IBorderItemLocator getBorderItemLocator() { + IFigure parentFigure = getFigure().getParent(); + if (parentFigure != null && parentFigure.getLayoutManager() != null) { + Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure()); + return (IBorderItemLocator) constraint; + } + return null; + } + + /** + * @generated + */ + public void refreshBounds() { + int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue(); + int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue(); + int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue(); + int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue(); + getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height)); + } + + /** + * @generated + */ + protected String getLabelTextHelper(IFigure figure) { + if (figure instanceof WrappingLabel) { + return ((WrappingLabel) figure).getText(); + } else if (figure instanceof ILabelFigure) { + return ((ILabelFigure) figure).getText(); + } else { + return ((Label) figure).getText(); + } + } + + /** + * @generated + */ + protected void setLabelTextHelper(IFigure figure, String text) { + if (figure instanceof WrappingLabel) { + ((WrappingLabel) figure).setText(text); + } else if (figure instanceof ILabelFigure) { + ((ILabelFigure) figure).setText(text); + } else { + ((Label) figure).setText(text); + } + } + + /** + * @generated + */ + protected Image getLabelIconHelper(IFigure figure) { + if (figure instanceof WrappingLabel) { + return ((WrappingLabel) figure).getIcon(); + } else if (figure instanceof ILabelFigure) { + return ((ILabelFigure) figure).getIcon(); + } else { + return ((Label) figure).getIcon(); + } + } + + /** + * @generated + */ + protected void setLabelIconHelper(IFigure figure, Image icon) { + if (figure instanceof WrappingLabel) { + ((WrappingLabel) figure).setIcon(icon); + } else if (figure instanceof ILabelFigure) { + ((ILabelFigure) figure).setIcon(icon); + } else { + ((Label) figure).setIcon(icon); + } + } + + /** + * @generated + */ + public void setLabel(IFigure figure) { + unregisterVisuals(); + setFigure(figure); + defaultText = getLabelTextHelper(figure); + registerVisuals(); + refreshVisuals(); + } + + /** + * @generated + */ + protected List<?> getModelChildren() { + return Collections.EMPTY_LIST; + } + + /** + * @generated + */ + public IGraphicalEditPart getChildBySemanticHint(String semanticHint) { + return null; + } + + /** + * @generated + */ + public void setParser(IParser parser) { + this.parser = parser; + } + + /** + * @generated + */ + protected EObject getParserElement() { + return resolveSemanticElement(); + } + + /** + * @generated + */ + protected Image getLabelIcon() { + return null; + } + + /** + * @generated + */ + protected String getLabelText() { + String text = null; + EObject parserElement = getParserElement(); + if (parserElement != null && getParser() != null) { + text = getParser().getPrintString( + ParserUtil.getParserAdapter(getParserElement(), this), + getParserOptions().intValue()); + } + if (text == null || text.length() == 0) { + text = defaultText; + } + return text; + } + + /** + * @generated + */ + public void setLabelText(String text) { + setLabelTextHelper(getFigure(), text); + Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); + if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); + } + Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE); + if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback(); + } + } + + /** + * @generated + */ + public String getEditText() { + if (getParserElement() == null || getParser() == null) { + return ""; //$NON-NLS-1$ + } + return getParser().getEditString( + ParserUtil.getParserAdapter(getParserElement(), this), + getParserOptions().intValue()); + } + + /** + * @generated + */ + protected boolean isEditable() { + return getParser() != null; + } + + /** + * @generated + */ + public ICellEditorValidator getEditTextValidator() { + return new ICellEditorValidator() { + + @Override + public String isValid(final Object value) { + if (value instanceof String) { + final EObject element = getParserElement(); + final IParser parser = getParser(); + try { + IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive( + new RunnableWithResult.Impl<java.lang.Object>() { + + @Override + public void run() { + setResult(parser.isValidEditString(ParserUtil.getParserAdapter(getParserElement(), DurationObservationLabelEditPartCN.this), (String) value)); + } + }); + return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage(); + } catch (InterruptedException ie) { + ie.printStackTrace(); + } + } + + // shouldn't get here + return null; + } + }; + } + + /** + * @generated + */ + public IContentAssistProcessor getCompletionProcessor() { + if (getParserElement() == null || getParser() == null) { + return null; + } + return getParser().getCompletionProcessor(ParserUtil.getParserAdapter(getParserElement(), this)); + } + + /** + * @generated + */ + public ParserOptions getParserOptions() { + return ParserOptions.NONE; + } + + /** + * @generated + */ + public IParser getParser() { + if (parser == null) { + parser = ParserUtil.getParser(UMLElementTypes.DurationObservation_Shape, getParserElement(), this, VISUAL_ID); + } + return parser; + } + + /** + * @generated + */ + protected DirectEditManager getManager() { + if (manager == null) { + setManager(new MultilineLabelDirectEditManager(this, + MultilineLabelDirectEditManager.getTextCellEditorClass(this), + UMLEditPartFactory.getTextCellEditorLocator(this))); + } + return manager; + } + + /** + * @generated + */ + protected void setManager(DirectEditManager manager) { + this.manager = manager; + } + + /** + * @generated + */ + protected void performDirectEdit() { + BusyIndicator.showWhile(Display.getDefault(), new java.lang.Runnable() { + + @Override + public void run() { + getManager().show(); + } + }); + } + + /** + * @generated + */ + protected void performDirectEdit(Point eventLocation) { + if (getManager() instanceof TextDirectEditManager) { + ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint()); + } + } + + /** + * @generated + */ + protected void performDirectEdit(char initialCharacter) { + if (getManager() instanceof TextDirectEditManager) { + ((TextDirectEditManager) getManager()).show(initialCharacter); + } else { + performDirectEdit(); + } + } + + /** + * @generated + */ + protected void performDirectEditRequest(Request request) { + + final Request theRequest = request; + + if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) { + directEditionMode = getDirectEditionType(); + } + switch (directEditionMode) { + case IDirectEdition.NO_DIRECT_EDITION: + // no direct edition mode => does nothing + return; + case IDirectEdition.EXTENDED_DIRECT_EDITOR: + updateExtendedEditorConfiguration(); + if (configuration == null || configuration.getLanguage() == null) { + // Create default edit manager + 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)); + initializeDirectEditManager(theRequest); + return; + } else if (configuration instanceof IPopupEditorConfiguration) { + IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this); + helper.showEditor(); + return; + } else if (configuration instanceof IAdvancedEditorConfiguration) { + dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement())); + } else if (configuration instanceof IDirectEditorConfiguration) { + dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration); + } else { + return; + } + final Dialog finalDialog = dialog; + + if (Window.OK == dialog.open()) { + TransactionalEditingDomain domain = getEditingDomain(); + RecordingCommand command = new RecordingCommand(domain, "Edit Label") { + + @Override + protected void doExecute() { + configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue()); + + } + }; + domain.getCommandStack().execute(command); + } + } + break; + case IDirectEdition.DEFAULT_DIRECT_EDITOR: + initializeDirectEditManager(theRequest); + break; + default: + break; + } + } + + /** + * @generated + */ + protected void initializeDirectEditManager(final Request request) { + // 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); + performDirectEdit(initialChar.charValue()); + } else { + performDirectEdit(); + } + } + } + }); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + /** + * @generated + */ + protected void refreshVisuals() { + super.refreshVisuals(); + refreshLabel(); + refreshFont(); + refreshFontColor(); + refreshUnderline(); + refreshStrikeThrough(); + } + + /** + * @generated + */ + protected void refreshLabel() { + EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY); + if (maskLabelPolicy == null) { + maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL); + } + if (maskLabelPolicy == null) { + View view = (View) getModel(); + if (view.isVisible()) { + setLabelTextHelper(getFigure(), getLabelText()); + setLabelIconHelper(getFigure(), getLabelIcon()); + } else { + setLabelTextHelper(getFigure(), ""); //$NON-NLS-1$ + setLabelIconHelper(getFigure(), null); + } + } + Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); + if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); + } + Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE); + if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback(); + } + } + + /** + * @generated + */ + protected void refreshUnderline() { + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( + NotationPackage.eINSTANCE.getFontStyle()); + if (style != null && getFigure() instanceof WrappingLabel) { + ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline()); + } + if (resolveSemanticElement() instanceof Feature) { + if (((Feature) resolveSemanticElement()).isStatic()) { + ((WrappingLabel) getFigure()).setTextUnderline(true); + } else { + ((WrappingLabel) getFigure()).setTextUnderline(false); + } + } + } + + /** + * @generated + */ + protected void refreshStrikeThrough() { + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( + NotationPackage.eINSTANCE.getFontStyle()); + if (style != null && getFigure() instanceof WrappingLabel) { + ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough()); + } + } + + /** + * @generated + */ + protected void refreshFont() { + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( + NotationPackage.eINSTANCE.getFontStyle()); + if (style != null) { + FontData fontData = new FontData( + style.getFontName(), style.getFontHeight(), + (style.isBold() ? SWT.BOLD : SWT.NORMAL) | + (style.isItalic() ? SWT.ITALIC : SWT.NORMAL)); + setFont(fontData); + } + } + + /** + * @generated + */ + protected void setFontColor(Color color) { + getFigure().setForegroundColor(color); + } + + /** + * @generated + */ + protected void addSemanticListeners() { + if (getParser() instanceof ISemanticParser) { + EObject element = resolveSemanticElement(); + parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element); + for (int i = 0; i < parserElements.size(); i++) { + addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$ + } + } else { + super.addSemanticListeners(); + } + } + + /** + * @generated + */ + protected void removeSemanticListeners() { + if (parserElements != null) { + for (int i = 0; i < parserElements.size(); i++) { + removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$ + } + } else { + super.removeSemanticListeners(); + } + } + + /** + * @generated + */ + protected AccessibleEditPart getAccessibleEditPart() { + if (accessibleEP == null) { + accessibleEP = new AccessibleGraphicalEditPart() { + + @Override + public void getName(AccessibleEvent e) { + e.result = getLabelTextHelper(getFigure()); + } + }; + } + return accessibleEP; + } + + /** + * @generated + */ + private View getFontStyleOwnerView() { + return getPrimaryView(); + } + + /** + * Returns the kind of associated editor for direct edition. + * + * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition + * @generated + */ + public int getDirectEditionType() { + if (checkExtendedEditor()) { + initExtendedEditorConfiguration(); + return IDirectEdition.EXTENDED_DIRECT_EDITOR; + } + if (checkDefaultEdition()) { + return IDirectEdition.DEFAULT_DIRECT_EDITOR; + } + + // not a named element. no specific editor => do nothing + return IDirectEdition.NO_DIRECT_EDITION; + } + + /** + * Checks if an extended editor is present. + * + * @return <code>true</code> if an extended editor is present. + * @generated + */ + protected boolean checkExtendedEditor() { + if (resolveSemanticElement() != null) { + return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this); + } + return false; + } + + /** + * Checks if a default direct edition is available + * + * @return <code>true</code> if a default direct edition is available + * @generated + */ + protected boolean checkDefaultEdition() { + return (getParser() != null); + } + + /** + * Initializes the extended editor configuration + * @generated + */ + protected void initExtendedEditorConfiguration() { + if (configuration == null) { + final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName()); + if (languagePreferred != null && !languagePreferred.equals("")) { + configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this); + } else { + 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(), 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 + * @generated + */ + protected void performDefaultDirectEditorEdit(final Request theRequest) { + // initialize the direct edit manager + try { + getEditingDomain().runExclusive(new Runnable() { + + @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); + performDirectEdit(initialChar.charValue()); + } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) { + DirectEditRequest editRequest = (DirectEditRequest) theRequest; + performDirectEdit(editRequest.getLocation()); + } else { + performDirectEdit(); + } + } + } + }); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + /** + * @generated + */ + protected void handleNotificationEvent(Notification event) { + Object feature = event.getFeature(); + if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) { + Integer c = (Integer) event.getNewValue(); + setFontColor(DiagramColorRegistry.getInstance().getColor(c)); + } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) { + refreshUnderline(); + } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) { + refreshStrikeThrough(); + } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || + NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || + NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || + NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) { + refreshFont(); + } else { + if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) { + refreshLabel(); + } + if (getParser() instanceof ISemanticParser) { + ISemanticParser modelParser = (ISemanticParser) getParser(); + if (modelParser.areSemanticElementsAffected(null, event)) { + removeSemanticListeners(); + if (resolveSemanticElement() != null) { + addSemanticListeners(); + } + refreshLabel(); + } + } + } + super.handleNotificationEvent(event); + } + + /** + * @generated + */ + protected IFigure createFigure() { + IFigure label = createFigurePrim(); + defaultText = getLabelTextHelper(label); + return label; + } + + /** + * @generated + */ + protected IFigure createFigurePrim() { + return new PapyrusWrappingLabel(); + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/DurationObservationStereotypeLabelEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/DurationObservationStereotypeLabelEditPartCN.java index c38f9a04189..da7de7f2ce5 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/DurationObservationStereotypeLabelEditPartCN.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/DurationObservationStereotypeLabelEditPartCN.java @@ -1,820 +1,820 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.ICustomDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusLabelEditPart;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.ExternalLabelPrimaryDragRoleEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.parsers.ParserUtil;
-import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeExternalNodeEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.AppliedStereotypeWrappingLabelFigure;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.uml.diagram.communication.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.uml.diagram.communication.providers.UMLElementTypes;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.uml2.uml.Feature;
-
-/**
- * @generated
- */
-public class DurationObservationStereotypeLabelEditPartCN extends PapyrusLabelEditPart
- implements ITextAwareEditPart, IBorderItemEditPart {
-
- /**
- * @generated
- */
- public static final String VISUAL_ID = "DurationObservation_StereotypeLabel";
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
- /**
- * 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
- */
- static {
- registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.communication.edit.parts.DurationObservationStereotypeLabelEditPartCN.VISUAL_ID), new Point(0, 0));
- }
-
- /**
- * @generated
- */
- public DurationObservationStereotypeLabelEditPartCN(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeExternalNodeEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ExternalLabelPrimaryDragRoleEditPolicy());
- }
-
- /**
- * @generated
- */
- public IBorderItemLocator getBorderItemLocator() {
- IFigure parentFigure = getFigure().getParent();
- if (parentFigure != null && parentFigure.getLayoutManager() != null) {
- Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator) constraint;
- }
- return null;
- }
-
- /**
- * @generated
- */
- public void refreshBounds() {
- int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
- int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
- getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height));
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if (figure instanceof WrappingLabel) {
- return ((WrappingLabel) figure).getText();
- } else if (figure instanceof ILabelFigure) {
- return ((ILabelFigure) figure).getText();
- } else {
- return ((Label) figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if (figure instanceof WrappingLabel) {
- ((WrappingLabel) figure).setText(text);
- } else if (figure instanceof ILabelFigure) {
- ((ILabelFigure) figure).setText(text);
- } else {
- ((Label) figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if (figure instanceof WrappingLabel) {
- return ((WrappingLabel) figure).getIcon();
- } else if (figure instanceof ILabelFigure) {
- return ((ILabelFigure) figure).getIcon();
- } else {
- return ((Label) figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if (figure instanceof WrappingLabel) {
- ((WrappingLabel) figure).setIcon(icon);
- } else if (figure instanceof ILabelFigure) {
- ((ILabelFigure) figure).setIcon(icon);
- } else {
- ((Label) figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(IFigure figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List<?> getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- public void setParser(IParser parser) {
- this.parser = parser;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if (parserElement != null && getParser() != null) {
- text = getParser().getPrintString(
- ParserUtil.getParserAdapter(getParserElement(), this),
- getParserOptions().intValue());
- }
- if (text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if (getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(
- ParserUtil.getParserAdapter(getParserElement(), this),
- getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- @Override
- public String isValid(final Object value) {
- if (value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(ParserUtil.getParserAdapter(getParserElement(), DurationObservationStereotypeLabelEditPartCN.this), (String) value));
- }
- });
- return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if (getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(ParserUtil.getParserAdapter(getParserElement(), this));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if (parser == null) {
- parser = ParserUtil.getParser(UMLElementTypes.DurationObservation_Shape, getParserElement(), this, VISUAL_ID);
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if (manager == null) {
- setManager(new MultilineLabelDirectEditManager(this,
- MultilineLabelDirectEditManager.getTextCellEditorClass(this),
- UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- BusyIndicator.showWhile(Display.getDefault(), new java.lang.Runnable() {
-
- @Override
- public void run() {
- getManager().show();
- }
- });
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if (getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(char initialCharacter) {
- if (getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager) getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch (directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if (configuration == null || configuration.getLanguage() == null) {
- // Create default edit manager
- 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));
- initializeDirectEditManager(theRequest);
- return;
- } else if (configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if (configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if (configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if (Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
- initializeDirectEditManager(theRequest);
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void initializeDirectEditManager(final Request request) {
- // 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);
- performDirectEdit(initialChar.charValue());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if (maskLabelPolicy == null) {
- maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
- }
- if (maskLabelPolicy == null) {
- View view = (View) getModel();
- if (view.isVisible()) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- } else {
- setLabelTextHelper(getFigure(), ""); //$NON-NLS-1$
- setLabelIconHelper(getFigure(), null);
- }
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
- if (style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
- }
- if (resolveSemanticElement() instanceof Feature) {
- if (((Feature) resolveSemanticElement()).isStatic()) {
- ((WrappingLabel) getFigure()).setTextUnderline(true);
- } else {
- ((WrappingLabel) getFigure()).setTextUnderline(false);
- }
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
- if (style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
- if (style != null) {
- FontData fontData = new FontData(
- style.getFontName(), style.getFontHeight(),
- (style.isBold() ? SWT.BOLD : SWT.NORMAL) |
- (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if (getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
- for (int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if (parserElements != null) {
- for (int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if (accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- @Override
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return getPrimaryView();
- }
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if (checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if (checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if (configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if (languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
- } else {
- 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(), 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
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- @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);
- performDirectEdit(initialChar.charValue());
- } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest) theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- Object feature = event.getFeature();
- if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer) event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) ||
- NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) ||
- NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) ||
- NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if (getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser) getParser();
- if (modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if (resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- IFigure label = createFigurePrim();
- defaultText = getLabelTextHelper(label);
- return label;
- }
-
- /**
- * @generated
- */
- protected IFigure createFigurePrim() {
- return new AppliedStereotypeWrappingLabelFigure();
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.edit.parts; + +import java.util.Collections; +import java.util.List; + +import org.eclipse.draw2d.IFigure; +import org.eclipse.draw2d.Label; +import org.eclipse.draw2d.geometry.Point; +import org.eclipse.draw2d.geometry.Rectangle; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.transaction.RecordingCommand; +import org.eclipse.emf.transaction.RunnableWithResult; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.gef.AccessibleEditPart; +import org.eclipse.gef.EditPolicy; +import org.eclipse.gef.Request; +import org.eclipse.gef.requests.DirectEditRequest; +import org.eclipse.gef.tools.DirectEditManager; +import org.eclipse.gmf.runtime.common.ui.services.parser.IParser; +import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus; +import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions; +import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy; +import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator; +import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry; +import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants; +import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager; +import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; +import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser; +import org.eclipse.gmf.runtime.notation.FontStyle; +import org.eclipse.gmf.runtime.notation.NotationPackage; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.text.contentassist.IContentAssistProcessor; +import org.eclipse.jface.viewers.ICellEditorValidator; +import org.eclipse.jface.window.Window; +import org.eclipse.papyrus.extensionpoints.editors.Activator; +import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.configuration.ICustomDirectEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog; +import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog; +import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper; +import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil; +import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds; +import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusLabelEditPart; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.ExternalLabelPrimaryDragRoleEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.parsers.ParserUtil; +import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager; +import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeExternalNodeEditPolicy; +import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy; +import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition; +import org.eclipse.papyrus.uml.diagram.common.figure.node.AppliedStereotypeWrappingLabelFigure; +import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure; +import org.eclipse.papyrus.uml.diagram.communication.edit.policies.UMLTextSelectionEditPolicy; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry; +import org.eclipse.papyrus.uml.diagram.communication.providers.UMLElementTypes; +import org.eclipse.swt.SWT; +import org.eclipse.swt.accessibility.AccessibleEvent; +import org.eclipse.swt.custom.BusyIndicator; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.graphics.FontData; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.widgets.Display; +import org.eclipse.ui.PlatformUI; +import org.eclipse.uml2.uml.Feature; + +/** + * @generated + */ +public class DurationObservationStereotypeLabelEditPartCN extends PapyrusLabelEditPart + implements ITextAwareEditPart, IBorderItemEditPart { + + /** + * @generated + */ + public static final String VISUAL_ID = "DurationObservation_StereotypeLabel"; + + /** + * @generated + */ + private DirectEditManager manager; + + /** + * @generated + */ + private IParser parser; + + /** + * @generated + */ + private List<?> parserElements; + + /** + * @generated + */ + private String defaultText; + + /** + * 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 + */ + static { + registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.communication.edit.parts.DurationObservationStereotypeLabelEditPartCN.VISUAL_ID), new Point(0, 0)); + } + + /** + * @generated + */ + public DurationObservationStereotypeLabelEditPartCN(View view) { + super(view); + } + + /** + * @generated + */ + protected void createDefaultEditPolicies() { + super.createDefaultEditPolicies(); + installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy()); + installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy()); + installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeExternalNodeEditPolicy()); + installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ExternalLabelPrimaryDragRoleEditPolicy()); + } + + /** + * @generated + */ + public IBorderItemLocator getBorderItemLocator() { + IFigure parentFigure = getFigure().getParent(); + if (parentFigure != null && parentFigure.getLayoutManager() != null) { + Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure()); + return (IBorderItemLocator) constraint; + } + return null; + } + + /** + * @generated + */ + public void refreshBounds() { + int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue(); + int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue(); + int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue(); + int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue(); + getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height)); + } + + /** + * @generated + */ + protected String getLabelTextHelper(IFigure figure) { + if (figure instanceof WrappingLabel) { + return ((WrappingLabel) figure).getText(); + } else if (figure instanceof ILabelFigure) { + return ((ILabelFigure) figure).getText(); + } else { + return ((Label) figure).getText(); + } + } + + /** + * @generated + */ + protected void setLabelTextHelper(IFigure figure, String text) { + if (figure instanceof WrappingLabel) { + ((WrappingLabel) figure).setText(text); + } else if (figure instanceof ILabelFigure) { + ((ILabelFigure) figure).setText(text); + } else { + ((Label) figure).setText(text); + } + } + + /** + * @generated + */ + protected Image getLabelIconHelper(IFigure figure) { + if (figure instanceof WrappingLabel) { + return ((WrappingLabel) figure).getIcon(); + } else if (figure instanceof ILabelFigure) { + return ((ILabelFigure) figure).getIcon(); + } else { + return ((Label) figure).getIcon(); + } + } + + /** + * @generated + */ + protected void setLabelIconHelper(IFigure figure, Image icon) { + if (figure instanceof WrappingLabel) { + ((WrappingLabel) figure).setIcon(icon); + } else if (figure instanceof ILabelFigure) { + ((ILabelFigure) figure).setIcon(icon); + } else { + ((Label) figure).setIcon(icon); + } + } + + /** + * @generated + */ + public void setLabel(IFigure figure) { + unregisterVisuals(); + setFigure(figure); + defaultText = getLabelTextHelper(figure); + registerVisuals(); + refreshVisuals(); + } + + /** + * @generated + */ + protected List<?> getModelChildren() { + return Collections.EMPTY_LIST; + } + + /** + * @generated + */ + public IGraphicalEditPart getChildBySemanticHint(String semanticHint) { + return null; + } + + /** + * @generated + */ + public void setParser(IParser parser) { + this.parser = parser; + } + + /** + * @generated + */ + protected EObject getParserElement() { + return resolveSemanticElement(); + } + + /** + * @generated + */ + protected Image getLabelIcon() { + return null; + } + + /** + * @generated + */ + protected String getLabelText() { + String text = null; + EObject parserElement = getParserElement(); + if (parserElement != null && getParser() != null) { + text = getParser().getPrintString( + ParserUtil.getParserAdapter(getParserElement(), this), + getParserOptions().intValue()); + } + if (text == null || text.length() == 0) { + text = defaultText; + } + return text; + } + + /** + * @generated + */ + public void setLabelText(String text) { + setLabelTextHelper(getFigure(), text); + Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); + if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); + } + Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE); + if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback(); + } + } + + /** + * @generated + */ + public String getEditText() { + if (getParserElement() == null || getParser() == null) { + return ""; //$NON-NLS-1$ + } + return getParser().getEditString( + ParserUtil.getParserAdapter(getParserElement(), this), + getParserOptions().intValue()); + } + + /** + * @generated + */ + protected boolean isEditable() { + return getParser() != null; + } + + /** + * @generated + */ + public ICellEditorValidator getEditTextValidator() { + return new ICellEditorValidator() { + + @Override + public String isValid(final Object value) { + if (value instanceof String) { + final EObject element = getParserElement(); + final IParser parser = getParser(); + try { + IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive( + new RunnableWithResult.Impl<java.lang.Object>() { + + @Override + public void run() { + setResult(parser.isValidEditString(ParserUtil.getParserAdapter(getParserElement(), DurationObservationStereotypeLabelEditPartCN.this), (String) value)); + } + }); + return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage(); + } catch (InterruptedException ie) { + ie.printStackTrace(); + } + } + + // shouldn't get here + return null; + } + }; + } + + /** + * @generated + */ + public IContentAssistProcessor getCompletionProcessor() { + if (getParserElement() == null || getParser() == null) { + return null; + } + return getParser().getCompletionProcessor(ParserUtil.getParserAdapter(getParserElement(), this)); + } + + /** + * @generated + */ + public ParserOptions getParserOptions() { + return ParserOptions.NONE; + } + + /** + * @generated + */ + public IParser getParser() { + if (parser == null) { + parser = ParserUtil.getParser(UMLElementTypes.DurationObservation_Shape, getParserElement(), this, VISUAL_ID); + } + return parser; + } + + /** + * @generated + */ + protected DirectEditManager getManager() { + if (manager == null) { + setManager(new MultilineLabelDirectEditManager(this, + MultilineLabelDirectEditManager.getTextCellEditorClass(this), + UMLEditPartFactory.getTextCellEditorLocator(this))); + } + return manager; + } + + /** + * @generated + */ + protected void setManager(DirectEditManager manager) { + this.manager = manager; + } + + /** + * @generated + */ + protected void performDirectEdit() { + BusyIndicator.showWhile(Display.getDefault(), new java.lang.Runnable() { + + @Override + public void run() { + getManager().show(); + } + }); + } + + /** + * @generated + */ + protected void performDirectEdit(Point eventLocation) { + if (getManager() instanceof TextDirectEditManager) { + ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint()); + } + } + + /** + * @generated + */ + protected void performDirectEdit(char initialCharacter) { + if (getManager() instanceof TextDirectEditManager) { + ((TextDirectEditManager) getManager()).show(initialCharacter); + } else { + performDirectEdit(); + } + } + + /** + * @generated + */ + protected void performDirectEditRequest(Request request) { + + final Request theRequest = request; + + if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) { + directEditionMode = getDirectEditionType(); + } + switch (directEditionMode) { + case IDirectEdition.NO_DIRECT_EDITION: + // no direct edition mode => does nothing + return; + case IDirectEdition.EXTENDED_DIRECT_EDITOR: + updateExtendedEditorConfiguration(); + if (configuration == null || configuration.getLanguage() == null) { + // Create default edit manager + 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)); + initializeDirectEditManager(theRequest); + return; + } else if (configuration instanceof IPopupEditorConfiguration) { + IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this); + helper.showEditor(); + return; + } else if (configuration instanceof IAdvancedEditorConfiguration) { + dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement())); + } else if (configuration instanceof IDirectEditorConfiguration) { + dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration); + } else { + return; + } + final Dialog finalDialog = dialog; + + if (Window.OK == dialog.open()) { + TransactionalEditingDomain domain = getEditingDomain(); + RecordingCommand command = new RecordingCommand(domain, "Edit Label") { + + @Override + protected void doExecute() { + configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue()); + + } + }; + domain.getCommandStack().execute(command); + } + } + break; + case IDirectEdition.DEFAULT_DIRECT_EDITOR: + initializeDirectEditManager(theRequest); + break; + default: + break; + } + } + + /** + * @generated + */ + protected void initializeDirectEditManager(final Request request) { + // 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); + performDirectEdit(initialChar.charValue()); + } else { + performDirectEdit(); + } + } + } + }); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + /** + * @generated + */ + protected void refreshVisuals() { + super.refreshVisuals(); + refreshLabel(); + refreshFont(); + refreshFontColor(); + refreshUnderline(); + refreshStrikeThrough(); + } + + /** + * @generated + */ + protected void refreshLabel() { + EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY); + if (maskLabelPolicy == null) { + maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL); + } + if (maskLabelPolicy == null) { + View view = (View) getModel(); + if (view.isVisible()) { + setLabelTextHelper(getFigure(), getLabelText()); + setLabelIconHelper(getFigure(), getLabelIcon()); + } else { + setLabelTextHelper(getFigure(), ""); //$NON-NLS-1$ + setLabelIconHelper(getFigure(), null); + } + } + Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); + if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); + } + Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE); + if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback(); + } + } + + /** + * @generated + */ + protected void refreshUnderline() { + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( + NotationPackage.eINSTANCE.getFontStyle()); + if (style != null && getFigure() instanceof WrappingLabel) { + ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline()); + } + if (resolveSemanticElement() instanceof Feature) { + if (((Feature) resolveSemanticElement()).isStatic()) { + ((WrappingLabel) getFigure()).setTextUnderline(true); + } else { + ((WrappingLabel) getFigure()).setTextUnderline(false); + } + } + } + + /** + * @generated + */ + protected void refreshStrikeThrough() { + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( + NotationPackage.eINSTANCE.getFontStyle()); + if (style != null && getFigure() instanceof WrappingLabel) { + ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough()); + } + } + + /** + * @generated + */ + protected void refreshFont() { + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( + NotationPackage.eINSTANCE.getFontStyle()); + if (style != null) { + FontData fontData = new FontData( + style.getFontName(), style.getFontHeight(), + (style.isBold() ? SWT.BOLD : SWT.NORMAL) | + (style.isItalic() ? SWT.ITALIC : SWT.NORMAL)); + setFont(fontData); + } + } + + /** + * @generated + */ + protected void setFontColor(Color color) { + getFigure().setForegroundColor(color); + } + + /** + * @generated + */ + protected void addSemanticListeners() { + if (getParser() instanceof ISemanticParser) { + EObject element = resolveSemanticElement(); + parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element); + for (int i = 0; i < parserElements.size(); i++) { + addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$ + } + } else { + super.addSemanticListeners(); + } + } + + /** + * @generated + */ + protected void removeSemanticListeners() { + if (parserElements != null) { + for (int i = 0; i < parserElements.size(); i++) { + removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$ + } + } else { + super.removeSemanticListeners(); + } + } + + /** + * @generated + */ + protected AccessibleEditPart getAccessibleEditPart() { + if (accessibleEP == null) { + accessibleEP = new AccessibleGraphicalEditPart() { + + @Override + public void getName(AccessibleEvent e) { + e.result = getLabelTextHelper(getFigure()); + } + }; + } + return accessibleEP; + } + + /** + * @generated + */ + private View getFontStyleOwnerView() { + return getPrimaryView(); + } + + /** + * Returns the kind of associated editor for direct edition. + * + * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition + * @generated + */ + public int getDirectEditionType() { + if (checkExtendedEditor()) { + initExtendedEditorConfiguration(); + return IDirectEdition.EXTENDED_DIRECT_EDITOR; + } + if (checkDefaultEdition()) { + return IDirectEdition.DEFAULT_DIRECT_EDITOR; + } + + // not a named element. no specific editor => do nothing + return IDirectEdition.NO_DIRECT_EDITION; + } + + /** + * Checks if an extended editor is present. + * + * @return <code>true</code> if an extended editor is present. + * @generated + */ + protected boolean checkExtendedEditor() { + if (resolveSemanticElement() != null) { + return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this); + } + return false; + } + + /** + * Checks if a default direct edition is available + * + * @return <code>true</code> if a default direct edition is available + * @generated + */ + protected boolean checkDefaultEdition() { + return (getParser() != null); + } + + /** + * Initializes the extended editor configuration + * @generated + */ + protected void initExtendedEditorConfiguration() { + if (configuration == null) { + final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName()); + if (languagePreferred != null && !languagePreferred.equals("")) { + configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this); + } else { + 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(), 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 + * @generated + */ + protected void performDefaultDirectEditorEdit(final Request theRequest) { + // initialize the direct edit manager + try { + getEditingDomain().runExclusive(new Runnable() { + + @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); + performDirectEdit(initialChar.charValue()); + } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) { + DirectEditRequest editRequest = (DirectEditRequest) theRequest; + performDirectEdit(editRequest.getLocation()); + } else { + performDirectEdit(); + } + } + } + }); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + /** + * @generated + */ + protected void handleNotificationEvent(Notification event) { + Object feature = event.getFeature(); + if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) { + Integer c = (Integer) event.getNewValue(); + setFontColor(DiagramColorRegistry.getInstance().getColor(c)); + } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) { + refreshUnderline(); + } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) { + refreshStrikeThrough(); + } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || + NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || + NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || + NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) { + refreshFont(); + } else { + if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) { + refreshLabel(); + } + if (getParser() instanceof ISemanticParser) { + ISemanticParser modelParser = (ISemanticParser) getParser(); + if (modelParser.areSemanticElementsAffected(null, event)) { + removeSemanticListeners(); + if (resolveSemanticElement() != null) { + addSemanticListeners(); + } + refreshLabel(); + } + } + } + super.handleNotificationEvent(event); + } + + /** + * @generated + */ + protected IFigure createFigure() { + IFigure label = createFigurePrim(); + defaultText = getLabelTextHelper(label); + return label; + } + + /** + * @generated + */ + protected IFigure createFigurePrim() { + return new AppliedStereotypeWrappingLabelFigure(); + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/InteractionCompartmentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/InteractionCompartmentEditPart.java index 20496ba9a27..6498c79601a 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/InteractionCompartmentEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/InteractionCompartmentEditPart.java @@ -1,144 +1,144 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.edit.parts;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableCompartmentEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.BorderDisplayEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultCompartmentSemanticEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultCreationEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.linklf.LinkLFShapeCompartmentEditPart;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.OrphanViewPolicy;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.PasteEditPolicy;
-import org.eclipse.papyrus.uml.diagram.communication.custom.edit.policies.CustomDiagramDragDropEditPolicy;
-import org.eclipse.papyrus.uml.diagram.communication.part.Messages;
-
-/**
- * @generated
- */
-public class InteractionCompartmentEditPart extends LinkLFShapeCompartmentEditPart {
-
- /**
- * @generated
- */
- public static final String VISUAL_ID = "Interaction_SubfragmentCompartment";
-
- /**
- * @generated
- */
- public InteractionCompartmentEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- public String getCompartmentName() {
- return Messages.InteractionCompartmentEditPart_title;
- }
-
- /**
- * @generated
- */
- public IFigure createFigure() {
- ResizableCompartmentFigure result = (ResizableCompartmentFigure) super.createFigure();
- result.setTitleVisibility(false);
- return result;
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ResizableCompartmentEditPolicy());
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultCompartmentSemanticEditPolicy());
- installEditPolicy(EditPolicyRoles.CREATION_ROLE, new DefaultCreationEditPolicy());
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
- installEditPolicy(PasteEditPolicy.PASTE_ROLE, new PasteEditPolicy());
- //in Papyrus diagrams are not strongly synchronised
- //installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.communication.edit.policies.InteractionCompartmentCanonicalEditPolicy());
-
- installEditPolicy("RemoveOrphanView", new OrphanViewPolicy()); //$NON-NLS-1$
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
- installEditPolicy(BorderDisplayEditPolicy.BORDER_DISPLAY_EDITPOLICY, new BorderDisplayEditPolicy());
- }
-
- /**
- * @generated
- */
- protected void setRatio(Double ratio) {
- if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
- super.setRatio(ratio);
- }
- }
-
- /**
- * @generated
- */
- public EditPart getTargetEditPart(Request request) {
-
- return super.getTargetEditPart(request);
- }
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification notification) {
- Object feature = notification.getFeature();
- if (NotationPackage.eINSTANCE.getSize_Width().equals(feature)
- || NotationPackage.eINSTANCE.getSize_Height().equals(feature)
- || NotationPackage.eINSTANCE.getLocation_X().equals(feature)
- || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
- refreshBounds();
- }
- super.handleNotificationEvent(notification);
- }
-
- /**
- * @generated
- */
- protected void refreshBounds() {
- int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
- Dimension size = new Dimension(width, height);
- int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
- Point loc = new Point(x, y);
- ((GraphicalEditPart) getParent()).setLayoutConstraint(
- this,
- getFigure(),
- new Rectangle(loc, size));
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshBounds();
- }
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.edit.parts; + +import org.eclipse.draw2d.IFigure; +import org.eclipse.draw2d.geometry.Dimension; +import org.eclipse.draw2d.geometry.Point; +import org.eclipse.draw2d.geometry.Rectangle; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.gef.EditPart; +import org.eclipse.gef.EditPolicy; +import org.eclipse.gef.GraphicalEditPart; +import org.eclipse.gef.Request; +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy; +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableCompartmentEditPolicy; +import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure; +import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout; +import org.eclipse.gmf.runtime.notation.NotationPackage; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.BorderDisplayEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultCompartmentSemanticEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultCreationEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.linklf.LinkLFShapeCompartmentEditPart; +import org.eclipse.papyrus.uml.diagram.common.editpolicies.OrphanViewPolicy; +import org.eclipse.papyrus.uml.diagram.common.editpolicies.PasteEditPolicy; +import org.eclipse.papyrus.uml.diagram.communication.custom.edit.policies.CustomDiagramDragDropEditPolicy; +import org.eclipse.papyrus.uml.diagram.communication.part.Messages; + +/** + * @generated + */ +public class InteractionCompartmentEditPart extends LinkLFShapeCompartmentEditPart { + + /** + * @generated + */ + public static final String VISUAL_ID = "Interaction_SubfragmentCompartment"; + + /** + * @generated + */ + public InteractionCompartmentEditPart(View view) { + super(view); + } + + /** + * @generated + */ + public String getCompartmentName() { + return Messages.InteractionCompartmentEditPart_title; + } + + /** + * @generated + */ + public IFigure createFigure() { + ResizableCompartmentFigure result = (ResizableCompartmentFigure) super.createFigure(); + result.setTitleVisibility(false); + return result; + } + + /** + * @generated + */ + protected void createDefaultEditPolicies() { + super.createDefaultEditPolicies(); + installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ResizableCompartmentEditPolicy()); + installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultCompartmentSemanticEditPolicy()); + installEditPolicy(EditPolicyRoles.CREATION_ROLE, new DefaultCreationEditPolicy()); + installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy()); + installEditPolicy(PasteEditPolicy.PASTE_ROLE, new PasteEditPolicy()); + //in Papyrus diagrams are not strongly synchronised + //installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.communication.edit.policies.InteractionCompartmentCanonicalEditPolicy()); + + installEditPolicy("RemoveOrphanView", new OrphanViewPolicy()); //$NON-NLS-1$ + installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy()); + installEditPolicy(BorderDisplayEditPolicy.BORDER_DISPLAY_EDITPOLICY, new BorderDisplayEditPolicy()); + } + + /** + * @generated + */ + protected void setRatio(Double ratio) { + if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) { + super.setRatio(ratio); + } + } + + /** + * @generated + */ + public EditPart getTargetEditPart(Request request) { + + return super.getTargetEditPart(request); + } + + /** + * @generated + */ + protected void handleNotificationEvent(Notification notification) { + Object feature = notification.getFeature(); + if (NotationPackage.eINSTANCE.getSize_Width().equals(feature) + || NotationPackage.eINSTANCE.getSize_Height().equals(feature) + || NotationPackage.eINSTANCE.getLocation_X().equals(feature) + || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) { + refreshBounds(); + } + super.handleNotificationEvent(notification); + } + + /** + * @generated + */ + protected void refreshBounds() { + int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue(); + int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue(); + Dimension size = new Dimension(width, height); + int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue(); + int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue(); + Point loc = new Point(x, y); + ((GraphicalEditPart) getParent()).setLayoutConstraint( + this, + getFigure(), + new Rectangle(loc, size)); + } + + /** + * @generated + */ + protected void refreshVisuals() { + super.refreshVisuals(); + refreshBounds(); + } +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/InteractionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/InteractionEditPart.java index 6ced10db75e..b10a591f670 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/InteractionEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/InteractionEditPart.java @@ -1,342 +1,342 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.LayoutEditPolicy;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-import org.eclipse.gef.handles.MoveHandle;
-import org.eclipse.gef.requests.CreateRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.BorderItemSelectionEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
-import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
-import org.eclipse.gmf.runtime.notation.BasicCompartment;
-import org.eclipse.gmf.runtime.notation.Edge;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultGraphicalNodeEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.GetChildLayoutEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.IPapyrusNodeFigure;
-import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.RoundedRectangleNodePlateFigure;
-import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.SelectableBorderedNodeFigure;
-import org.eclipse.papyrus.uml.diagram.common.editparts.RoundedCompartmentEditPart;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.ShowHideCompartmentEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.locator.RoundedRectangleLabelPositionLocator;
-import org.eclipse.papyrus.uml.diagram.communication.custom.edit.policies.CommunicationGraphicalNodeEditPolicy;
-import org.eclipse.papyrus.uml.diagram.communication.custom.edit.policies.CustomDiagramDragDropEditPolicy;
-import org.eclipse.papyrus.uml.diagram.communication.custom.figures.InteractionRectangleFigure;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * @generated
- */
-public class InteractionEditPart extends RoundedCompartmentEditPart {
-
- /**
- * @generated
- */
- public static final String VISUAL_ID = "Interaction_Shape";
-
- /**
- * @generated
- */
- protected IFigure contentPane;
-
- /**
- * @generated
- */
- protected IFigure primaryShape;
-
- /**
- * @generated
- */
- public InteractionEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
-
- installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
-
- installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
- installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new CommunicationGraphicalNodeEditPolicy());
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
- installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
- installEditPolicy(ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY, new ShowHideCompartmentEditPolicy());
- installEditPolicy(EditPolicy.LAYOUT_ROLE, new GetChildLayoutEditPolicy());
- // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
- // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
- }
-
- /**
- * @generated
- */
- protected LayoutEditPolicy createLayoutEditPolicy() {
- org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
-
- @Override
- protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View) child.getModel();
- String vid = UMLVisualIDRegistry.getVisualID(childView);
- if (vid != null) {
- switch (vid) {
- case InteractionFloatingLabelEditPart.VISUAL_ID:
- return new BorderItemSelectionEditPolicy() {
-
- @Override
- protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
- mh.setBorder(null);
- return Collections.singletonList(mh);
- }
- };
- }
- }
- EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (result == null) {
- result = new NonResizableEditPolicy();
- }
- return result;
- }
-
- @Override
- protected Command getMoveChildrenCommand(Request request) {
- return null;
- }
-
- @Override
- protected Command getCreateCommand(CreateRequest request) {
- return null;
- }
- };
- return lep;
- }
-
- /**
- *Papyrus codeGen
- *@generated
- **/
- protected void handleNotificationEvent(Notification event) {
- /*
- * when a node have external node labels, the methods refreshChildren() remove the EditPart corresponding to the Label from the EditPart
- * Registry. After that, we can't reset the visibility to true (using the Show/Hide Label Action)!
- */
- if (NotationPackage.eINSTANCE.getView_Visible().equals(event.getFeature())) {
- Object notifier = event.getNotifier();
- List<?> modelChildren = ((View) getModel()).getChildren();
- if (false == notifier instanceof Edge
- && false == notifier instanceof BasicCompartment) {
- if (modelChildren.contains(event.getNotifier())) {
- return;
- }
- }
- }
- super.handleNotificationEvent(event);
-
- }
-
- /**
- * @generated
- */
- protected IFigure createNodeShape() {
- return primaryShape = new InteractionRectangleFigure();
- }
-
- /**
- * org.eclipse.papyrus.uml.diagram.communication.custom.figures.InteractionRectangleFigure
- * @generated
- */
- public InteractionRectangleFigure getPrimaryShape() {
- return (InteractionRectangleFigure) primaryShape;
- }
-
- /**
- * @generated
- */
- protected boolean addFixedChild(EditPart childEditPart) {
- if (childEditPart instanceof InteractionNameEditPart) {
- ((InteractionNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
- return true;
- }
-
-
- if (childEditPart instanceof InteractionCompartmentEditPart) {
- IFigure pane = getPrimaryShape().getCompartmentFigure();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((InteractionCompartmentEditPart) childEditPart).getFigure());
- return true;
- }
-
- return false;
- }
-
- /**
- * @generated
- */
- protected boolean removeFixedChild(EditPart childEditPart) {
- if (childEditPart instanceof InteractionNameEditPart) {
- return true;
- }
- if (childEditPart instanceof InteractionCompartmentEditPart) {
- IFigure pane = getPrimaryShape().getCompartmentFigure();
- pane.remove(((InteractionCompartmentEditPart) childEditPart).getFigure());
- return true;
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected void addChildVisual(EditPart childEditPart, int index) {
- if (addFixedChild(childEditPart)) {
- return;
- }
- super.addChildVisual(childEditPart, -1);
- }
-
- /**
- * @generated
- */
- protected void removeChildVisual(EditPart childEditPart) {
- if (removeFixedChild(childEditPart)) {
- return;
- }
- super.removeChildVisual(childEditPart);
- }
-
- /**
- * @generated
- */
- protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if (editPart instanceof InteractionCompartmentEditPart) {
- return getPrimaryShape().getCompartmentFigure();
- }
- if (editPart instanceof IBorderItemEditPart) {
- return getBorderedFigure().getBorderItemContainer();
- }
- return getContentPane();
- }
-
- /**
- * @generated
- */
- protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if (borderItemEditPart instanceof InteractionFloatingLabelEditPart) {
- IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
- borderItemContainer.add(borderItemEditPart.getFigure(), locator);
- } else {
- super.addBorderItem(borderItemContainer, borderItemEditPart);
- }
- }
-
- /**
- * @generated
- */
- protected NodeFigure createNodePlate() {
- RoundedRectangleNodePlateFigure result = new RoundedRectangleNodePlateFigure(857, 757);
- return result;
- }
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected NodeFigure createMainFigure() {
- 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
- * @generated
- */
- protected IFigure setupContentPane(IFigure nodeShape) {
- if (nodeShape.getLayoutManager() == null) {
- ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
- layout.setSpacing(5);
- nodeShape.setLayoutManager(layout);
- }
- return nodeShape; // use nodeShape itself as contentPane
- }
-
- /**
- * @generated
- */
- public IFigure getContentPane() {
- if (contentPane != null) {
- return contentPane;
- }
- return super.getContentPane();
- }
-
- /**
- * @generated
- */
- protected void setForegroundColor(Color color) {
- if (primaryShape != null) {
- primaryShape.setForegroundColor(color);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineWidth(int width) {
- super.setLineWidth(width);
- }
-
- /**
- * @generated
- */
- protected void setLineType(int style) {
- if (primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
- }
- }
-
- /**
- * @generated
- */
- public EditPart getPrimaryChildEditPart() {
- return getChildBySemanticHint(UMLVisualIDRegistry.getType(InteractionNameEditPart.VISUAL_ID));
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.edit.parts; + +import java.util.Collections; +import java.util.List; + +import org.eclipse.draw2d.IFigure; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.gef.EditPart; +import org.eclipse.gef.EditPolicy; +import org.eclipse.gef.GraphicalEditPart; +import org.eclipse.gef.Request; +import org.eclipse.gef.commands.Command; +import org.eclipse.gef.editpolicies.LayoutEditPolicy; +import org.eclipse.gef.editpolicies.NonResizableEditPolicy; +import org.eclipse.gef.handles.MoveHandle; +import org.eclipse.gef.requests.CreateRequest; +import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.BorderItemSelectionEditPolicy; +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; +import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator; +import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout; +import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure; +import org.eclipse.gmf.runtime.notation.BasicCompartment; +import org.eclipse.gmf.runtime.notation.Edge; +import org.eclipse.gmf.runtime.notation.NotationPackage; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultGraphicalNodeEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.GetChildLayoutEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.IPapyrusNodeFigure; +import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.RoundedRectangleNodePlateFigure; +import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.SelectableBorderedNodeFigure; +import org.eclipse.papyrus.uml.diagram.common.editparts.RoundedCompartmentEditPart; +import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy; +import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy; +import org.eclipse.papyrus.uml.diagram.common.editpolicies.ShowHideCompartmentEditPolicy; +import org.eclipse.papyrus.uml.diagram.common.locator.RoundedRectangleLabelPositionLocator; +import org.eclipse.papyrus.uml.diagram.communication.custom.edit.policies.CommunicationGraphicalNodeEditPolicy; +import org.eclipse.papyrus.uml.diagram.communication.custom.edit.policies.CustomDiagramDragDropEditPolicy; +import org.eclipse.papyrus.uml.diagram.communication.custom.figures.InteractionRectangleFigure; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry; +import org.eclipse.swt.graphics.Color; + +/** + * @generated + */ +public class InteractionEditPart extends RoundedCompartmentEditPart { + + /** + * @generated + */ + public static final String VISUAL_ID = "Interaction_Shape"; + + /** + * @generated + */ + protected IFigure contentPane; + + /** + * @generated + */ + protected IFigure primaryShape; + + /** + * @generated + */ + public InteractionEditPart(View view) { + super(view); + } + + /** + * @generated + */ + protected void createDefaultEditPolicies() { + super.createDefaultEditPolicies(); + installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy()); + + installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); + + installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); + installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new CommunicationGraphicalNodeEditPolicy()); + installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy()); + installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); + installEditPolicy(ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY, new ShowHideCompartmentEditPolicy()); + installEditPolicy(EditPolicy.LAYOUT_ROLE, new GetChildLayoutEditPolicy()); + // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies + // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); + } + + /** + * @generated + */ + protected LayoutEditPolicy createLayoutEditPolicy() { + org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() { + + @Override + protected EditPolicy createChildEditPolicy(EditPart child) { + View childView = (View) child.getModel(); + String vid = UMLVisualIDRegistry.getVisualID(childView); + if (vid != null) { + switch (vid) { + case InteractionFloatingLabelEditPart.VISUAL_ID: + return new BorderItemSelectionEditPolicy() { + + @Override + protected List<?> createSelectionHandles() { + MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost()); + mh.setBorder(null); + return Collections.singletonList(mh); + } + }; + } + } + EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); + if (result == null) { + result = new NonResizableEditPolicy(); + } + return result; + } + + @Override + protected Command getMoveChildrenCommand(Request request) { + return null; + } + + @Override + protected Command getCreateCommand(CreateRequest request) { + return null; + } + }; + return lep; + } + + /** + *Papyrus codeGen + *@generated + **/ + protected void handleNotificationEvent(Notification event) { + /* + * when a node have external node labels, the methods refreshChildren() remove the EditPart corresponding to the Label from the EditPart + * Registry. After that, we can't reset the visibility to true (using the Show/Hide Label Action)! + */ + if (NotationPackage.eINSTANCE.getView_Visible().equals(event.getFeature())) { + Object notifier = event.getNotifier(); + List<?> modelChildren = ((View) getModel()).getChildren(); + if (false == notifier instanceof Edge + && false == notifier instanceof BasicCompartment) { + if (modelChildren.contains(event.getNotifier())) { + return; + } + } + } + super.handleNotificationEvent(event); + + } + + /** + * @generated + */ + protected IFigure createNodeShape() { + return primaryShape = new InteractionRectangleFigure(); + } + + /** + * org.eclipse.papyrus.uml.diagram.communication.custom.figures.InteractionRectangleFigure + * @generated + */ + public InteractionRectangleFigure getPrimaryShape() { + return (InteractionRectangleFigure) primaryShape; + } + + /** + * @generated + */ + protected boolean addFixedChild(EditPart childEditPart) { + if (childEditPart instanceof InteractionNameEditPart) { + ((InteractionNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel()); + return true; + } + + + if (childEditPart instanceof InteractionCompartmentEditPart) { + IFigure pane = getPrimaryShape().getCompartmentFigure(); + setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way + pane.add(((InteractionCompartmentEditPart) childEditPart).getFigure()); + return true; + } + + return false; + } + + /** + * @generated + */ + protected boolean removeFixedChild(EditPart childEditPart) { + if (childEditPart instanceof InteractionNameEditPart) { + return true; + } + if (childEditPart instanceof InteractionCompartmentEditPart) { + IFigure pane = getPrimaryShape().getCompartmentFigure(); + pane.remove(((InteractionCompartmentEditPart) childEditPart).getFigure()); + return true; + } + return false; + } + + /** + * @generated + */ + protected void addChildVisual(EditPart childEditPart, int index) { + if (addFixedChild(childEditPart)) { + return; + } + super.addChildVisual(childEditPart, -1); + } + + /** + * @generated + */ + protected void removeChildVisual(EditPart childEditPart) { + if (removeFixedChild(childEditPart)) { + return; + } + super.removeChildVisual(childEditPart); + } + + /** + * @generated + */ + protected IFigure getContentPaneFor(IGraphicalEditPart editPart) { + if (editPart instanceof InteractionCompartmentEditPart) { + return getPrimaryShape().getCompartmentFigure(); + } + if (editPart instanceof IBorderItemEditPart) { + return getBorderedFigure().getBorderItemContainer(); + } + return getContentPane(); + } + + /** + * @generated + */ + protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) { + if (borderItemEditPart instanceof InteractionFloatingLabelEditPart) { + IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure()); + borderItemContainer.add(borderItemEditPart.getFigure(), locator); + } else { + super.addBorderItem(borderItemContainer, borderItemEditPart); + } + } + + /** + * @generated + */ + protected NodeFigure createNodePlate() { + RoundedRectangleNodePlateFigure result = new RoundedRectangleNodePlateFigure(857, 757); + return result; + } + + /** + * Creates figure for this edit part. + * + * Body of this method does not depend on settings in generation model + * so you may safely remove <i>generated</i> tag and modify it. + * + * @generated + */ + protected NodeFigure createMainFigure() { + 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 + * @generated + */ + protected IFigure setupContentPane(IFigure nodeShape) { + if (nodeShape.getLayoutManager() == null) { + ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout(); + layout.setSpacing(5); + nodeShape.setLayoutManager(layout); + } + return nodeShape; // use nodeShape itself as contentPane + } + + /** + * @generated + */ + public IFigure getContentPane() { + if (contentPane != null) { + return contentPane; + } + return super.getContentPane(); + } + + /** + * @generated + */ + protected void setForegroundColor(Color color) { + if (primaryShape != null) { + primaryShape.setForegroundColor(color); + } + } + + /** + * @generated + */ + protected void setLineWidth(int width) { + super.setLineWidth(width); + } + + /** + * @generated + */ + protected void setLineType(int style) { + if (primaryShape instanceof IPapyrusNodeFigure) { + ((IPapyrusNodeFigure) primaryShape).setLineStyle(style); + } + } + + /** + * @generated + */ + public EditPart getPrimaryChildEditPart() { + return getChildBySemanticHint(UMLVisualIDRegistry.getType(InteractionNameEditPart.VISUAL_ID)); + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/InteractionFloatingLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/InteractionFloatingLabelEditPart.java index 8994b37fe20..b6a039bb0eb 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/InteractionFloatingLabelEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/InteractionFloatingLabelEditPart.java @@ -1,817 +1,817 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.ICustomDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.ExternalLabelPrimaryDragRoleEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.PapyrusWrappingLabel;
-import org.eclipse.papyrus.infra.gmfdiag.common.parsers.ParserUtil;
-import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.uml.diagram.common.editparts.FloatingLabelEditPart;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.uml.diagram.communication.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.uml.diagram.communication.providers.UMLElementTypes;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.uml2.uml.Feature;
-
-/**
- * @generated
- */
-public class InteractionFloatingLabelEditPart extends FloatingLabelEditPart
- implements ITextAwareEditPart, IBorderItemEditPart {
-
- /**
- * @generated
- */
- public static final String VISUAL_ID = "Interaction_FloatingNameLabel";
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
- /**
- * 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
- */
- static {
- registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.communication.edit.parts.InteractionFloatingLabelEditPart.VISUAL_ID), new Point(0, 0));
- }
-
- /**
- * @generated
- */
- public InteractionFloatingLabelEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ExternalLabelPrimaryDragRoleEditPolicy());
- }
-
- /**
- * @generated
- */
- public IBorderItemLocator getBorderItemLocator() {
- IFigure parentFigure = getFigure().getParent();
- if (parentFigure != null && parentFigure.getLayoutManager() != null) {
- Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator) constraint;
- }
- return null;
- }
-
- /**
- * @generated
- */
- public void refreshBounds() {
- int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
- int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
- getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height));
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if (figure instanceof WrappingLabel) {
- return ((WrappingLabel) figure).getText();
- } else if (figure instanceof ILabelFigure) {
- return ((ILabelFigure) figure).getText();
- } else {
- return ((Label) figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if (figure instanceof WrappingLabel) {
- ((WrappingLabel) figure).setText(text);
- } else if (figure instanceof ILabelFigure) {
- ((ILabelFigure) figure).setText(text);
- } else {
- ((Label) figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if (figure instanceof WrappingLabel) {
- return ((WrappingLabel) figure).getIcon();
- } else if (figure instanceof ILabelFigure) {
- return ((ILabelFigure) figure).getIcon();
- } else {
- return ((Label) figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if (figure instanceof WrappingLabel) {
- ((WrappingLabel) figure).setIcon(icon);
- } else if (figure instanceof ILabelFigure) {
- ((ILabelFigure) figure).setIcon(icon);
- } else {
- ((Label) figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(IFigure figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List<?> getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- public void setParser(IParser parser) {
- this.parser = parser;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if (parserElement != null && getParser() != null) {
- text = getParser().getPrintString(
- ParserUtil.getParserAdapter(getParserElement(), this),
- getParserOptions().intValue());
- }
- if (text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if (getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(
- ParserUtil.getParserAdapter(getParserElement(), this),
- getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- @Override
- public String isValid(final Object value) {
- if (value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(ParserUtil.getParserAdapter(getParserElement(), InteractionFloatingLabelEditPart.this), (String) value));
- }
- });
- return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if (getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(ParserUtil.getParserAdapter(getParserElement(), this));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if (parser == null) {
- parser = ParserUtil.getParser(UMLElementTypes.Interaction_Shape, getParserElement(), this, VISUAL_ID);
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if (manager == null) {
- setManager(new MultilineLabelDirectEditManager(this,
- MultilineLabelDirectEditManager.getTextCellEditorClass(this),
- UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- BusyIndicator.showWhile(Display.getDefault(), new java.lang.Runnable() {
-
- @Override
- public void run() {
- getManager().show();
- }
- });
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if (getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(char initialCharacter) {
- if (getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager) getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch (directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if (configuration == null || configuration.getLanguage() == null) {
- // Create default edit manager
- 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));
- initializeDirectEditManager(theRequest);
- return;
- } else if (configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if (configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if (configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if (Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
- initializeDirectEditManager(theRequest);
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void initializeDirectEditManager(final Request request) {
- // 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);
- performDirectEdit(initialChar.charValue());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if (maskLabelPolicy == null) {
- maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
- }
- if (maskLabelPolicy == null) {
- View view = (View) getModel();
- if (view.isVisible()) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- } else {
- setLabelTextHelper(getFigure(), ""); //$NON-NLS-1$
- setLabelIconHelper(getFigure(), null);
- }
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
- if (style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
- }
- if (resolveSemanticElement() instanceof Feature) {
- if (((Feature) resolveSemanticElement()).isStatic()) {
- ((WrappingLabel) getFigure()).setTextUnderline(true);
- } else {
- ((WrappingLabel) getFigure()).setTextUnderline(false);
- }
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
- if (style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
- if (style != null) {
- FontData fontData = new FontData(
- style.getFontName(), style.getFontHeight(),
- (style.isBold() ? SWT.BOLD : SWT.NORMAL) |
- (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if (getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
- for (int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if (parserElements != null) {
- for (int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if (accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- @Override
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return getPrimaryView();
- }
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if (checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if (checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if (configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if (languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
- } else {
- 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(), 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
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- @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);
- performDirectEdit(initialChar.charValue());
- } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest) theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- Object feature = event.getFeature();
- if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer) event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) ||
- NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) ||
- NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) ||
- NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if (getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser) getParser();
- if (modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if (resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- IFigure label = createFigurePrim();
- defaultText = getLabelTextHelper(label);
- return label;
- }
-
- /**
- * @generated
- */
- protected IFigure createFigurePrim() {
- return new PapyrusWrappingLabel();
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.edit.parts; + +import java.util.Collections; +import java.util.List; + +import org.eclipse.draw2d.IFigure; +import org.eclipse.draw2d.Label; +import org.eclipse.draw2d.geometry.Point; +import org.eclipse.draw2d.geometry.Rectangle; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.transaction.RecordingCommand; +import org.eclipse.emf.transaction.RunnableWithResult; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.gef.AccessibleEditPart; +import org.eclipse.gef.EditPolicy; +import org.eclipse.gef.Request; +import org.eclipse.gef.requests.DirectEditRequest; +import org.eclipse.gef.tools.DirectEditManager; +import org.eclipse.gmf.runtime.common.ui.services.parser.IParser; +import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus; +import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions; +import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy; +import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator; +import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry; +import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants; +import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager; +import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; +import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser; +import org.eclipse.gmf.runtime.notation.FontStyle; +import org.eclipse.gmf.runtime.notation.NotationPackage; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.text.contentassist.IContentAssistProcessor; +import org.eclipse.jface.viewers.ICellEditorValidator; +import org.eclipse.jface.window.Window; +import org.eclipse.papyrus.extensionpoints.editors.Activator; +import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.configuration.ICustomDirectEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog; +import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog; +import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper; +import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil; +import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.ExternalLabelPrimaryDragRoleEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.PapyrusWrappingLabel; +import org.eclipse.papyrus.infra.gmfdiag.common.parsers.ParserUtil; +import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager; +import org.eclipse.papyrus.uml.diagram.common.editparts.FloatingLabelEditPart; +import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition; +import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure; +import org.eclipse.papyrus.uml.diagram.communication.edit.policies.UMLTextSelectionEditPolicy; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry; +import org.eclipse.papyrus.uml.diagram.communication.providers.UMLElementTypes; +import org.eclipse.swt.SWT; +import org.eclipse.swt.accessibility.AccessibleEvent; +import org.eclipse.swt.custom.BusyIndicator; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.graphics.FontData; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.widgets.Display; +import org.eclipse.ui.PlatformUI; +import org.eclipse.uml2.uml.Feature; + +/** + * @generated + */ +public class InteractionFloatingLabelEditPart extends FloatingLabelEditPart + implements ITextAwareEditPart, IBorderItemEditPart { + + /** + * @generated + */ + public static final String VISUAL_ID = "Interaction_FloatingNameLabel"; + + /** + * @generated + */ + private DirectEditManager manager; + + /** + * @generated + */ + private IParser parser; + + /** + * @generated + */ + private List<?> parserElements; + + /** + * @generated + */ + private String defaultText; + + /** + * 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 + */ + static { + registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.communication.edit.parts.InteractionFloatingLabelEditPart.VISUAL_ID), new Point(0, 0)); + } + + /** + * @generated + */ + public InteractionFloatingLabelEditPart(View view) { + super(view); + } + + /** + * @generated + */ + protected void createDefaultEditPolicies() { + super.createDefaultEditPolicies(); + installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy()); + installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy()); + installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ExternalLabelPrimaryDragRoleEditPolicy()); + } + + /** + * @generated + */ + public IBorderItemLocator getBorderItemLocator() { + IFigure parentFigure = getFigure().getParent(); + if (parentFigure != null && parentFigure.getLayoutManager() != null) { + Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure()); + return (IBorderItemLocator) constraint; + } + return null; + } + + /** + * @generated + */ + public void refreshBounds() { + int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue(); + int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue(); + int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue(); + int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue(); + getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height)); + } + + /** + * @generated + */ + protected String getLabelTextHelper(IFigure figure) { + if (figure instanceof WrappingLabel) { + return ((WrappingLabel) figure).getText(); + } else if (figure instanceof ILabelFigure) { + return ((ILabelFigure) figure).getText(); + } else { + return ((Label) figure).getText(); + } + } + + /** + * @generated + */ + protected void setLabelTextHelper(IFigure figure, String text) { + if (figure instanceof WrappingLabel) { + ((WrappingLabel) figure).setText(text); + } else if (figure instanceof ILabelFigure) { + ((ILabelFigure) figure).setText(text); + } else { + ((Label) figure).setText(text); + } + } + + /** + * @generated + */ + protected Image getLabelIconHelper(IFigure figure) { + if (figure instanceof WrappingLabel) { + return ((WrappingLabel) figure).getIcon(); + } else if (figure instanceof ILabelFigure) { + return ((ILabelFigure) figure).getIcon(); + } else { + return ((Label) figure).getIcon(); + } + } + + /** + * @generated + */ + protected void setLabelIconHelper(IFigure figure, Image icon) { + if (figure instanceof WrappingLabel) { + ((WrappingLabel) figure).setIcon(icon); + } else if (figure instanceof ILabelFigure) { + ((ILabelFigure) figure).setIcon(icon); + } else { + ((Label) figure).setIcon(icon); + } + } + + /** + * @generated + */ + public void setLabel(IFigure figure) { + unregisterVisuals(); + setFigure(figure); + defaultText = getLabelTextHelper(figure); + registerVisuals(); + refreshVisuals(); + } + + /** + * @generated + */ + protected List<?> getModelChildren() { + return Collections.EMPTY_LIST; + } + + /** + * @generated + */ + public IGraphicalEditPart getChildBySemanticHint(String semanticHint) { + return null; + } + + /** + * @generated + */ + public void setParser(IParser parser) { + this.parser = parser; + } + + /** + * @generated + */ + protected EObject getParserElement() { + return resolveSemanticElement(); + } + + /** + * @generated + */ + protected Image getLabelIcon() { + return null; + } + + /** + * @generated + */ + protected String getLabelText() { + String text = null; + EObject parserElement = getParserElement(); + if (parserElement != null && getParser() != null) { + text = getParser().getPrintString( + ParserUtil.getParserAdapter(getParserElement(), this), + getParserOptions().intValue()); + } + if (text == null || text.length() == 0) { + text = defaultText; + } + return text; + } + + /** + * @generated + */ + public void setLabelText(String text) { + setLabelTextHelper(getFigure(), text); + Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); + if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); + } + Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE); + if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback(); + } + } + + /** + * @generated + */ + public String getEditText() { + if (getParserElement() == null || getParser() == null) { + return ""; //$NON-NLS-1$ + } + return getParser().getEditString( + ParserUtil.getParserAdapter(getParserElement(), this), + getParserOptions().intValue()); + } + + /** + * @generated + */ + protected boolean isEditable() { + return getParser() != null; + } + + /** + * @generated + */ + public ICellEditorValidator getEditTextValidator() { + return new ICellEditorValidator() { + + @Override + public String isValid(final Object value) { + if (value instanceof String) { + final EObject element = getParserElement(); + final IParser parser = getParser(); + try { + IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive( + new RunnableWithResult.Impl<java.lang.Object>() { + + @Override + public void run() { + setResult(parser.isValidEditString(ParserUtil.getParserAdapter(getParserElement(), InteractionFloatingLabelEditPart.this), (String) value)); + } + }); + return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage(); + } catch (InterruptedException ie) { + ie.printStackTrace(); + } + } + + // shouldn't get here + return null; + } + }; + } + + /** + * @generated + */ + public IContentAssistProcessor getCompletionProcessor() { + if (getParserElement() == null || getParser() == null) { + return null; + } + return getParser().getCompletionProcessor(ParserUtil.getParserAdapter(getParserElement(), this)); + } + + /** + * @generated + */ + public ParserOptions getParserOptions() { + return ParserOptions.NONE; + } + + /** + * @generated + */ + public IParser getParser() { + if (parser == null) { + parser = ParserUtil.getParser(UMLElementTypes.Interaction_Shape, getParserElement(), this, VISUAL_ID); + } + return parser; + } + + /** + * @generated + */ + protected DirectEditManager getManager() { + if (manager == null) { + setManager(new MultilineLabelDirectEditManager(this, + MultilineLabelDirectEditManager.getTextCellEditorClass(this), + UMLEditPartFactory.getTextCellEditorLocator(this))); + } + return manager; + } + + /** + * @generated + */ + protected void setManager(DirectEditManager manager) { + this.manager = manager; + } + + /** + * @generated + */ + protected void performDirectEdit() { + BusyIndicator.showWhile(Display.getDefault(), new java.lang.Runnable() { + + @Override + public void run() { + getManager().show(); + } + }); + } + + /** + * @generated + */ + protected void performDirectEdit(Point eventLocation) { + if (getManager() instanceof TextDirectEditManager) { + ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint()); + } + } + + /** + * @generated + */ + protected void performDirectEdit(char initialCharacter) { + if (getManager() instanceof TextDirectEditManager) { + ((TextDirectEditManager) getManager()).show(initialCharacter); + } else { + performDirectEdit(); + } + } + + /** + * @generated + */ + protected void performDirectEditRequest(Request request) { + + final Request theRequest = request; + + if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) { + directEditionMode = getDirectEditionType(); + } + switch (directEditionMode) { + case IDirectEdition.NO_DIRECT_EDITION: + // no direct edition mode => does nothing + return; + case IDirectEdition.EXTENDED_DIRECT_EDITOR: + updateExtendedEditorConfiguration(); + if (configuration == null || configuration.getLanguage() == null) { + // Create default edit manager + 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)); + initializeDirectEditManager(theRequest); + return; + } else if (configuration instanceof IPopupEditorConfiguration) { + IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this); + helper.showEditor(); + return; + } else if (configuration instanceof IAdvancedEditorConfiguration) { + dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement())); + } else if (configuration instanceof IDirectEditorConfiguration) { + dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration); + } else { + return; + } + final Dialog finalDialog = dialog; + + if (Window.OK == dialog.open()) { + TransactionalEditingDomain domain = getEditingDomain(); + RecordingCommand command = new RecordingCommand(domain, "Edit Label") { + + @Override + protected void doExecute() { + configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue()); + + } + }; + domain.getCommandStack().execute(command); + } + } + break; + case IDirectEdition.DEFAULT_DIRECT_EDITOR: + initializeDirectEditManager(theRequest); + break; + default: + break; + } + } + + /** + * @generated + */ + protected void initializeDirectEditManager(final Request request) { + // 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); + performDirectEdit(initialChar.charValue()); + } else { + performDirectEdit(); + } + } + } + }); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + /** + * @generated + */ + protected void refreshVisuals() { + super.refreshVisuals(); + refreshLabel(); + refreshFont(); + refreshFontColor(); + refreshUnderline(); + refreshStrikeThrough(); + } + + /** + * @generated + */ + protected void refreshLabel() { + EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY); + if (maskLabelPolicy == null) { + maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL); + } + if (maskLabelPolicy == null) { + View view = (View) getModel(); + if (view.isVisible()) { + setLabelTextHelper(getFigure(), getLabelText()); + setLabelIconHelper(getFigure(), getLabelIcon()); + } else { + setLabelTextHelper(getFigure(), ""); //$NON-NLS-1$ + setLabelIconHelper(getFigure(), null); + } + } + Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); + if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); + } + Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE); + if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback(); + } + } + + /** + * @generated + */ + protected void refreshUnderline() { + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( + NotationPackage.eINSTANCE.getFontStyle()); + if (style != null && getFigure() instanceof WrappingLabel) { + ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline()); + } + if (resolveSemanticElement() instanceof Feature) { + if (((Feature) resolveSemanticElement()).isStatic()) { + ((WrappingLabel) getFigure()).setTextUnderline(true); + } else { + ((WrappingLabel) getFigure()).setTextUnderline(false); + } + } + } + + /** + * @generated + */ + protected void refreshStrikeThrough() { + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( + NotationPackage.eINSTANCE.getFontStyle()); + if (style != null && getFigure() instanceof WrappingLabel) { + ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough()); + } + } + + /** + * @generated + */ + protected void refreshFont() { + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( + NotationPackage.eINSTANCE.getFontStyle()); + if (style != null) { + FontData fontData = new FontData( + style.getFontName(), style.getFontHeight(), + (style.isBold() ? SWT.BOLD : SWT.NORMAL) | + (style.isItalic() ? SWT.ITALIC : SWT.NORMAL)); + setFont(fontData); + } + } + + /** + * @generated + */ + protected void setFontColor(Color color) { + getFigure().setForegroundColor(color); + } + + /** + * @generated + */ + protected void addSemanticListeners() { + if (getParser() instanceof ISemanticParser) { + EObject element = resolveSemanticElement(); + parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element); + for (int i = 0; i < parserElements.size(); i++) { + addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$ + } + } else { + super.addSemanticListeners(); + } + } + + /** + * @generated + */ + protected void removeSemanticListeners() { + if (parserElements != null) { + for (int i = 0; i < parserElements.size(); i++) { + removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$ + } + } else { + super.removeSemanticListeners(); + } + } + + /** + * @generated + */ + protected AccessibleEditPart getAccessibleEditPart() { + if (accessibleEP == null) { + accessibleEP = new AccessibleGraphicalEditPart() { + + @Override + public void getName(AccessibleEvent e) { + e.result = getLabelTextHelper(getFigure()); + } + }; + } + return accessibleEP; + } + + /** + * @generated + */ + private View getFontStyleOwnerView() { + return getPrimaryView(); + } + + /** + * Returns the kind of associated editor for direct edition. + * + * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition + * @generated + */ + public int getDirectEditionType() { + if (checkExtendedEditor()) { + initExtendedEditorConfiguration(); + return IDirectEdition.EXTENDED_DIRECT_EDITOR; + } + if (checkDefaultEdition()) { + return IDirectEdition.DEFAULT_DIRECT_EDITOR; + } + + // not a named element. no specific editor => do nothing + return IDirectEdition.NO_DIRECT_EDITION; + } + + /** + * Checks if an extended editor is present. + * + * @return <code>true</code> if an extended editor is present. + * @generated + */ + protected boolean checkExtendedEditor() { + if (resolveSemanticElement() != null) { + return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this); + } + return false; + } + + /** + * Checks if a default direct edition is available + * + * @return <code>true</code> if a default direct edition is available + * @generated + */ + protected boolean checkDefaultEdition() { + return (getParser() != null); + } + + /** + * Initializes the extended editor configuration + * @generated + */ + protected void initExtendedEditorConfiguration() { + if (configuration == null) { + final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName()); + if (languagePreferred != null && !languagePreferred.equals("")) { + configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this); + } else { + 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(), 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 + * @generated + */ + protected void performDefaultDirectEditorEdit(final Request theRequest) { + // initialize the direct edit manager + try { + getEditingDomain().runExclusive(new Runnable() { + + @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); + performDirectEdit(initialChar.charValue()); + } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) { + DirectEditRequest editRequest = (DirectEditRequest) theRequest; + performDirectEdit(editRequest.getLocation()); + } else { + performDirectEdit(); + } + } + } + }); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + /** + * @generated + */ + protected void handleNotificationEvent(Notification event) { + Object feature = event.getFeature(); + if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) { + Integer c = (Integer) event.getNewValue(); + setFontColor(DiagramColorRegistry.getInstance().getColor(c)); + } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) { + refreshUnderline(); + } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) { + refreshStrikeThrough(); + } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || + NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || + NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || + NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) { + refreshFont(); + } else { + if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) { + refreshLabel(); + } + if (getParser() instanceof ISemanticParser) { + ISemanticParser modelParser = (ISemanticParser) getParser(); + if (modelParser.areSemanticElementsAffected(null, event)) { + removeSemanticListeners(); + if (resolveSemanticElement() != null) { + addSemanticListeners(); + } + refreshLabel(); + } + } + } + super.handleNotificationEvent(event); + } + + /** + * @generated + */ + protected IFigure createFigure() { + IFigure label = createFigurePrim(); + defaultText = getLabelTextHelper(label); + return label; + } + + /** + * @generated + */ + protected IFigure createFigurePrim() { + return new PapyrusWrappingLabel(); + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/InteractionNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/InteractionNameEditPart.java index 74b31957639..9f92eaae7be 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/InteractionNameEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/InteractionNameEditPart.java @@ -1,837 +1,837 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.ICustomDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.papyrus.infra.emf.appearance.helper.AppearanceHelper;
-import org.eclipse.papyrus.infra.emf.appearance.helper.VisualInformationPapyrusConstants;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IControlParserForDirectEdit;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusCompartmentEditPart;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.parsers.ParserUtil;
-import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.edit.policies.DefaultNodeLabelDragPolicy;
-import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil;
-import org.eclipse.papyrus.uml.diagram.communication.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.uml.diagram.communication.providers.UMLElementTypes;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.uml2.uml.Feature;
-
-/**
- * @generated
- */
-public class InteractionNameEditPart extends PapyrusCompartmentEditPart
- implements ITextAwareEditPart, IControlParserForDirectEdit {
-
- /**
- * @generated
- */
- public static final String VISUAL_ID = "Interaction_NameLabel";
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
- /**
- * 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
- */
- public InteractionNameEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DefaultNodeLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if (figure instanceof WrappingLabel) {
- return ((WrappingLabel) figure).getText();
- } else if (figure instanceof ILabelFigure) {
- return ((ILabelFigure) figure).getText();
- } else {
- return ((Label) figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if (figure instanceof WrappingLabel) {
- ((WrappingLabel) figure).setText(text);
- } else if (figure instanceof ILabelFigure) {
- ((ILabelFigure) figure).setText(text);
- } else {
- ((Label) figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if (figure instanceof WrappingLabel) {
- return ((WrappingLabel) figure).getIcon();
- } else if (figure instanceof ILabelFigure) {
- return ((ILabelFigure) figure).getIcon();
- } else {
- return ((Label) figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if (figure instanceof WrappingLabel) {
- ((WrappingLabel) figure).setIcon(icon);
- } else if (figure instanceof ILabelFigure) {
- ((ILabelFigure) figure).setIcon(icon);
- } else {
- ((Label) figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(IFigure figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List<?> getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- public void setParser(IParser parser) {
- this.parser = parser;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramEditPartsUtil.getIcon(getParserElement(), getViewer());
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if (parserElement != null && getParser() != null) {
- text = getParser().getPrintString(
- ParserUtil.getParserAdapter(getParserElement(), this),
- getParserOptions().intValue());
- }
- if (text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if (getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(
- ParserUtil.getParserAdapter(getParserElement(), this),
- getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- @Override
- public String isValid(final Object value) {
- if (value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(ParserUtil.getParserAdapter(getParserElement(), InteractionNameEditPart.this), (String) value));
- }
- });
- return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if (getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(ParserUtil.getParserAdapter(getParserElement(), this));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if (parser == null) {
- parser = ParserUtil.getParser(UMLElementTypes.Interaction_Shape, getParserElement(), this, VISUAL_ID);
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if (manager == null) {
- setManager(new MultilineLabelDirectEditManager(this,
- MultilineLabelDirectEditManager.getTextCellEditorClass(this),
- UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- BusyIndicator.showWhile(Display.getDefault(), new java.lang.Runnable() {
-
- @Override
- public void run() {
- getManager().show();
- }
- });
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if (getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(char initialCharacter) {
- if (getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager) getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch (directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if (configuration == null || configuration.getLanguage() == null) {
- // Create default edit manager
- 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));
- initializeDirectEditManager(theRequest);
- return;
- } else if (configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if (configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if (configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if (Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
- initializeDirectEditManager(theRequest);
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void initializeDirectEditManager(final Request request) {
- // 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);
- performDirectEdit(initialChar.charValue());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if (maskLabelPolicy == null) {
- maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
- }
- if (maskLabelPolicy == null) {
- View view = (View) getModel();
- if (view.isVisible()) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- } else {
- setLabelTextHelper(getFigure(), ""); //$NON-NLS-1$
- setLabelIconHelper(getFigure(), null);
- }
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
- if (style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
- }
- if (resolveSemanticElement() instanceof Feature) {
- if (((Feature) resolveSemanticElement()).isStatic()) {
- ((WrappingLabel) getFigure()).setTextUnderline(true);
- } else {
- ((WrappingLabel) getFigure()).setTextUnderline(false);
- }
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
- if (style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
- if (style != null) {
- FontData fontData = new FontData(
- style.getFontName(), style.getFontHeight(),
- (style.isBold() ? SWT.BOLD : SWT.NORMAL) |
- (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if (getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
- for (int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if (parserElements != null) {
- for (int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if (accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- @Override
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return getPrimaryView();
- }
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if (checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if (checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if (configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if (languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
- } else {
- 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(), 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
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- @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);
- performDirectEdit(initialChar.charValue());
- } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest) theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * @generated
- */
- protected void addNotationalListeners() {
- super.addNotationalListeners();
- addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- protected void removeNotationalListeners() {
- super.removeNotationalListeners();
- removeListenerFilter("PrimaryView"); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- refreshLabel();
- Object feature = event.getFeature();
- if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer) event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) ||
- NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) ||
- NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) ||
- NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if (getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser) getParser();
- if (modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if (resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
- if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
- refreshLabel();
- }
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
- /**
- * @generated
- */
- private static final String ADD_PARENT_MODEL = "AddParentModel";
-
- /**
- * @generated
- */
- public void activate() {
- super.activate();
- addOwnerElementListeners();
- }
-
- /**
- * @generated
- */
- protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
-
- }
-
- /**
- * @generated
- */
- public void deactivate() {
- removeOwnerElementListeners();
- super.deactivate();
-
- }
-
- /**
- * @generated
- */
- protected void removeOwnerElementListeners() {
- removeListenerFilter(ADD_PARENT_MODEL);
-
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.edit.parts; + +import java.util.Collections; +import java.util.List; + +import org.eclipse.draw2d.IFigure; +import org.eclipse.draw2d.Label; +import org.eclipse.draw2d.geometry.Point; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EAnnotation; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.transaction.RecordingCommand; +import org.eclipse.emf.transaction.RunnableWithResult; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.gef.AccessibleEditPart; +import org.eclipse.gef.EditPolicy; +import org.eclipse.gef.Request; +import org.eclipse.gef.requests.DirectEditRequest; +import org.eclipse.gef.tools.DirectEditManager; +import org.eclipse.gmf.runtime.common.ui.services.parser.IParser; +import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus; +import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions; +import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy; +import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry; +import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants; +import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager; +import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; +import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser; +import org.eclipse.gmf.runtime.notation.FontStyle; +import org.eclipse.gmf.runtime.notation.NotationPackage; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.text.contentassist.IContentAssistProcessor; +import org.eclipse.jface.viewers.ICellEditorValidator; +import org.eclipse.jface.window.Window; +import org.eclipse.papyrus.extensionpoints.editors.Activator; +import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.configuration.ICustomDirectEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog; +import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog; +import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper; +import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil; +import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds; +import org.eclipse.papyrus.infra.emf.appearance.helper.AppearanceHelper; +import org.eclipse.papyrus.infra.emf.appearance.helper.VisualInformationPapyrusConstants; +import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IControlParserForDirectEdit; +import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusCompartmentEditPart; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.parsers.ParserUtil; +import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.edit.policies.DefaultNodeLabelDragPolicy; +import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager; +import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition; +import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure; +import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil; +import org.eclipse.papyrus.uml.diagram.communication.edit.policies.UMLTextSelectionEditPolicy; +import org.eclipse.papyrus.uml.diagram.communication.providers.UMLElementTypes; +import org.eclipse.swt.SWT; +import org.eclipse.swt.accessibility.AccessibleEvent; +import org.eclipse.swt.custom.BusyIndicator; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.graphics.FontData; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.widgets.Display; +import org.eclipse.ui.PlatformUI; +import org.eclipse.uml2.uml.Feature; + +/** + * @generated + */ +public class InteractionNameEditPart extends PapyrusCompartmentEditPart + implements ITextAwareEditPart, IControlParserForDirectEdit { + + /** + * @generated + */ + public static final String VISUAL_ID = "Interaction_NameLabel"; + + /** + * @generated + */ + private DirectEditManager manager; + + /** + * @generated + */ + private IParser parser; + + /** + * @generated + */ + private List<?> parserElements; + + /** + * @generated + */ + private String defaultText; + + /** + * 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 + */ + public InteractionNameEditPart(View view) { + super(view); + } + + /** + * @generated + */ + protected void createDefaultEditPolicies() { + super.createDefaultEditPolicies(); + installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy()); + installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy()); + installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DefaultNodeLabelDragPolicy()); + } + + /** + * @generated + */ + protected String getLabelTextHelper(IFigure figure) { + if (figure instanceof WrappingLabel) { + return ((WrappingLabel) figure).getText(); + } else if (figure instanceof ILabelFigure) { + return ((ILabelFigure) figure).getText(); + } else { + return ((Label) figure).getText(); + } + } + + /** + * @generated + */ + protected void setLabelTextHelper(IFigure figure, String text) { + if (figure instanceof WrappingLabel) { + ((WrappingLabel) figure).setText(text); + } else if (figure instanceof ILabelFigure) { + ((ILabelFigure) figure).setText(text); + } else { + ((Label) figure).setText(text); + } + } + + /** + * @generated + */ + protected Image getLabelIconHelper(IFigure figure) { + if (figure instanceof WrappingLabel) { + return ((WrappingLabel) figure).getIcon(); + } else if (figure instanceof ILabelFigure) { + return ((ILabelFigure) figure).getIcon(); + } else { + return ((Label) figure).getIcon(); + } + } + + /** + * @generated + */ + protected void setLabelIconHelper(IFigure figure, Image icon) { + if (figure instanceof WrappingLabel) { + ((WrappingLabel) figure).setIcon(icon); + } else if (figure instanceof ILabelFigure) { + ((ILabelFigure) figure).setIcon(icon); + } else { + ((Label) figure).setIcon(icon); + } + } + + /** + * @generated + */ + public void setLabel(IFigure figure) { + unregisterVisuals(); + setFigure(figure); + defaultText = getLabelTextHelper(figure); + registerVisuals(); + refreshVisuals(); + } + + /** + * @generated + */ + protected List<?> getModelChildren() { + return Collections.EMPTY_LIST; + } + + /** + * @generated + */ + public IGraphicalEditPart getChildBySemanticHint(String semanticHint) { + return null; + } + + /** + * @generated + */ + public void setParser(IParser parser) { + this.parser = parser; + } + + /** + * @generated + */ + protected EObject getParserElement() { + return resolveSemanticElement(); + } + + /** + * @generated + */ + protected Image getLabelIcon() { + return org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramEditPartsUtil.getIcon(getParserElement(), getViewer()); + } + + /** + * @generated + */ + protected String getLabelText() { + String text = null; + EObject parserElement = getParserElement(); + if (parserElement != null && getParser() != null) { + text = getParser().getPrintString( + ParserUtil.getParserAdapter(getParserElement(), this), + getParserOptions().intValue()); + } + if (text == null || text.length() == 0) { + text = defaultText; + } + return text; + } + + /** + * @generated + */ + public void setLabelText(String text) { + setLabelTextHelper(getFigure(), text); + Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); + if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); + } + Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE); + if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback(); + } + } + + /** + * @generated + */ + public String getEditText() { + if (getParserElement() == null || getParser() == null) { + return ""; //$NON-NLS-1$ + } + return getParser().getEditString( + ParserUtil.getParserAdapter(getParserElement(), this), + getParserOptions().intValue()); + } + + /** + * @generated + */ + protected boolean isEditable() { + return getParser() != null; + } + + /** + * @generated + */ + public ICellEditorValidator getEditTextValidator() { + return new ICellEditorValidator() { + + @Override + public String isValid(final Object value) { + if (value instanceof String) { + final EObject element = getParserElement(); + final IParser parser = getParser(); + try { + IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive( + new RunnableWithResult.Impl<java.lang.Object>() { + + @Override + public void run() { + setResult(parser.isValidEditString(ParserUtil.getParserAdapter(getParserElement(), InteractionNameEditPart.this), (String) value)); + } + }); + return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage(); + } catch (InterruptedException ie) { + ie.printStackTrace(); + } + } + + // shouldn't get here + return null; + } + }; + } + + /** + * @generated + */ + public IContentAssistProcessor getCompletionProcessor() { + if (getParserElement() == null || getParser() == null) { + return null; + } + return getParser().getCompletionProcessor(ParserUtil.getParserAdapter(getParserElement(), this)); + } + + /** + * @generated + */ + public ParserOptions getParserOptions() { + return ParserOptions.NONE; + } + + /** + * @generated + */ + public IParser getParser() { + if (parser == null) { + parser = ParserUtil.getParser(UMLElementTypes.Interaction_Shape, getParserElement(), this, VISUAL_ID); + } + return parser; + } + + /** + * @generated + */ + protected DirectEditManager getManager() { + if (manager == null) { + setManager(new MultilineLabelDirectEditManager(this, + MultilineLabelDirectEditManager.getTextCellEditorClass(this), + UMLEditPartFactory.getTextCellEditorLocator(this))); + } + return manager; + } + + /** + * @generated + */ + protected void setManager(DirectEditManager manager) { + this.manager = manager; + } + + /** + * @generated + */ + protected void performDirectEdit() { + BusyIndicator.showWhile(Display.getDefault(), new java.lang.Runnable() { + + @Override + public void run() { + getManager().show(); + } + }); + } + + /** + * @generated + */ + protected void performDirectEdit(Point eventLocation) { + if (getManager() instanceof TextDirectEditManager) { + ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint()); + } + } + + /** + * @generated + */ + protected void performDirectEdit(char initialCharacter) { + if (getManager() instanceof TextDirectEditManager) { + ((TextDirectEditManager) getManager()).show(initialCharacter); + } else { + performDirectEdit(); + } + } + + /** + * @generated + */ + protected void performDirectEditRequest(Request request) { + + final Request theRequest = request; + + if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) { + directEditionMode = getDirectEditionType(); + } + switch (directEditionMode) { + case IDirectEdition.NO_DIRECT_EDITION: + // no direct edition mode => does nothing + return; + case IDirectEdition.EXTENDED_DIRECT_EDITOR: + updateExtendedEditorConfiguration(); + if (configuration == null || configuration.getLanguage() == null) { + // Create default edit manager + 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)); + initializeDirectEditManager(theRequest); + return; + } else if (configuration instanceof IPopupEditorConfiguration) { + IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this); + helper.showEditor(); + return; + } else if (configuration instanceof IAdvancedEditorConfiguration) { + dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement())); + } else if (configuration instanceof IDirectEditorConfiguration) { + dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration); + } else { + return; + } + final Dialog finalDialog = dialog; + + if (Window.OK == dialog.open()) { + TransactionalEditingDomain domain = getEditingDomain(); + RecordingCommand command = new RecordingCommand(domain, "Edit Label") { + + @Override + protected void doExecute() { + configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue()); + + } + }; + domain.getCommandStack().execute(command); + } + } + break; + case IDirectEdition.DEFAULT_DIRECT_EDITOR: + initializeDirectEditManager(theRequest); + break; + default: + break; + } + } + + /** + * @generated + */ + protected void initializeDirectEditManager(final Request request) { + // 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); + performDirectEdit(initialChar.charValue()); + } else { + performDirectEdit(); + } + } + } + }); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + /** + * @generated + */ + protected void refreshVisuals() { + super.refreshVisuals(); + refreshLabel(); + refreshFont(); + refreshFontColor(); + refreshUnderline(); + refreshStrikeThrough(); + } + + /** + * @generated + */ + protected void refreshLabel() { + EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY); + if (maskLabelPolicy == null) { + maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL); + } + if (maskLabelPolicy == null) { + View view = (View) getModel(); + if (view.isVisible()) { + setLabelTextHelper(getFigure(), getLabelText()); + setLabelIconHelper(getFigure(), getLabelIcon()); + } else { + setLabelTextHelper(getFigure(), ""); //$NON-NLS-1$ + setLabelIconHelper(getFigure(), null); + } + } + Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); + if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); + } + Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE); + if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback(); + } + } + + /** + * @generated + */ + protected void refreshUnderline() { + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( + NotationPackage.eINSTANCE.getFontStyle()); + if (style != null && getFigure() instanceof WrappingLabel) { + ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline()); + } + if (resolveSemanticElement() instanceof Feature) { + if (((Feature) resolveSemanticElement()).isStatic()) { + ((WrappingLabel) getFigure()).setTextUnderline(true); + } else { + ((WrappingLabel) getFigure()).setTextUnderline(false); + } + } + } + + /** + * @generated + */ + protected void refreshStrikeThrough() { + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( + NotationPackage.eINSTANCE.getFontStyle()); + if (style != null && getFigure() instanceof WrappingLabel) { + ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough()); + } + } + + /** + * @generated + */ + protected void refreshFont() { + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( + NotationPackage.eINSTANCE.getFontStyle()); + if (style != null) { + FontData fontData = new FontData( + style.getFontName(), style.getFontHeight(), + (style.isBold() ? SWT.BOLD : SWT.NORMAL) | + (style.isItalic() ? SWT.ITALIC : SWT.NORMAL)); + setFont(fontData); + } + } + + /** + * @generated + */ + protected void setFontColor(Color color) { + getFigure().setForegroundColor(color); + } + + /** + * @generated + */ + protected void addSemanticListeners() { + if (getParser() instanceof ISemanticParser) { + EObject element = resolveSemanticElement(); + parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element); + for (int i = 0; i < parserElements.size(); i++) { + addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$ + } + } else { + super.addSemanticListeners(); + } + } + + /** + * @generated + */ + protected void removeSemanticListeners() { + if (parserElements != null) { + for (int i = 0; i < parserElements.size(); i++) { + removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$ + } + } else { + super.removeSemanticListeners(); + } + } + + /** + * @generated + */ + protected AccessibleEditPart getAccessibleEditPart() { + if (accessibleEP == null) { + accessibleEP = new AccessibleGraphicalEditPart() { + + @Override + public void getName(AccessibleEvent e) { + e.result = getLabelTextHelper(getFigure()); + } + }; + } + return accessibleEP; + } + + /** + * @generated + */ + private View getFontStyleOwnerView() { + return getPrimaryView(); + } + + /** + * Returns the kind of associated editor for direct edition. + * + * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition + * @generated + */ + public int getDirectEditionType() { + if (checkExtendedEditor()) { + initExtendedEditorConfiguration(); + return IDirectEdition.EXTENDED_DIRECT_EDITOR; + } + if (checkDefaultEdition()) { + return IDirectEdition.DEFAULT_DIRECT_EDITOR; + } + + // not a named element. no specific editor => do nothing + return IDirectEdition.NO_DIRECT_EDITION; + } + + /** + * Checks if an extended editor is present. + * + * @return <code>true</code> if an extended editor is present. + * @generated + */ + protected boolean checkExtendedEditor() { + if (resolveSemanticElement() != null) { + return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this); + } + return false; + } + + /** + * Checks if a default direct edition is available + * + * @return <code>true</code> if a default direct edition is available + * @generated + */ + protected boolean checkDefaultEdition() { + return (getParser() != null); + } + + /** + * Initializes the extended editor configuration + * @generated + */ + protected void initExtendedEditorConfiguration() { + if (configuration == null) { + final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName()); + if (languagePreferred != null && !languagePreferred.equals("")) { + configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this); + } else { + 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(), 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 + * @generated + */ + protected void performDefaultDirectEditorEdit(final Request theRequest) { + // initialize the direct edit manager + try { + getEditingDomain().runExclusive(new Runnable() { + + @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); + performDirectEdit(initialChar.charValue()); + } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) { + DirectEditRequest editRequest = (DirectEditRequest) theRequest; + performDirectEdit(editRequest.getLocation()); + } else { + performDirectEdit(); + } + } + } + }); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + /** + * @generated + */ + protected void addNotationalListeners() { + super.addNotationalListeners(); + addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$ + } + + /** + * @generated + */ + protected void removeNotationalListeners() { + super.removeNotationalListeners(); + removeListenerFilter("PrimaryView"); //$NON-NLS-1$ + } + + /** + * @generated + */ + protected void handleNotificationEvent(Notification event) { + refreshLabel(); + Object feature = event.getFeature(); + if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) { + Integer c = (Integer) event.getNewValue(); + setFontColor(DiagramColorRegistry.getInstance().getColor(c)); + } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) { + refreshUnderline(); + } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) { + refreshStrikeThrough(); + } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || + NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || + NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || + NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) { + refreshFont(); + } else { + if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) { + refreshLabel(); + } + if (getParser() instanceof ISemanticParser) { + ISemanticParser modelParser = (ISemanticParser) getParser(); + if (modelParser.areSemanticElementsAffected(null, event)) { + removeSemanticListeners(); + if (resolveSemanticElement() != null) { + addSemanticListeners(); + } + refreshLabel(); + } + } + } + if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) { + refreshLabel(); + } + super.handleNotificationEvent(event); + } + + /** + * @generated + */ + protected IFigure createFigure() { + // Parent should assign one using setLabel() method + return null; + } + + /** + * @generated + */ + private static final String ADD_PARENT_MODEL = "AddParentModel"; + + /** + * @generated + */ + public void activate() { + super.activate(); + addOwnerElementListeners(); + } + + /** + * @generated + */ + protected void addOwnerElementListeners() { + addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel())); + + } + + /** + * @generated + */ + public void deactivate() { + removeOwnerElementListeners(); + super.deactivate(); + + } + + /** + * @generated + */ + protected void removeOwnerElementListeners() { + removeListenerFilter(ADD_PARENT_MODEL); + + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/LifelineEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/LifelineEditPartCN.java index b42c21d4c49..7f8c4892bc0 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/LifelineEditPartCN.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/LifelineEditPartCN.java @@ -1,325 +1,325 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.LayoutEditPolicy;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-import org.eclipse.gef.handles.MoveHandle;
-import org.eclipse.gef.requests.CreateRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.BorderItemSelectionEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
-import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
-import org.eclipse.gmf.runtime.notation.BasicCompartment;
-import org.eclipse.gmf.runtime.notation.Edge;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultGraphicalNodeEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.GetChildLayoutEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.IPapyrusNodeFigure;
-import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.RoundedRectangleNodePlateFigure;
-import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.SelectableBorderedNodeFigure;
-import org.eclipse.papyrus.uml.diagram.common.editparts.RoundedCompartmentEditPart;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure;
-import org.eclipse.papyrus.uml.diagram.common.locator.RoundedRectangleLabelPositionLocator;
-import org.eclipse.papyrus.uml.diagram.communication.custom.edit.policies.CommunicationGraphicalNodeEditPolicy;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * @generated
- */
-public class LifelineEditPartCN extends RoundedCompartmentEditPart {
-
- /**
- * @generated
- */
- public static final String VISUAL_ID = "Lifeline_Shape";
-
- /**
- * @generated
- */
- protected IFigure contentPane;
-
- /**
- * @generated
- */
- protected IFigure primaryShape;
-
- /**
- * @generated
- */
- public LifelineEditPartCN(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
-
- installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
-
- installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
- installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new CommunicationGraphicalNodeEditPolicy());
- installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
- installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
- installEditPolicy(EditPolicy.LAYOUT_ROLE, new GetChildLayoutEditPolicy());
- // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
- // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
- }
-
- /**
- * @generated
- */
- protected LayoutEditPolicy createLayoutEditPolicy() {
- org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
-
- @Override
- protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View) child.getModel();
- String vid = UMLVisualIDRegistry.getVisualID(childView);
- if (vid != null) {
- switch (vid) {
- case LifelineFloatingLabelEditPartCN.VISUAL_ID:
- return new BorderItemSelectionEditPolicy() {
-
- @Override
- protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
- mh.setBorder(null);
- return Collections.singletonList(mh);
- }
- };
- }
- }
- EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (result == null) {
- result = new NonResizableEditPolicy();
- }
- return result;
- }
-
- @Override
- protected Command getMoveChildrenCommand(Request request) {
- return null;
- }
-
- @Override
- protected Command getCreateCommand(CreateRequest request) {
- return null;
- }
- };
- return lep;
- }
-
- /**
- *Papyrus codeGen
- *@generated
- **/
- protected void handleNotificationEvent(Notification event) {
- /*
- * when a node have external node labels, the methods refreshChildren() remove the EditPart corresponding to the Label from the EditPart
- * Registry. After that, we can't reset the visibility to true (using the Show/Hide Label Action)!
- */
- if (NotationPackage.eINSTANCE.getView_Visible().equals(event.getFeature())) {
- Object notifier = event.getNotifier();
- List<?> modelChildren = ((View) getModel()).getChildren();
- if (false == notifier instanceof Edge
- && false == notifier instanceof BasicCompartment) {
- if (modelChildren.contains(event.getNotifier())) {
- return;
- }
- }
- }
- super.handleNotificationEvent(event);
-
- }
-
- /**
- * @generated
- */
- protected IFigure createNodeShape() {
- return primaryShape = new RoundedCompartmentFigure();
- }
-
- /**
- * org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure
- * @generated
- */
- public RoundedCompartmentFigure getPrimaryShape() {
- return (RoundedCompartmentFigure) primaryShape;
- }
-
- /**
- * @generated
- */
- protected boolean addFixedChild(EditPart childEditPart) {
- if (childEditPart instanceof LifelineNameEditPart) {
- ((LifelineNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel());
- return true;
- }
-
-
- return false;
- }
-
- /**
- * @generated
- */
- protected boolean removeFixedChild(EditPart childEditPart) {
- if (childEditPart instanceof LifelineNameEditPart) {
- return true;
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected void addChildVisual(EditPart childEditPart, int index) {
- if (addFixedChild(childEditPart)) {
- return;
- }
- super.addChildVisual(childEditPart, -1);
- }
-
- /**
- * @generated
- */
- protected void removeChildVisual(EditPart childEditPart) {
- if (removeFixedChild(childEditPart)) {
- return;
- }
- super.removeChildVisual(childEditPart);
- }
-
- /**
- * @generated
- */
- protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- if (editPart instanceof IBorderItemEditPart) {
- return getBorderedFigure().getBorderItemContainer();
- }
- return getContentPane();
- }
-
- /**
- * @generated
- */
- protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if (borderItemEditPart instanceof LifelineFloatingLabelEditPartCN) {
- IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
- borderItemContainer.add(borderItemEditPart.getFigure(), locator);
- } else {
- super.addBorderItem(borderItemContainer, borderItemEditPart);
- }
- }
-
- /**
- * @generated
- */
- protected NodeFigure createNodePlate() {
- RoundedRectangleNodePlateFigure result = new RoundedRectangleNodePlateFigure(100, 25);
- return result;
- }
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected NodeFigure createMainFigure() {
- 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
- * @generated
- */
- protected IFigure setupContentPane(IFigure nodeShape) {
- if (nodeShape.getLayoutManager() == null) {
- ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
- layout.setSpacing(5);
- nodeShape.setLayoutManager(layout);
- }
- return nodeShape; // use nodeShape itself as contentPane
- }
-
- /**
- * @generated
- */
- public IFigure getContentPane() {
- if (contentPane != null) {
- return contentPane;
- }
- return super.getContentPane();
- }
-
- /**
- * @generated
- */
- protected void setForegroundColor(Color color) {
- if (primaryShape != null) {
- primaryShape.setForegroundColor(color);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineWidth(int width) {
- super.setLineWidth(width);
- }
-
- /**
- * @generated
- */
- protected void setLineType(int style) {
- if (primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
- }
- }
-
- /**
- * @generated
- */
- public EditPart getPrimaryChildEditPart() {
- return getChildBySemanticHint(UMLVisualIDRegistry.getType(LifelineNameEditPart.VISUAL_ID));
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.edit.parts; + +import java.util.Collections; +import java.util.List; + +import org.eclipse.draw2d.IFigure; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.gef.EditPart; +import org.eclipse.gef.EditPolicy; +import org.eclipse.gef.GraphicalEditPart; +import org.eclipse.gef.Request; +import org.eclipse.gef.commands.Command; +import org.eclipse.gef.editpolicies.LayoutEditPolicy; +import org.eclipse.gef.editpolicies.NonResizableEditPolicy; +import org.eclipse.gef.handles.MoveHandle; +import org.eclipse.gef.requests.CreateRequest; +import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.BorderItemSelectionEditPolicy; +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; +import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator; +import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout; +import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure; +import org.eclipse.gmf.runtime.notation.BasicCompartment; +import org.eclipse.gmf.runtime.notation.Edge; +import org.eclipse.gmf.runtime.notation.NotationPackage; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultGraphicalNodeEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.GetChildLayoutEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.IPapyrusNodeFigure; +import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.RoundedRectangleNodePlateFigure; +import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.SelectableBorderedNodeFigure; +import org.eclipse.papyrus.uml.diagram.common.editparts.RoundedCompartmentEditPart; +import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy; +import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy; +import org.eclipse.papyrus.uml.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy; +import org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure; +import org.eclipse.papyrus.uml.diagram.common.locator.RoundedRectangleLabelPositionLocator; +import org.eclipse.papyrus.uml.diagram.communication.custom.edit.policies.CommunicationGraphicalNodeEditPolicy; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry; +import org.eclipse.swt.graphics.Color; + +/** + * @generated + */ +public class LifelineEditPartCN extends RoundedCompartmentEditPart { + + /** + * @generated + */ + public static final String VISUAL_ID = "Lifeline_Shape"; + + /** + * @generated + */ + protected IFigure contentPane; + + /** + * @generated + */ + protected IFigure primaryShape; + + /** + * @generated + */ + public LifelineEditPartCN(View view) { + super(view); + } + + /** + * @generated + */ + protected void createDefaultEditPolicies() { + super.createDefaultEditPolicies(); + installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy()); + + installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); + + installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); + installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new CommunicationGraphicalNodeEditPolicy()); + installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); + installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy()); + installEditPolicy(EditPolicy.LAYOUT_ROLE, new GetChildLayoutEditPolicy()); + // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies + // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); + } + + /** + * @generated + */ + protected LayoutEditPolicy createLayoutEditPolicy() { + org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() { + + @Override + protected EditPolicy createChildEditPolicy(EditPart child) { + View childView = (View) child.getModel(); + String vid = UMLVisualIDRegistry.getVisualID(childView); + if (vid != null) { + switch (vid) { + case LifelineFloatingLabelEditPartCN.VISUAL_ID: + return new BorderItemSelectionEditPolicy() { + + @Override + protected List<?> createSelectionHandles() { + MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost()); + mh.setBorder(null); + return Collections.singletonList(mh); + } + }; + } + } + EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); + if (result == null) { + result = new NonResizableEditPolicy(); + } + return result; + } + + @Override + protected Command getMoveChildrenCommand(Request request) { + return null; + } + + @Override + protected Command getCreateCommand(CreateRequest request) { + return null; + } + }; + return lep; + } + + /** + *Papyrus codeGen + *@generated + **/ + protected void handleNotificationEvent(Notification event) { + /* + * when a node have external node labels, the methods refreshChildren() remove the EditPart corresponding to the Label from the EditPart + * Registry. After that, we can't reset the visibility to true (using the Show/Hide Label Action)! + */ + if (NotationPackage.eINSTANCE.getView_Visible().equals(event.getFeature())) { + Object notifier = event.getNotifier(); + List<?> modelChildren = ((View) getModel()).getChildren(); + if (false == notifier instanceof Edge + && false == notifier instanceof BasicCompartment) { + if (modelChildren.contains(event.getNotifier())) { + return; + } + } + } + super.handleNotificationEvent(event); + + } + + /** + * @generated + */ + protected IFigure createNodeShape() { + return primaryShape = new RoundedCompartmentFigure(); + } + + /** + * org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure + * @generated + */ + public RoundedCompartmentFigure getPrimaryShape() { + return (RoundedCompartmentFigure) primaryShape; + } + + /** + * @generated + */ + protected boolean addFixedChild(EditPart childEditPart) { + if (childEditPart instanceof LifelineNameEditPart) { + ((LifelineNameEditPart) childEditPart).setLabel(getPrimaryShape().getNameLabel()); + return true; + } + + + return false; + } + + /** + * @generated + */ + protected boolean removeFixedChild(EditPart childEditPart) { + if (childEditPart instanceof LifelineNameEditPart) { + return true; + } + return false; + } + + /** + * @generated + */ + protected void addChildVisual(EditPart childEditPart, int index) { + if (addFixedChild(childEditPart)) { + return; + } + super.addChildVisual(childEditPart, -1); + } + + /** + * @generated + */ + protected void removeChildVisual(EditPart childEditPart) { + if (removeFixedChild(childEditPart)) { + return; + } + super.removeChildVisual(childEditPart); + } + + /** + * @generated + */ + protected IFigure getContentPaneFor(IGraphicalEditPart editPart) { + if (editPart instanceof IBorderItemEditPart) { + return getBorderedFigure().getBorderItemContainer(); + } + return getContentPane(); + } + + /** + * @generated + */ + protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) { + if (borderItemEditPart instanceof LifelineFloatingLabelEditPartCN) { + IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure()); + borderItemContainer.add(borderItemEditPart.getFigure(), locator); + } else { + super.addBorderItem(borderItemContainer, borderItemEditPart); + } + } + + /** + * @generated + */ + protected NodeFigure createNodePlate() { + RoundedRectangleNodePlateFigure result = new RoundedRectangleNodePlateFigure(100, 25); + return result; + } + + /** + * Creates figure for this edit part. + * + * Body of this method does not depend on settings in generation model + * so you may safely remove <i>generated</i> tag and modify it. + * + * @generated + */ + protected NodeFigure createMainFigure() { + 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 + * @generated + */ + protected IFigure setupContentPane(IFigure nodeShape) { + if (nodeShape.getLayoutManager() == null) { + ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout(); + layout.setSpacing(5); + nodeShape.setLayoutManager(layout); + } + return nodeShape; // use nodeShape itself as contentPane + } + + /** + * @generated + */ + public IFigure getContentPane() { + if (contentPane != null) { + return contentPane; + } + return super.getContentPane(); + } + + /** + * @generated + */ + protected void setForegroundColor(Color color) { + if (primaryShape != null) { + primaryShape.setForegroundColor(color); + } + } + + /** + * @generated + */ + protected void setLineWidth(int width) { + super.setLineWidth(width); + } + + /** + * @generated + */ + protected void setLineType(int style) { + if (primaryShape instanceof IPapyrusNodeFigure) { + ((IPapyrusNodeFigure) primaryShape).setLineStyle(style); + } + } + + /** + * @generated + */ + public EditPart getPrimaryChildEditPart() { + return getChildBySemanticHint(UMLVisualIDRegistry.getType(LifelineNameEditPart.VISUAL_ID)); + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/LifelineFloatingLabelEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/LifelineFloatingLabelEditPartCN.java index b5abc1fa41f..509101b2b53 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/LifelineFloatingLabelEditPartCN.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/LifelineFloatingLabelEditPartCN.java @@ -1,817 +1,817 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.ICustomDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.ExternalLabelPrimaryDragRoleEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.PapyrusWrappingLabel;
-import org.eclipse.papyrus.infra.gmfdiag.common.parsers.ParserUtil;
-import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.uml.diagram.common.editparts.FloatingLabelEditPart;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.uml.diagram.communication.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.uml.diagram.communication.providers.UMLElementTypes;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.uml2.uml.Feature;
-
-/**
- * @generated
- */
-public class LifelineFloatingLabelEditPartCN extends FloatingLabelEditPart
- implements ITextAwareEditPart, IBorderItemEditPart {
-
- /**
- * @generated
- */
- public static final String VISUAL_ID = "Lifeline_FloatingNameLabel";
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
- /**
- * 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
- */
- static {
- registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.communication.edit.parts.LifelineFloatingLabelEditPartCN.VISUAL_ID), new Point(0, 0));
- }
-
- /**
- * @generated
- */
- public LifelineFloatingLabelEditPartCN(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ExternalLabelPrimaryDragRoleEditPolicy());
- }
-
- /**
- * @generated
- */
- public IBorderItemLocator getBorderItemLocator() {
- IFigure parentFigure = getFigure().getParent();
- if (parentFigure != null && parentFigure.getLayoutManager() != null) {
- Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator) constraint;
- }
- return null;
- }
-
- /**
- * @generated
- */
- public void refreshBounds() {
- int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
- int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
- getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height));
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if (figure instanceof WrappingLabel) {
- return ((WrappingLabel) figure).getText();
- } else if (figure instanceof ILabelFigure) {
- return ((ILabelFigure) figure).getText();
- } else {
- return ((Label) figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if (figure instanceof WrappingLabel) {
- ((WrappingLabel) figure).setText(text);
- } else if (figure instanceof ILabelFigure) {
- ((ILabelFigure) figure).setText(text);
- } else {
- ((Label) figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if (figure instanceof WrappingLabel) {
- return ((WrappingLabel) figure).getIcon();
- } else if (figure instanceof ILabelFigure) {
- return ((ILabelFigure) figure).getIcon();
- } else {
- return ((Label) figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if (figure instanceof WrappingLabel) {
- ((WrappingLabel) figure).setIcon(icon);
- } else if (figure instanceof ILabelFigure) {
- ((ILabelFigure) figure).setIcon(icon);
- } else {
- ((Label) figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(IFigure figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List<?> getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- public void setParser(IParser parser) {
- this.parser = parser;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if (parserElement != null && getParser() != null) {
- text = getParser().getPrintString(
- ParserUtil.getParserAdapter(getParserElement(), this),
- getParserOptions().intValue());
- }
- if (text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if (getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(
- ParserUtil.getParserAdapter(getParserElement(), this),
- getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- @Override
- public String isValid(final Object value) {
- if (value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(ParserUtil.getParserAdapter(getParserElement(), LifelineFloatingLabelEditPartCN.this), (String) value));
- }
- });
- return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if (getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(ParserUtil.getParserAdapter(getParserElement(), this));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if (parser == null) {
- parser = ParserUtil.getParser(UMLElementTypes.Lifeline_Shape, getParserElement(), this, VISUAL_ID);
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if (manager == null) {
- setManager(new MultilineLabelDirectEditManager(this,
- MultilineLabelDirectEditManager.getTextCellEditorClass(this),
- UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- BusyIndicator.showWhile(Display.getDefault(), new java.lang.Runnable() {
-
- @Override
- public void run() {
- getManager().show();
- }
- });
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if (getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(char initialCharacter) {
- if (getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager) getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch (directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if (configuration == null || configuration.getLanguage() == null) {
- // Create default edit manager
- 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));
- initializeDirectEditManager(theRequest);
- return;
- } else if (configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if (configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if (configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if (Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
- initializeDirectEditManager(theRequest);
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void initializeDirectEditManager(final Request request) {
- // 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);
- performDirectEdit(initialChar.charValue());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if (maskLabelPolicy == null) {
- maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
- }
- if (maskLabelPolicy == null) {
- View view = (View) getModel();
- if (view.isVisible()) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- } else {
- setLabelTextHelper(getFigure(), ""); //$NON-NLS-1$
- setLabelIconHelper(getFigure(), null);
- }
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
- if (style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
- }
- if (resolveSemanticElement() instanceof Feature) {
- if (((Feature) resolveSemanticElement()).isStatic()) {
- ((WrappingLabel) getFigure()).setTextUnderline(true);
- } else {
- ((WrappingLabel) getFigure()).setTextUnderline(false);
- }
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
- if (style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
- if (style != null) {
- FontData fontData = new FontData(
- style.getFontName(), style.getFontHeight(),
- (style.isBold() ? SWT.BOLD : SWT.NORMAL) |
- (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if (getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
- for (int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if (parserElements != null) {
- for (int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if (accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- @Override
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return getPrimaryView();
- }
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if (checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if (checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if (configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if (languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
- } else {
- 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(), 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
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- @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);
- performDirectEdit(initialChar.charValue());
- } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest) theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- Object feature = event.getFeature();
- if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer) event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) ||
- NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) ||
- NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) ||
- NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if (getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser) getParser();
- if (modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if (resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- IFigure label = createFigurePrim();
- defaultText = getLabelTextHelper(label);
- return label;
- }
-
- /**
- * @generated
- */
- protected IFigure createFigurePrim() {
- return new PapyrusWrappingLabel();
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.edit.parts; + +import java.util.Collections; +import java.util.List; + +import org.eclipse.draw2d.IFigure; +import org.eclipse.draw2d.Label; +import org.eclipse.draw2d.geometry.Point; +import org.eclipse.draw2d.geometry.Rectangle; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.transaction.RecordingCommand; +import org.eclipse.emf.transaction.RunnableWithResult; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.gef.AccessibleEditPart; +import org.eclipse.gef.EditPolicy; +import org.eclipse.gef.Request; +import org.eclipse.gef.requests.DirectEditRequest; +import org.eclipse.gef.tools.DirectEditManager; +import org.eclipse.gmf.runtime.common.ui.services.parser.IParser; +import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus; +import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions; +import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy; +import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator; +import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry; +import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants; +import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager; +import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; +import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser; +import org.eclipse.gmf.runtime.notation.FontStyle; +import org.eclipse.gmf.runtime.notation.NotationPackage; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.text.contentassist.IContentAssistProcessor; +import org.eclipse.jface.viewers.ICellEditorValidator; +import org.eclipse.jface.window.Window; +import org.eclipse.papyrus.extensionpoints.editors.Activator; +import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.configuration.ICustomDirectEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog; +import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog; +import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper; +import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil; +import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.ExternalLabelPrimaryDragRoleEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.PapyrusWrappingLabel; +import org.eclipse.papyrus.infra.gmfdiag.common.parsers.ParserUtil; +import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager; +import org.eclipse.papyrus.uml.diagram.common.editparts.FloatingLabelEditPart; +import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition; +import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure; +import org.eclipse.papyrus.uml.diagram.communication.edit.policies.UMLTextSelectionEditPolicy; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry; +import org.eclipse.papyrus.uml.diagram.communication.providers.UMLElementTypes; +import org.eclipse.swt.SWT; +import org.eclipse.swt.accessibility.AccessibleEvent; +import org.eclipse.swt.custom.BusyIndicator; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.graphics.FontData; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.widgets.Display; +import org.eclipse.ui.PlatformUI; +import org.eclipse.uml2.uml.Feature; + +/** + * @generated + */ +public class LifelineFloatingLabelEditPartCN extends FloatingLabelEditPart + implements ITextAwareEditPart, IBorderItemEditPart { + + /** + * @generated + */ + public static final String VISUAL_ID = "Lifeline_FloatingNameLabel"; + + /** + * @generated + */ + private DirectEditManager manager; + + /** + * @generated + */ + private IParser parser; + + /** + * @generated + */ + private List<?> parserElements; + + /** + * @generated + */ + private String defaultText; + + /** + * 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 + */ + static { + registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.communication.edit.parts.LifelineFloatingLabelEditPartCN.VISUAL_ID), new Point(0, 0)); + } + + /** + * @generated + */ + public LifelineFloatingLabelEditPartCN(View view) { + super(view); + } + + /** + * @generated + */ + protected void createDefaultEditPolicies() { + super.createDefaultEditPolicies(); + installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy()); + installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy()); + installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ExternalLabelPrimaryDragRoleEditPolicy()); + } + + /** + * @generated + */ + public IBorderItemLocator getBorderItemLocator() { + IFigure parentFigure = getFigure().getParent(); + if (parentFigure != null && parentFigure.getLayoutManager() != null) { + Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure()); + return (IBorderItemLocator) constraint; + } + return null; + } + + /** + * @generated + */ + public void refreshBounds() { + int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue(); + int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue(); + int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue(); + int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue(); + getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height)); + } + + /** + * @generated + */ + protected String getLabelTextHelper(IFigure figure) { + if (figure instanceof WrappingLabel) { + return ((WrappingLabel) figure).getText(); + } else if (figure instanceof ILabelFigure) { + return ((ILabelFigure) figure).getText(); + } else { + return ((Label) figure).getText(); + } + } + + /** + * @generated + */ + protected void setLabelTextHelper(IFigure figure, String text) { + if (figure instanceof WrappingLabel) { + ((WrappingLabel) figure).setText(text); + } else if (figure instanceof ILabelFigure) { + ((ILabelFigure) figure).setText(text); + } else { + ((Label) figure).setText(text); + } + } + + /** + * @generated + */ + protected Image getLabelIconHelper(IFigure figure) { + if (figure instanceof WrappingLabel) { + return ((WrappingLabel) figure).getIcon(); + } else if (figure instanceof ILabelFigure) { + return ((ILabelFigure) figure).getIcon(); + } else { + return ((Label) figure).getIcon(); + } + } + + /** + * @generated + */ + protected void setLabelIconHelper(IFigure figure, Image icon) { + if (figure instanceof WrappingLabel) { + ((WrappingLabel) figure).setIcon(icon); + } else if (figure instanceof ILabelFigure) { + ((ILabelFigure) figure).setIcon(icon); + } else { + ((Label) figure).setIcon(icon); + } + } + + /** + * @generated + */ + public void setLabel(IFigure figure) { + unregisterVisuals(); + setFigure(figure); + defaultText = getLabelTextHelper(figure); + registerVisuals(); + refreshVisuals(); + } + + /** + * @generated + */ + protected List<?> getModelChildren() { + return Collections.EMPTY_LIST; + } + + /** + * @generated + */ + public IGraphicalEditPart getChildBySemanticHint(String semanticHint) { + return null; + } + + /** + * @generated + */ + public void setParser(IParser parser) { + this.parser = parser; + } + + /** + * @generated + */ + protected EObject getParserElement() { + return resolveSemanticElement(); + } + + /** + * @generated + */ + protected Image getLabelIcon() { + return null; + } + + /** + * @generated + */ + protected String getLabelText() { + String text = null; + EObject parserElement = getParserElement(); + if (parserElement != null && getParser() != null) { + text = getParser().getPrintString( + ParserUtil.getParserAdapter(getParserElement(), this), + getParserOptions().intValue()); + } + if (text == null || text.length() == 0) { + text = defaultText; + } + return text; + } + + /** + * @generated + */ + public void setLabelText(String text) { + setLabelTextHelper(getFigure(), text); + Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); + if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); + } + Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE); + if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback(); + } + } + + /** + * @generated + */ + public String getEditText() { + if (getParserElement() == null || getParser() == null) { + return ""; //$NON-NLS-1$ + } + return getParser().getEditString( + ParserUtil.getParserAdapter(getParserElement(), this), + getParserOptions().intValue()); + } + + /** + * @generated + */ + protected boolean isEditable() { + return getParser() != null; + } + + /** + * @generated + */ + public ICellEditorValidator getEditTextValidator() { + return new ICellEditorValidator() { + + @Override + public String isValid(final Object value) { + if (value instanceof String) { + final EObject element = getParserElement(); + final IParser parser = getParser(); + try { + IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive( + new RunnableWithResult.Impl<java.lang.Object>() { + + @Override + public void run() { + setResult(parser.isValidEditString(ParserUtil.getParserAdapter(getParserElement(), LifelineFloatingLabelEditPartCN.this), (String) value)); + } + }); + return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage(); + } catch (InterruptedException ie) { + ie.printStackTrace(); + } + } + + // shouldn't get here + return null; + } + }; + } + + /** + * @generated + */ + public IContentAssistProcessor getCompletionProcessor() { + if (getParserElement() == null || getParser() == null) { + return null; + } + return getParser().getCompletionProcessor(ParserUtil.getParserAdapter(getParserElement(), this)); + } + + /** + * @generated + */ + public ParserOptions getParserOptions() { + return ParserOptions.NONE; + } + + /** + * @generated + */ + public IParser getParser() { + if (parser == null) { + parser = ParserUtil.getParser(UMLElementTypes.Lifeline_Shape, getParserElement(), this, VISUAL_ID); + } + return parser; + } + + /** + * @generated + */ + protected DirectEditManager getManager() { + if (manager == null) { + setManager(new MultilineLabelDirectEditManager(this, + MultilineLabelDirectEditManager.getTextCellEditorClass(this), + UMLEditPartFactory.getTextCellEditorLocator(this))); + } + return manager; + } + + /** + * @generated + */ + protected void setManager(DirectEditManager manager) { + this.manager = manager; + } + + /** + * @generated + */ + protected void performDirectEdit() { + BusyIndicator.showWhile(Display.getDefault(), new java.lang.Runnable() { + + @Override + public void run() { + getManager().show(); + } + }); + } + + /** + * @generated + */ + protected void performDirectEdit(Point eventLocation) { + if (getManager() instanceof TextDirectEditManager) { + ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint()); + } + } + + /** + * @generated + */ + protected void performDirectEdit(char initialCharacter) { + if (getManager() instanceof TextDirectEditManager) { + ((TextDirectEditManager) getManager()).show(initialCharacter); + } else { + performDirectEdit(); + } + } + + /** + * @generated + */ + protected void performDirectEditRequest(Request request) { + + final Request theRequest = request; + + if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) { + directEditionMode = getDirectEditionType(); + } + switch (directEditionMode) { + case IDirectEdition.NO_DIRECT_EDITION: + // no direct edition mode => does nothing + return; + case IDirectEdition.EXTENDED_DIRECT_EDITOR: + updateExtendedEditorConfiguration(); + if (configuration == null || configuration.getLanguage() == null) { + // Create default edit manager + 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)); + initializeDirectEditManager(theRequest); + return; + } else if (configuration instanceof IPopupEditorConfiguration) { + IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this); + helper.showEditor(); + return; + } else if (configuration instanceof IAdvancedEditorConfiguration) { + dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement())); + } else if (configuration instanceof IDirectEditorConfiguration) { + dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration); + } else { + return; + } + final Dialog finalDialog = dialog; + + if (Window.OK == dialog.open()) { + TransactionalEditingDomain domain = getEditingDomain(); + RecordingCommand command = new RecordingCommand(domain, "Edit Label") { + + @Override + protected void doExecute() { + configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue()); + + } + }; + domain.getCommandStack().execute(command); + } + } + break; + case IDirectEdition.DEFAULT_DIRECT_EDITOR: + initializeDirectEditManager(theRequest); + break; + default: + break; + } + } + + /** + * @generated + */ + protected void initializeDirectEditManager(final Request request) { + // 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); + performDirectEdit(initialChar.charValue()); + } else { + performDirectEdit(); + } + } + } + }); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + /** + * @generated + */ + protected void refreshVisuals() { + super.refreshVisuals(); + refreshLabel(); + refreshFont(); + refreshFontColor(); + refreshUnderline(); + refreshStrikeThrough(); + } + + /** + * @generated + */ + protected void refreshLabel() { + EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY); + if (maskLabelPolicy == null) { + maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL); + } + if (maskLabelPolicy == null) { + View view = (View) getModel(); + if (view.isVisible()) { + setLabelTextHelper(getFigure(), getLabelText()); + setLabelIconHelper(getFigure(), getLabelIcon()); + } else { + setLabelTextHelper(getFigure(), ""); //$NON-NLS-1$ + setLabelIconHelper(getFigure(), null); + } + } + Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); + if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); + } + Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE); + if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback(); + } + } + + /** + * @generated + */ + protected void refreshUnderline() { + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( + NotationPackage.eINSTANCE.getFontStyle()); + if (style != null && getFigure() instanceof WrappingLabel) { + ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline()); + } + if (resolveSemanticElement() instanceof Feature) { + if (((Feature) resolveSemanticElement()).isStatic()) { + ((WrappingLabel) getFigure()).setTextUnderline(true); + } else { + ((WrappingLabel) getFigure()).setTextUnderline(false); + } + } + } + + /** + * @generated + */ + protected void refreshStrikeThrough() { + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( + NotationPackage.eINSTANCE.getFontStyle()); + if (style != null && getFigure() instanceof WrappingLabel) { + ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough()); + } + } + + /** + * @generated + */ + protected void refreshFont() { + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( + NotationPackage.eINSTANCE.getFontStyle()); + if (style != null) { + FontData fontData = new FontData( + style.getFontName(), style.getFontHeight(), + (style.isBold() ? SWT.BOLD : SWT.NORMAL) | + (style.isItalic() ? SWT.ITALIC : SWT.NORMAL)); + setFont(fontData); + } + } + + /** + * @generated + */ + protected void setFontColor(Color color) { + getFigure().setForegroundColor(color); + } + + /** + * @generated + */ + protected void addSemanticListeners() { + if (getParser() instanceof ISemanticParser) { + EObject element = resolveSemanticElement(); + parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element); + for (int i = 0; i < parserElements.size(); i++) { + addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$ + } + } else { + super.addSemanticListeners(); + } + } + + /** + * @generated + */ + protected void removeSemanticListeners() { + if (parserElements != null) { + for (int i = 0; i < parserElements.size(); i++) { + removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$ + } + } else { + super.removeSemanticListeners(); + } + } + + /** + * @generated + */ + protected AccessibleEditPart getAccessibleEditPart() { + if (accessibleEP == null) { + accessibleEP = new AccessibleGraphicalEditPart() { + + @Override + public void getName(AccessibleEvent e) { + e.result = getLabelTextHelper(getFigure()); + } + }; + } + return accessibleEP; + } + + /** + * @generated + */ + private View getFontStyleOwnerView() { + return getPrimaryView(); + } + + /** + * Returns the kind of associated editor for direct edition. + * + * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition + * @generated + */ + public int getDirectEditionType() { + if (checkExtendedEditor()) { + initExtendedEditorConfiguration(); + return IDirectEdition.EXTENDED_DIRECT_EDITOR; + } + if (checkDefaultEdition()) { + return IDirectEdition.DEFAULT_DIRECT_EDITOR; + } + + // not a named element. no specific editor => do nothing + return IDirectEdition.NO_DIRECT_EDITION; + } + + /** + * Checks if an extended editor is present. + * + * @return <code>true</code> if an extended editor is present. + * @generated + */ + protected boolean checkExtendedEditor() { + if (resolveSemanticElement() != null) { + return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this); + } + return false; + } + + /** + * Checks if a default direct edition is available + * + * @return <code>true</code> if a default direct edition is available + * @generated + */ + protected boolean checkDefaultEdition() { + return (getParser() != null); + } + + /** + * Initializes the extended editor configuration + * @generated + */ + protected void initExtendedEditorConfiguration() { + if (configuration == null) { + final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName()); + if (languagePreferred != null && !languagePreferred.equals("")) { + configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this); + } else { + 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(), 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 + * @generated + */ + protected void performDefaultDirectEditorEdit(final Request theRequest) { + // initialize the direct edit manager + try { + getEditingDomain().runExclusive(new Runnable() { + + @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); + performDirectEdit(initialChar.charValue()); + } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) { + DirectEditRequest editRequest = (DirectEditRequest) theRequest; + performDirectEdit(editRequest.getLocation()); + } else { + performDirectEdit(); + } + } + } + }); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + /** + * @generated + */ + protected void handleNotificationEvent(Notification event) { + Object feature = event.getFeature(); + if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) { + Integer c = (Integer) event.getNewValue(); + setFontColor(DiagramColorRegistry.getInstance().getColor(c)); + } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) { + refreshUnderline(); + } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) { + refreshStrikeThrough(); + } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || + NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || + NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || + NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) { + refreshFont(); + } else { + if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) { + refreshLabel(); + } + if (getParser() instanceof ISemanticParser) { + ISemanticParser modelParser = (ISemanticParser) getParser(); + if (modelParser.areSemanticElementsAffected(null, event)) { + removeSemanticListeners(); + if (resolveSemanticElement() != null) { + addSemanticListeners(); + } + refreshLabel(); + } + } + } + super.handleNotificationEvent(event); + } + + /** + * @generated + */ + protected IFigure createFigure() { + IFigure label = createFigurePrim(); + defaultText = getLabelTextHelper(label); + return label; + } + + /** + * @generated + */ + protected IFigure createFigurePrim() { + return new PapyrusWrappingLabel(); + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/LifelineNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/LifelineNameEditPart.java index 381d12cb065..10b5b539dd9 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/LifelineNameEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/LifelineNameEditPart.java @@ -1,830 +1,830 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.ICustomDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IControlParserForDirectEdit;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusCompartmentEditPart;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.parsers.ParserUtil;
-import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.edit.policies.DefaultNodeLabelDragPolicy;
-import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.uml.diagram.communication.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.uml.diagram.communication.providers.UMLElementTypes;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.uml2.uml.Feature;
-
-/**
- * @generated
- */
-public class LifelineNameEditPart extends PapyrusCompartmentEditPart
- implements ITextAwareEditPart, IControlParserForDirectEdit {
-
- /**
- * @generated
- */
- public static final String VISUAL_ID = "Lifeline_NameLabel";
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
- /**
- * 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
- */
- public LifelineNameEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DefaultNodeLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if (figure instanceof WrappingLabel) {
- return ((WrappingLabel) figure).getText();
- } else if (figure instanceof ILabelFigure) {
- return ((ILabelFigure) figure).getText();
- } else {
- return ((Label) figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if (figure instanceof WrappingLabel) {
- ((WrappingLabel) figure).setText(text);
- } else if (figure instanceof ILabelFigure) {
- ((ILabelFigure) figure).setText(text);
- } else {
- ((Label) figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if (figure instanceof WrappingLabel) {
- return ((WrappingLabel) figure).getIcon();
- } else if (figure instanceof ILabelFigure) {
- return ((ILabelFigure) figure).getIcon();
- } else {
- return ((Label) figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if (figure instanceof WrappingLabel) {
- ((WrappingLabel) figure).setIcon(icon);
- } else if (figure instanceof ILabelFigure) {
- ((ILabelFigure) figure).setIcon(icon);
- } else {
- ((Label) figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(IFigure figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List<?> getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- public void setParser(IParser parser) {
- this.parser = parser;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if (parserElement != null && getParser() != null) {
- text = getParser().getPrintString(
- ParserUtil.getParserAdapter(getParserElement(), this),
- getParserOptions().intValue());
- }
- if (text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if (getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(
- ParserUtil.getParserAdapter(getParserElement(), this),
- getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- @Override
- public String isValid(final Object value) {
- if (value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(ParserUtil.getParserAdapter(getParserElement(), LifelineNameEditPart.this), (String) value));
- }
- });
- return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if (getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(ParserUtil.getParserAdapter(getParserElement(), this));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if (parser == null) {
- parser = ParserUtil.getParser(UMLElementTypes.Lifeline_Shape, getParserElement(), this, VISUAL_ID);
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if (manager == null) {
- setManager(new MultilineLabelDirectEditManager(this,
- MultilineLabelDirectEditManager.getTextCellEditorClass(this),
- UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- BusyIndicator.showWhile(Display.getDefault(), new java.lang.Runnable() {
-
- @Override
- public void run() {
- getManager().show();
- }
- });
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if (getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(char initialCharacter) {
- if (getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager) getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch (directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if (configuration == null || configuration.getLanguage() == null) {
- // Create default edit manager
- 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));
- initializeDirectEditManager(theRequest);
- return;
- } else if (configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if (configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if (configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if (Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
- initializeDirectEditManager(theRequest);
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void initializeDirectEditManager(final Request request) {
- // 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);
- performDirectEdit(initialChar.charValue());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if (maskLabelPolicy == null) {
- maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
- }
- if (maskLabelPolicy == null) {
- View view = (View) getModel();
- if (view.isVisible()) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- } else {
- setLabelTextHelper(getFigure(), ""); //$NON-NLS-1$
- setLabelIconHelper(getFigure(), null);
- }
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
- if (style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
- }
- if (resolveSemanticElement() instanceof Feature) {
- if (((Feature) resolveSemanticElement()).isStatic()) {
- ((WrappingLabel) getFigure()).setTextUnderline(true);
- } else {
- ((WrappingLabel) getFigure()).setTextUnderline(false);
- }
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
- if (style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
- if (style != null) {
- FontData fontData = new FontData(
- style.getFontName(), style.getFontHeight(),
- (style.isBold() ? SWT.BOLD : SWT.NORMAL) |
- (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if (getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
- for (int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if (parserElements != null) {
- for (int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if (accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- @Override
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return getPrimaryView();
- }
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if (checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if (checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if (configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if (languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
- } else {
- 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(), 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
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- @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);
- performDirectEdit(initialChar.charValue());
- } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest) theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * @generated
- */
- protected void addNotationalListeners() {
- super.addNotationalListeners();
- addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- protected void removeNotationalListeners() {
- super.removeNotationalListeners();
- removeListenerFilter("PrimaryView"); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- refreshLabel();
- Object feature = event.getFeature();
- if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer) event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) ||
- NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) ||
- NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) ||
- NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if (getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser) getParser();
- if (modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if (resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
- /**
- * @generated
- */
- private static final String ADD_PARENT_MODEL = "AddParentModel";
-
- /**
- * @generated
- */
- public void activate() {
- super.activate();
- addOwnerElementListeners();
- }
-
- /**
- * @generated
- */
- protected void addOwnerElementListeners() {
- addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel()));
-
- }
-
- /**
- * @generated
- */
- public void deactivate() {
- removeOwnerElementListeners();
- super.deactivate();
-
- }
-
- /**
- * @generated
- */
- protected void removeOwnerElementListeners() {
- removeListenerFilter(ADD_PARENT_MODEL);
-
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.edit.parts; + +import java.util.Collections; +import java.util.List; + +import org.eclipse.draw2d.IFigure; +import org.eclipse.draw2d.Label; +import org.eclipse.draw2d.geometry.Point; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.transaction.RecordingCommand; +import org.eclipse.emf.transaction.RunnableWithResult; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.gef.AccessibleEditPart; +import org.eclipse.gef.EditPolicy; +import org.eclipse.gef.Request; +import org.eclipse.gef.requests.DirectEditRequest; +import org.eclipse.gef.tools.DirectEditManager; +import org.eclipse.gmf.runtime.common.ui.services.parser.IParser; +import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus; +import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions; +import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy; +import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry; +import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants; +import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager; +import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; +import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser; +import org.eclipse.gmf.runtime.notation.FontStyle; +import org.eclipse.gmf.runtime.notation.NotationPackage; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.text.contentassist.IContentAssistProcessor; +import org.eclipse.jface.viewers.ICellEditorValidator; +import org.eclipse.jface.window.Window; +import org.eclipse.papyrus.extensionpoints.editors.Activator; +import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.configuration.ICustomDirectEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog; +import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog; +import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper; +import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil; +import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds; +import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IControlParserForDirectEdit; +import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusCompartmentEditPart; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.parsers.ParserUtil; +import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.edit.policies.DefaultNodeLabelDragPolicy; +import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager; +import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition; +import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure; +import org.eclipse.papyrus.uml.diagram.communication.edit.policies.UMLTextSelectionEditPolicy; +import org.eclipse.papyrus.uml.diagram.communication.providers.UMLElementTypes; +import org.eclipse.swt.SWT; +import org.eclipse.swt.accessibility.AccessibleEvent; +import org.eclipse.swt.custom.BusyIndicator; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.graphics.FontData; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.widgets.Display; +import org.eclipse.ui.PlatformUI; +import org.eclipse.uml2.uml.Feature; + +/** + * @generated + */ +public class LifelineNameEditPart extends PapyrusCompartmentEditPart + implements ITextAwareEditPart, IControlParserForDirectEdit { + + /** + * @generated + */ + public static final String VISUAL_ID = "Lifeline_NameLabel"; + + /** + * @generated + */ + private DirectEditManager manager; + + /** + * @generated + */ + private IParser parser; + + /** + * @generated + */ + private List<?> parserElements; + + /** + * @generated + */ + private String defaultText; + + /** + * 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 + */ + public LifelineNameEditPart(View view) { + super(view); + } + + /** + * @generated + */ + protected void createDefaultEditPolicies() { + super.createDefaultEditPolicies(); + installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy()); + installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy()); + installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DefaultNodeLabelDragPolicy()); + } + + /** + * @generated + */ + protected String getLabelTextHelper(IFigure figure) { + if (figure instanceof WrappingLabel) { + return ((WrappingLabel) figure).getText(); + } else if (figure instanceof ILabelFigure) { + return ((ILabelFigure) figure).getText(); + } else { + return ((Label) figure).getText(); + } + } + + /** + * @generated + */ + protected void setLabelTextHelper(IFigure figure, String text) { + if (figure instanceof WrappingLabel) { + ((WrappingLabel) figure).setText(text); + } else if (figure instanceof ILabelFigure) { + ((ILabelFigure) figure).setText(text); + } else { + ((Label) figure).setText(text); + } + } + + /** + * @generated + */ + protected Image getLabelIconHelper(IFigure figure) { + if (figure instanceof WrappingLabel) { + return ((WrappingLabel) figure).getIcon(); + } else if (figure instanceof ILabelFigure) { + return ((ILabelFigure) figure).getIcon(); + } else { + return ((Label) figure).getIcon(); + } + } + + /** + * @generated + */ + protected void setLabelIconHelper(IFigure figure, Image icon) { + if (figure instanceof WrappingLabel) { + ((WrappingLabel) figure).setIcon(icon); + } else if (figure instanceof ILabelFigure) { + ((ILabelFigure) figure).setIcon(icon); + } else { + ((Label) figure).setIcon(icon); + } + } + + /** + * @generated + */ + public void setLabel(IFigure figure) { + unregisterVisuals(); + setFigure(figure); + defaultText = getLabelTextHelper(figure); + registerVisuals(); + refreshVisuals(); + } + + /** + * @generated + */ + protected List<?> getModelChildren() { + return Collections.EMPTY_LIST; + } + + /** + * @generated + */ + public IGraphicalEditPart getChildBySemanticHint(String semanticHint) { + return null; + } + + /** + * @generated + */ + public void setParser(IParser parser) { + this.parser = parser; + } + + /** + * @generated + */ + protected EObject getParserElement() { + return resolveSemanticElement(); + } + + /** + * @generated + */ + protected Image getLabelIcon() { + return null; + } + + /** + * @generated + */ + protected String getLabelText() { + String text = null; + EObject parserElement = getParserElement(); + if (parserElement != null && getParser() != null) { + text = getParser().getPrintString( + ParserUtil.getParserAdapter(getParserElement(), this), + getParserOptions().intValue()); + } + if (text == null || text.length() == 0) { + text = defaultText; + } + return text; + } + + /** + * @generated + */ + public void setLabelText(String text) { + setLabelTextHelper(getFigure(), text); + Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); + if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); + } + Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE); + if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback(); + } + } + + /** + * @generated + */ + public String getEditText() { + if (getParserElement() == null || getParser() == null) { + return ""; //$NON-NLS-1$ + } + return getParser().getEditString( + ParserUtil.getParserAdapter(getParserElement(), this), + getParserOptions().intValue()); + } + + /** + * @generated + */ + protected boolean isEditable() { + return getParser() != null; + } + + /** + * @generated + */ + public ICellEditorValidator getEditTextValidator() { + return new ICellEditorValidator() { + + @Override + public String isValid(final Object value) { + if (value instanceof String) { + final EObject element = getParserElement(); + final IParser parser = getParser(); + try { + IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive( + new RunnableWithResult.Impl<java.lang.Object>() { + + @Override + public void run() { + setResult(parser.isValidEditString(ParserUtil.getParserAdapter(getParserElement(), LifelineNameEditPart.this), (String) value)); + } + }); + return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage(); + } catch (InterruptedException ie) { + ie.printStackTrace(); + } + } + + // shouldn't get here + return null; + } + }; + } + + /** + * @generated + */ + public IContentAssistProcessor getCompletionProcessor() { + if (getParserElement() == null || getParser() == null) { + return null; + } + return getParser().getCompletionProcessor(ParserUtil.getParserAdapter(getParserElement(), this)); + } + + /** + * @generated + */ + public ParserOptions getParserOptions() { + return ParserOptions.NONE; + } + + /** + * @generated + */ + public IParser getParser() { + if (parser == null) { + parser = ParserUtil.getParser(UMLElementTypes.Lifeline_Shape, getParserElement(), this, VISUAL_ID); + } + return parser; + } + + /** + * @generated + */ + protected DirectEditManager getManager() { + if (manager == null) { + setManager(new MultilineLabelDirectEditManager(this, + MultilineLabelDirectEditManager.getTextCellEditorClass(this), + UMLEditPartFactory.getTextCellEditorLocator(this))); + } + return manager; + } + + /** + * @generated + */ + protected void setManager(DirectEditManager manager) { + this.manager = manager; + } + + /** + * @generated + */ + protected void performDirectEdit() { + BusyIndicator.showWhile(Display.getDefault(), new java.lang.Runnable() { + + @Override + public void run() { + getManager().show(); + } + }); + } + + /** + * @generated + */ + protected void performDirectEdit(Point eventLocation) { + if (getManager() instanceof TextDirectEditManager) { + ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint()); + } + } + + /** + * @generated + */ + protected void performDirectEdit(char initialCharacter) { + if (getManager() instanceof TextDirectEditManager) { + ((TextDirectEditManager) getManager()).show(initialCharacter); + } else { + performDirectEdit(); + } + } + + /** + * @generated + */ + protected void performDirectEditRequest(Request request) { + + final Request theRequest = request; + + if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) { + directEditionMode = getDirectEditionType(); + } + switch (directEditionMode) { + case IDirectEdition.NO_DIRECT_EDITION: + // no direct edition mode => does nothing + return; + case IDirectEdition.EXTENDED_DIRECT_EDITOR: + updateExtendedEditorConfiguration(); + if (configuration == null || configuration.getLanguage() == null) { + // Create default edit manager + 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)); + initializeDirectEditManager(theRequest); + return; + } else if (configuration instanceof IPopupEditorConfiguration) { + IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this); + helper.showEditor(); + return; + } else if (configuration instanceof IAdvancedEditorConfiguration) { + dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement())); + } else if (configuration instanceof IDirectEditorConfiguration) { + dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration); + } else { + return; + } + final Dialog finalDialog = dialog; + + if (Window.OK == dialog.open()) { + TransactionalEditingDomain domain = getEditingDomain(); + RecordingCommand command = new RecordingCommand(domain, "Edit Label") { + + @Override + protected void doExecute() { + configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue()); + + } + }; + domain.getCommandStack().execute(command); + } + } + break; + case IDirectEdition.DEFAULT_DIRECT_EDITOR: + initializeDirectEditManager(theRequest); + break; + default: + break; + } + } + + /** + * @generated + */ + protected void initializeDirectEditManager(final Request request) { + // 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); + performDirectEdit(initialChar.charValue()); + } else { + performDirectEdit(); + } + } + } + }); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + /** + * @generated + */ + protected void refreshVisuals() { + super.refreshVisuals(); + refreshLabel(); + refreshFont(); + refreshFontColor(); + refreshUnderline(); + refreshStrikeThrough(); + } + + /** + * @generated + */ + protected void refreshLabel() { + EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY); + if (maskLabelPolicy == null) { + maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL); + } + if (maskLabelPolicy == null) { + View view = (View) getModel(); + if (view.isVisible()) { + setLabelTextHelper(getFigure(), getLabelText()); + setLabelIconHelper(getFigure(), getLabelIcon()); + } else { + setLabelTextHelper(getFigure(), ""); //$NON-NLS-1$ + setLabelIconHelper(getFigure(), null); + } + } + Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); + if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); + } + Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE); + if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback(); + } + } + + /** + * @generated + */ + protected void refreshUnderline() { + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( + NotationPackage.eINSTANCE.getFontStyle()); + if (style != null && getFigure() instanceof WrappingLabel) { + ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline()); + } + if (resolveSemanticElement() instanceof Feature) { + if (((Feature) resolveSemanticElement()).isStatic()) { + ((WrappingLabel) getFigure()).setTextUnderline(true); + } else { + ((WrappingLabel) getFigure()).setTextUnderline(false); + } + } + } + + /** + * @generated + */ + protected void refreshStrikeThrough() { + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( + NotationPackage.eINSTANCE.getFontStyle()); + if (style != null && getFigure() instanceof WrappingLabel) { + ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough()); + } + } + + /** + * @generated + */ + protected void refreshFont() { + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( + NotationPackage.eINSTANCE.getFontStyle()); + if (style != null) { + FontData fontData = new FontData( + style.getFontName(), style.getFontHeight(), + (style.isBold() ? SWT.BOLD : SWT.NORMAL) | + (style.isItalic() ? SWT.ITALIC : SWT.NORMAL)); + setFont(fontData); + } + } + + /** + * @generated + */ + protected void setFontColor(Color color) { + getFigure().setForegroundColor(color); + } + + /** + * @generated + */ + protected void addSemanticListeners() { + if (getParser() instanceof ISemanticParser) { + EObject element = resolveSemanticElement(); + parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element); + for (int i = 0; i < parserElements.size(); i++) { + addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$ + } + } else { + super.addSemanticListeners(); + } + } + + /** + * @generated + */ + protected void removeSemanticListeners() { + if (parserElements != null) { + for (int i = 0; i < parserElements.size(); i++) { + removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$ + } + } else { + super.removeSemanticListeners(); + } + } + + /** + * @generated + */ + protected AccessibleEditPart getAccessibleEditPart() { + if (accessibleEP == null) { + accessibleEP = new AccessibleGraphicalEditPart() { + + @Override + public void getName(AccessibleEvent e) { + e.result = getLabelTextHelper(getFigure()); + } + }; + } + return accessibleEP; + } + + /** + * @generated + */ + private View getFontStyleOwnerView() { + return getPrimaryView(); + } + + /** + * Returns the kind of associated editor for direct edition. + * + * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition + * @generated + */ + public int getDirectEditionType() { + if (checkExtendedEditor()) { + initExtendedEditorConfiguration(); + return IDirectEdition.EXTENDED_DIRECT_EDITOR; + } + if (checkDefaultEdition()) { + return IDirectEdition.DEFAULT_DIRECT_EDITOR; + } + + // not a named element. no specific editor => do nothing + return IDirectEdition.NO_DIRECT_EDITION; + } + + /** + * Checks if an extended editor is present. + * + * @return <code>true</code> if an extended editor is present. + * @generated + */ + protected boolean checkExtendedEditor() { + if (resolveSemanticElement() != null) { + return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this); + } + return false; + } + + /** + * Checks if a default direct edition is available + * + * @return <code>true</code> if a default direct edition is available + * @generated + */ + protected boolean checkDefaultEdition() { + return (getParser() != null); + } + + /** + * Initializes the extended editor configuration + * @generated + */ + protected void initExtendedEditorConfiguration() { + if (configuration == null) { + final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName()); + if (languagePreferred != null && !languagePreferred.equals("")) { + configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this); + } else { + 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(), 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 + * @generated + */ + protected void performDefaultDirectEditorEdit(final Request theRequest) { + // initialize the direct edit manager + try { + getEditingDomain().runExclusive(new Runnable() { + + @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); + performDirectEdit(initialChar.charValue()); + } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) { + DirectEditRequest editRequest = (DirectEditRequest) theRequest; + performDirectEdit(editRequest.getLocation()); + } else { + performDirectEdit(); + } + } + } + }); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + /** + * @generated + */ + protected void addNotationalListeners() { + super.addNotationalListeners(); + addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$ + } + + /** + * @generated + */ + protected void removeNotationalListeners() { + super.removeNotationalListeners(); + removeListenerFilter("PrimaryView"); //$NON-NLS-1$ + } + + /** + * @generated + */ + protected void handleNotificationEvent(Notification event) { + refreshLabel(); + Object feature = event.getFeature(); + if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) { + Integer c = (Integer) event.getNewValue(); + setFontColor(DiagramColorRegistry.getInstance().getColor(c)); + } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) { + refreshUnderline(); + } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) { + refreshStrikeThrough(); + } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || + NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || + NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || + NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) { + refreshFont(); + } else { + if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) { + refreshLabel(); + } + if (getParser() instanceof ISemanticParser) { + ISemanticParser modelParser = (ISemanticParser) getParser(); + if (modelParser.areSemanticElementsAffected(null, event)) { + removeSemanticListeners(); + if (resolveSemanticElement() != null) { + addSemanticListeners(); + } + refreshLabel(); + } + } + } + super.handleNotificationEvent(event); + } + + /** + * @generated + */ + protected IFigure createFigure() { + // Parent should assign one using setLabel() method + return null; + } + + /** + * @generated + */ + private static final String ADD_PARENT_MODEL = "AddParentModel"; + + /** + * @generated + */ + public void activate() { + super.activate(); + addOwnerElementListeners(); + } + + /** + * @generated + */ + protected void addOwnerElementListeners() { + addListenerFilter(ADD_PARENT_MODEL, this, ((View) getParent().getModel())); + + } + + /** + * @generated + */ + public void deactivate() { + removeOwnerElementListeners(); + super.deactivate(); + + } + + /** + * @generated + */ + protected void removeOwnerElementListeners() { + removeListenerFilter(ADD_PARENT_MODEL); + + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/MessageEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/MessageEditPart.java index 64fae2b4239..f9e1a76a6d9 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/MessageEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/MessageEditPart.java @@ -1,118 +1,118 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.edit.parts;
-
-import org.eclipse.draw2d.Connection;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpart.ConnectionEditPart;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy;
-import org.eclipse.papyrus.uml.diagram.communication.custom.figures.MessageFigure;
-
-/**
- * @generated
- */
-public class MessageEditPart extends ConnectionEditPart implements ITreeBranchEditPart {
-
- /**
- * @generated
- */
- public static final String VISUAL_ID = "Path_Edge";
-
- /**
- * @generated
- */
- public MessageEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
- installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeLinkLabelDisplayEditPolicy());
- }
-
- /**
- * @generated
- */
- protected boolean addFixedChild(EditPart childEditPart) {
- if (childEditPart instanceof MessageNameEditPart) {
- ((MessageNameEditPart) childEditPart).setLabel(
- getPrimaryShape().getFigureMessageCreateLabelFigure());
- }
- if (childEditPart instanceof AppliedStereotypeMessageEditPart) {
- ((AppliedStereotypeMessageEditPart) childEditPart).setLabel(
- getPrimaryShape().getAppliedStereotypeLabel());
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected void addChildVisual(EditPart childEditPart, int index) {
- if (addFixedChild(childEditPart)) {
- return;
- }
- super.addChildVisual(childEditPart, -1);
- }
-
- /**
- * @generated
- */
- protected boolean removeFixedChild(EditPart childEditPart) {
- if (childEditPart instanceof MessageNameEditPart) {
- return true;
- }
- if (childEditPart instanceof AppliedStereotypeMessageEditPart) {
- return true;
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected void removeChildVisual(EditPart childEditPart) {
- if (removeFixedChild(childEditPart)) {
- return;
- }
- super.removeChildVisual(childEditPart);
- }
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected Connection createConnectionFigure() {
- return new MessageFigure();
- }
-
- /**
- * @generated
- */
- public MessageFigure getPrimaryShape() {
- return (MessageFigure) getFigure();
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.edit.parts; + +import org.eclipse.draw2d.Connection; +import org.eclipse.gef.EditPart; +import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.papyrus.infra.gmfdiag.common.editpart.ConnectionEditPart; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy; +import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy; +import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy; +import org.eclipse.papyrus.uml.diagram.communication.custom.figures.MessageFigure; + +/** + * @generated + */ +public class MessageEditPart extends ConnectionEditPart implements ITreeBranchEditPart { + + /** + * @generated + */ + public static final String VISUAL_ID = "Path_Edge"; + + /** + * @generated + */ + public MessageEditPart(View view) { + super(view); + } + + /** + * @generated + */ + protected void createDefaultEditPolicies() { + super.createDefaultEditPolicies(); + installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy()); + installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeLinkLabelDisplayEditPolicy()); + } + + /** + * @generated + */ + protected boolean addFixedChild(EditPart childEditPart) { + if (childEditPart instanceof MessageNameEditPart) { + ((MessageNameEditPart) childEditPart).setLabel( + getPrimaryShape().getFigureMessageCreateLabelFigure()); + } + if (childEditPart instanceof AppliedStereotypeMessageEditPart) { + ((AppliedStereotypeMessageEditPart) childEditPart).setLabel( + getPrimaryShape().getAppliedStereotypeLabel()); + } + return false; + } + + /** + * @generated + */ + protected void addChildVisual(EditPart childEditPart, int index) { + if (addFixedChild(childEditPart)) { + return; + } + super.addChildVisual(childEditPart, -1); + } + + /** + * @generated + */ + protected boolean removeFixedChild(EditPart childEditPart) { + if (childEditPart instanceof MessageNameEditPart) { + return true; + } + if (childEditPart instanceof AppliedStereotypeMessageEditPart) { + return true; + } + return false; + } + + /** + * @generated + */ + protected void removeChildVisual(EditPart childEditPart) { + if (removeFixedChild(childEditPart)) { + return; + } + super.removeChildVisual(childEditPart); + } + + /** + * Creates figure for this edit part. + * + * Body of this method does not depend on settings in generation model + * so you may safely remove <i>generated</i> tag and modify it. + * + * @generated + */ + protected Connection createConnectionFigure() { + return new MessageFigure(); + } + + /** + * @generated + */ + public MessageFigure getPrimaryShape() { + return (MessageFigure) getFigure(); + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/MessageNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/MessageNameEditPart.java index 5bc7c805cdf..9cdaf9a2979 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/MessageNameEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/MessageNameEditPart.java @@ -1,802 +1,802 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.ConnectionLocator;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.ICustomDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.papyrus.infra.emf.appearance.helper.AppearanceHelper;
-import org.eclipse.papyrus.infra.emf.appearance.helper.VisualInformationPapyrusConstants;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IControlParserForDirectEdit;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusLabelEditPart;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.PapyrusLinkLabelDragPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.parsers.ParserUtil;
-import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil;
-import org.eclipse.papyrus.uml.diagram.communication.custom.edit.policies.MessageNameEditPolicy;
-import org.eclipse.papyrus.uml.diagram.communication.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.uml.diagram.communication.providers.UMLElementTypes;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.uml2.uml.Feature;
-
-/**
- * @generated
- */
-public class MessageNameEditPart extends PapyrusLabelEditPart
- implements ITextAwareEditPart, IControlParserForDirectEdit {
-
- /**
- * @generated
- */
- public static final String VISUAL_ID = "Path_MessageLabel";
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
- /**
- * 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
- */
- static {
- registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.communication.edit.parts.MessageNameEditPart.VISUAL_ID), new Point(1, -23));
- }
-
- /**
- * @generated
- */
- public MessageNameEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated Papyrus Generation
- */
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PapyrusLinkLabelDragPolicy());
- installEditPolicy("CustomDisplay", new MessageNameEditPolicy());
- }
-
- /**
- * @generated
- */
- public int getKeyPoint() {
- return ConnectionLocator.MIDDLE;
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if (figure instanceof WrappingLabel) {
- return ((WrappingLabel) figure).getText();
- } else if (figure instanceof ILabelFigure) {
- return ((ILabelFigure) figure).getText();
- } else {
- return ((Label) figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if (figure instanceof WrappingLabel) {
- ((WrappingLabel) figure).setText(text);
- } else if (figure instanceof ILabelFigure) {
- ((ILabelFigure) figure).setText(text);
- } else {
- ((Label) figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if (figure instanceof WrappingLabel) {
- return ((WrappingLabel) figure).getIcon();
- } else if (figure instanceof ILabelFigure) {
- return ((ILabelFigure) figure).getIcon();
- } else {
- return ((Label) figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if (figure instanceof WrappingLabel) {
- ((WrappingLabel) figure).setIcon(icon);
- } else if (figure instanceof ILabelFigure) {
- ((ILabelFigure) figure).setIcon(icon);
- } else {
- ((Label) figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(IFigure figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List<?> getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- public void setParser(IParser parser) {
- this.parser = parser;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramEditPartsUtil.getIcon(getParserElement(), getViewer());
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if (parserElement != null && getParser() != null) {
- text = getParser().getPrintString(
- ParserUtil.getParserAdapter(getParserElement(), this),
- getParserOptions().intValue());
- }
- if (text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if (getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(
- ParserUtil.getParserAdapter(getParserElement(), this),
- getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- @Override
- public String isValid(final Object value) {
- if (value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(ParserUtil.getParserAdapter(getParserElement(), MessageNameEditPart.this), (String) value));
- }
- });
- return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if (getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(ParserUtil.getParserAdapter(getParserElement(), this));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if (parser == null) {
- parser = ParserUtil.getParser(UMLElementTypes.Path_Edge, getParserElement(), this, VISUAL_ID);
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if (manager == null) {
- setManager(new MultilineLabelDirectEditManager(this,
- MultilineLabelDirectEditManager.getTextCellEditorClass(this),
- UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- BusyIndicator.showWhile(Display.getDefault(), new java.lang.Runnable() {
-
- @Override
- public void run() {
- getManager().show();
- }
- });
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if (getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(char initialCharacter) {
- if (getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager) getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch (directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if (configuration == null || configuration.getLanguage() == null) {
- // Create default edit manager
- 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));
- initializeDirectEditManager(theRequest);
- return;
- } else if (configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if (configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if (configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if (Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
- initializeDirectEditManager(theRequest);
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void initializeDirectEditManager(final Request request) {
- // 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);
- performDirectEdit(initialChar.charValue());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if (maskLabelPolicy == null) {
- maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
- }
- if (maskLabelPolicy == null) {
- View view = (View) getModel();
- if (view.isVisible()) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- } else {
- setLabelTextHelper(getFigure(), ""); //$NON-NLS-1$
- setLabelIconHelper(getFigure(), null);
- }
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
- if (style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
- }
- if (resolveSemanticElement() instanceof Feature) {
- if (((Feature) resolveSemanticElement()).isStatic()) {
- ((WrappingLabel) getFigure()).setTextUnderline(true);
- } else {
- ((WrappingLabel) getFigure()).setTextUnderline(false);
- }
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
- if (style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
- if (style != null) {
- FontData fontData = new FontData(
- style.getFontName(), style.getFontHeight(),
- (style.isBold() ? SWT.BOLD : SWT.NORMAL) |
- (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if (getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
- for (int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if (parserElements != null) {
- for (int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if (accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- @Override
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return getPrimaryView();
- }
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if (checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if (checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if (configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if (languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
- } else {
- 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(), 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
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- @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);
- performDirectEdit(initialChar.charValue());
- } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest) theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- Object feature = event.getFeature();
- if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer) event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) ||
- NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) ||
- NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) ||
- NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if (getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser) getParser();
- if (modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if (resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
-
- if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) {
- refreshLabel();
- }
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.edit.parts; + +import java.util.Collections; +import java.util.List; + +import org.eclipse.draw2d.ConnectionLocator; +import org.eclipse.draw2d.IFigure; +import org.eclipse.draw2d.Label; +import org.eclipse.draw2d.geometry.Point; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EAnnotation; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.transaction.RecordingCommand; +import org.eclipse.emf.transaction.RunnableWithResult; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.gef.AccessibleEditPart; +import org.eclipse.gef.EditPolicy; +import org.eclipse.gef.Request; +import org.eclipse.gef.requests.DirectEditRequest; +import org.eclipse.gef.tools.DirectEditManager; +import org.eclipse.gmf.runtime.common.ui.services.parser.IParser; +import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus; +import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions; +import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy; +import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry; +import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants; +import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager; +import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; +import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser; +import org.eclipse.gmf.runtime.notation.FontStyle; +import org.eclipse.gmf.runtime.notation.NotationPackage; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.text.contentassist.IContentAssistProcessor; +import org.eclipse.jface.viewers.ICellEditorValidator; +import org.eclipse.jface.window.Window; +import org.eclipse.papyrus.extensionpoints.editors.Activator; +import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.configuration.ICustomDirectEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog; +import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog; +import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper; +import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil; +import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds; +import org.eclipse.papyrus.infra.emf.appearance.helper.AppearanceHelper; +import org.eclipse.papyrus.infra.emf.appearance.helper.VisualInformationPapyrusConstants; +import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IControlParserForDirectEdit; +import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusLabelEditPart; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.PapyrusLinkLabelDragPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.parsers.ParserUtil; +import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager; +import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition; +import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure; +import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil; +import org.eclipse.papyrus.uml.diagram.communication.custom.edit.policies.MessageNameEditPolicy; +import org.eclipse.papyrus.uml.diagram.communication.edit.policies.UMLTextSelectionEditPolicy; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry; +import org.eclipse.papyrus.uml.diagram.communication.providers.UMLElementTypes; +import org.eclipse.swt.SWT; +import org.eclipse.swt.accessibility.AccessibleEvent; +import org.eclipse.swt.custom.BusyIndicator; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.graphics.FontData; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.widgets.Display; +import org.eclipse.ui.PlatformUI; +import org.eclipse.uml2.uml.Feature; + +/** + * @generated + */ +public class MessageNameEditPart extends PapyrusLabelEditPart + implements ITextAwareEditPart, IControlParserForDirectEdit { + + /** + * @generated + */ + public static final String VISUAL_ID = "Path_MessageLabel"; + + /** + * @generated + */ + private DirectEditManager manager; + + /** + * @generated + */ + private IParser parser; + + /** + * @generated + */ + private List<?> parserElements; + + /** + * @generated + */ + private String defaultText; + + /** + * 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 + */ + static { + registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.communication.edit.parts.MessageNameEditPart.VISUAL_ID), new Point(1, -23)); + } + + /** + * @generated + */ + public MessageNameEditPart(View view) { + super(view); + } + + /** + * @generated Papyrus Generation + */ + @Override + protected void createDefaultEditPolicies() { + super.createDefaultEditPolicies(); + installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy()); + installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy()); + installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PapyrusLinkLabelDragPolicy()); + installEditPolicy("CustomDisplay", new MessageNameEditPolicy()); + } + + /** + * @generated + */ + public int getKeyPoint() { + return ConnectionLocator.MIDDLE; + } + + /** + * @generated + */ + protected String getLabelTextHelper(IFigure figure) { + if (figure instanceof WrappingLabel) { + return ((WrappingLabel) figure).getText(); + } else if (figure instanceof ILabelFigure) { + return ((ILabelFigure) figure).getText(); + } else { + return ((Label) figure).getText(); + } + } + + /** + * @generated + */ + protected void setLabelTextHelper(IFigure figure, String text) { + if (figure instanceof WrappingLabel) { + ((WrappingLabel) figure).setText(text); + } else if (figure instanceof ILabelFigure) { + ((ILabelFigure) figure).setText(text); + } else { + ((Label) figure).setText(text); + } + } + + /** + * @generated + */ + protected Image getLabelIconHelper(IFigure figure) { + if (figure instanceof WrappingLabel) { + return ((WrappingLabel) figure).getIcon(); + } else if (figure instanceof ILabelFigure) { + return ((ILabelFigure) figure).getIcon(); + } else { + return ((Label) figure).getIcon(); + } + } + + /** + * @generated + */ + protected void setLabelIconHelper(IFigure figure, Image icon) { + if (figure instanceof WrappingLabel) { + ((WrappingLabel) figure).setIcon(icon); + } else if (figure instanceof ILabelFigure) { + ((ILabelFigure) figure).setIcon(icon); + } else { + ((Label) figure).setIcon(icon); + } + } + + /** + * @generated + */ + public void setLabel(IFigure figure) { + unregisterVisuals(); + setFigure(figure); + defaultText = getLabelTextHelper(figure); + registerVisuals(); + refreshVisuals(); + } + + /** + * @generated + */ + protected List<?> getModelChildren() { + return Collections.EMPTY_LIST; + } + + /** + * @generated + */ + public IGraphicalEditPart getChildBySemanticHint(String semanticHint) { + return null; + } + + /** + * @generated + */ + public void setParser(IParser parser) { + this.parser = parser; + } + + /** + * @generated + */ + protected EObject getParserElement() { + return resolveSemanticElement(); + } + + /** + * @generated + */ + protected Image getLabelIcon() { + return org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramEditPartsUtil.getIcon(getParserElement(), getViewer()); + } + + /** + * @generated + */ + protected String getLabelText() { + String text = null; + EObject parserElement = getParserElement(); + if (parserElement != null && getParser() != null) { + text = getParser().getPrintString( + ParserUtil.getParserAdapter(getParserElement(), this), + getParserOptions().intValue()); + } + if (text == null || text.length() == 0) { + text = defaultText; + } + return text; + } + + /** + * @generated + */ + public void setLabelText(String text) { + setLabelTextHelper(getFigure(), text); + Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); + if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); + } + Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE); + if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback(); + } + } + + /** + * @generated + */ + public String getEditText() { + if (getParserElement() == null || getParser() == null) { + return ""; //$NON-NLS-1$ + } + return getParser().getEditString( + ParserUtil.getParserAdapter(getParserElement(), this), + getParserOptions().intValue()); + } + + /** + * @generated + */ + protected boolean isEditable() { + return getParser() != null; + } + + /** + * @generated + */ + public ICellEditorValidator getEditTextValidator() { + return new ICellEditorValidator() { + + @Override + public String isValid(final Object value) { + if (value instanceof String) { + final EObject element = getParserElement(); + final IParser parser = getParser(); + try { + IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive( + new RunnableWithResult.Impl<java.lang.Object>() { + + @Override + public void run() { + setResult(parser.isValidEditString(ParserUtil.getParserAdapter(getParserElement(), MessageNameEditPart.this), (String) value)); + } + }); + return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage(); + } catch (InterruptedException ie) { + ie.printStackTrace(); + } + } + + // shouldn't get here + return null; + } + }; + } + + /** + * @generated + */ + public IContentAssistProcessor getCompletionProcessor() { + if (getParserElement() == null || getParser() == null) { + return null; + } + return getParser().getCompletionProcessor(ParserUtil.getParserAdapter(getParserElement(), this)); + } + + /** + * @generated + */ + public ParserOptions getParserOptions() { + return ParserOptions.NONE; + } + + /** + * @generated + */ + public IParser getParser() { + if (parser == null) { + parser = ParserUtil.getParser(UMLElementTypes.Path_Edge, getParserElement(), this, VISUAL_ID); + } + return parser; + } + + /** + * @generated + */ + protected DirectEditManager getManager() { + if (manager == null) { + setManager(new MultilineLabelDirectEditManager(this, + MultilineLabelDirectEditManager.getTextCellEditorClass(this), + UMLEditPartFactory.getTextCellEditorLocator(this))); + } + return manager; + } + + /** + * @generated + */ + protected void setManager(DirectEditManager manager) { + this.manager = manager; + } + + /** + * @generated + */ + protected void performDirectEdit() { + BusyIndicator.showWhile(Display.getDefault(), new java.lang.Runnable() { + + @Override + public void run() { + getManager().show(); + } + }); + } + + /** + * @generated + */ + protected void performDirectEdit(Point eventLocation) { + if (getManager() instanceof TextDirectEditManager) { + ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint()); + } + } + + /** + * @generated + */ + protected void performDirectEdit(char initialCharacter) { + if (getManager() instanceof TextDirectEditManager) { + ((TextDirectEditManager) getManager()).show(initialCharacter); + } else { + performDirectEdit(); + } + } + + /** + * @generated + */ + protected void performDirectEditRequest(Request request) { + + final Request theRequest = request; + + if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) { + directEditionMode = getDirectEditionType(); + } + switch (directEditionMode) { + case IDirectEdition.NO_DIRECT_EDITION: + // no direct edition mode => does nothing + return; + case IDirectEdition.EXTENDED_DIRECT_EDITOR: + updateExtendedEditorConfiguration(); + if (configuration == null || configuration.getLanguage() == null) { + // Create default edit manager + 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)); + initializeDirectEditManager(theRequest); + return; + } else if (configuration instanceof IPopupEditorConfiguration) { + IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this); + helper.showEditor(); + return; + } else if (configuration instanceof IAdvancedEditorConfiguration) { + dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement())); + } else if (configuration instanceof IDirectEditorConfiguration) { + dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration); + } else { + return; + } + final Dialog finalDialog = dialog; + + if (Window.OK == dialog.open()) { + TransactionalEditingDomain domain = getEditingDomain(); + RecordingCommand command = new RecordingCommand(domain, "Edit Label") { + + @Override + protected void doExecute() { + configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue()); + + } + }; + domain.getCommandStack().execute(command); + } + } + break; + case IDirectEdition.DEFAULT_DIRECT_EDITOR: + initializeDirectEditManager(theRequest); + break; + default: + break; + } + } + + /** + * @generated + */ + protected void initializeDirectEditManager(final Request request) { + // 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); + performDirectEdit(initialChar.charValue()); + } else { + performDirectEdit(); + } + } + } + }); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + /** + * @generated + */ + protected void refreshVisuals() { + super.refreshVisuals(); + refreshLabel(); + refreshFont(); + refreshFontColor(); + refreshUnderline(); + refreshStrikeThrough(); + } + + /** + * @generated + */ + protected void refreshLabel() { + EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY); + if (maskLabelPolicy == null) { + maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL); + } + if (maskLabelPolicy == null) { + View view = (View) getModel(); + if (view.isVisible()) { + setLabelTextHelper(getFigure(), getLabelText()); + setLabelIconHelper(getFigure(), getLabelIcon()); + } else { + setLabelTextHelper(getFigure(), ""); //$NON-NLS-1$ + setLabelIconHelper(getFigure(), null); + } + } + Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); + if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); + } + Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE); + if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback(); + } + } + + /** + * @generated + */ + protected void refreshUnderline() { + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( + NotationPackage.eINSTANCE.getFontStyle()); + if (style != null && getFigure() instanceof WrappingLabel) { + ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline()); + } + if (resolveSemanticElement() instanceof Feature) { + if (((Feature) resolveSemanticElement()).isStatic()) { + ((WrappingLabel) getFigure()).setTextUnderline(true); + } else { + ((WrappingLabel) getFigure()).setTextUnderline(false); + } + } + } + + /** + * @generated + */ + protected void refreshStrikeThrough() { + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( + NotationPackage.eINSTANCE.getFontStyle()); + if (style != null && getFigure() instanceof WrappingLabel) { + ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough()); + } + } + + /** + * @generated + */ + protected void refreshFont() { + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( + NotationPackage.eINSTANCE.getFontStyle()); + if (style != null) { + FontData fontData = new FontData( + style.getFontName(), style.getFontHeight(), + (style.isBold() ? SWT.BOLD : SWT.NORMAL) | + (style.isItalic() ? SWT.ITALIC : SWT.NORMAL)); + setFont(fontData); + } + } + + /** + * @generated + */ + protected void setFontColor(Color color) { + getFigure().setForegroundColor(color); + } + + /** + * @generated + */ + protected void addSemanticListeners() { + if (getParser() instanceof ISemanticParser) { + EObject element = resolveSemanticElement(); + parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element); + for (int i = 0; i < parserElements.size(); i++) { + addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$ + } + } else { + super.addSemanticListeners(); + } + } + + /** + * @generated + */ + protected void removeSemanticListeners() { + if (parserElements != null) { + for (int i = 0; i < parserElements.size(); i++) { + removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$ + } + } else { + super.removeSemanticListeners(); + } + } + + /** + * @generated + */ + protected AccessibleEditPart getAccessibleEditPart() { + if (accessibleEP == null) { + accessibleEP = new AccessibleGraphicalEditPart() { + + @Override + public void getName(AccessibleEvent e) { + e.result = getLabelTextHelper(getFigure()); + } + }; + } + return accessibleEP; + } + + /** + * @generated + */ + private View getFontStyleOwnerView() { + return getPrimaryView(); + } + + /** + * Returns the kind of associated editor for direct edition. + * + * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition + * @generated + */ + public int getDirectEditionType() { + if (checkExtendedEditor()) { + initExtendedEditorConfiguration(); + return IDirectEdition.EXTENDED_DIRECT_EDITOR; + } + if (checkDefaultEdition()) { + return IDirectEdition.DEFAULT_DIRECT_EDITOR; + } + + // not a named element. no specific editor => do nothing + return IDirectEdition.NO_DIRECT_EDITION; + } + + /** + * Checks if an extended editor is present. + * + * @return <code>true</code> if an extended editor is present. + * @generated + */ + protected boolean checkExtendedEditor() { + if (resolveSemanticElement() != null) { + return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this); + } + return false; + } + + /** + * Checks if a default direct edition is available + * + * @return <code>true</code> if a default direct edition is available + * @generated + */ + protected boolean checkDefaultEdition() { + return (getParser() != null); + } + + /** + * Initializes the extended editor configuration + * @generated + */ + protected void initExtendedEditorConfiguration() { + if (configuration == null) { + final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName()); + if (languagePreferred != null && !languagePreferred.equals("")) { + configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this); + } else { + 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(), 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 + * @generated + */ + protected void performDefaultDirectEditorEdit(final Request theRequest) { + // initialize the direct edit manager + try { + getEditingDomain().runExclusive(new Runnable() { + + @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); + performDirectEdit(initialChar.charValue()); + } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) { + DirectEditRequest editRequest = (DirectEditRequest) theRequest; + performDirectEdit(editRequest.getLocation()); + } else { + performDirectEdit(); + } + } + } + }); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + /** + * @generated + */ + protected void handleNotificationEvent(Notification event) { + Object feature = event.getFeature(); + if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) { + Integer c = (Integer) event.getNewValue(); + setFontColor(DiagramColorRegistry.getInstance().getColor(c)); + } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) { + refreshUnderline(); + } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) { + refreshStrikeThrough(); + } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || + NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || + NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || + NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) { + refreshFont(); + } else { + if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) { + refreshLabel(); + } + if (getParser() instanceof ISemanticParser) { + ISemanticParser modelParser = (ISemanticParser) getParser(); + if (modelParser.areSemanticElementsAffected(null, event)) { + removeSemanticListeners(); + if (resolveSemanticElement() != null) { + addSemanticListeners(); + } + refreshLabel(); + } + } + } + + if (event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation) event.getNewValue()).getSource())) { + refreshLabel(); + } + super.handleNotificationEvent(event); + } + + /** + * @generated + */ + protected IFigure createFigure() { + // Parent should assign one using setLabel() method + return null; + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/ModelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/ModelEditPart.java index 263963baab6..07e79ec9fd1 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/ModelEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/ModelEditPart.java @@ -1,63 +1,63 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.edit.parts;
-
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusDiagramEditPart;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultCompartmentSemanticEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultCreationEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.PasteEditPolicy;
-import org.eclipse.papyrus.uml.diagram.communication.custom.edit.policies.CustomDiagramDragDropEditPolicy;
-import org.eclipse.papyrus.uml.diagram.communication.custom.edit.policies.CustomOrphanViewPolicy;
-
-/**
- * @generated
- */
-public class ModelEditPart extends PapyrusDiagramEditPart {
-
- /**
- * @generated
- */
- public final static String MODEL_ID = "PapyrusUMLCommunicationDiagram"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final String VISUAL_ID = "Package_CommunicationDiagram";
-
- /**
- * @generated
- */
- public ModelEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
-
- installEditPolicy(EditPolicyRoles.CREATION_ROLE, new DefaultCreationEditPolicy());
- installEditPolicy(PasteEditPolicy.PASTE_ROLE, new PasteEditPolicy());
-
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultCompartmentSemanticEditPolicy());
- //in Papyrus diagrams are not strongly synchronised
- //installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.communication.edit.policies.ModelCanonicalEditPolicy());
-
- installEditPolicy("RemoveOrphanView", new CustomOrphanViewPolicy()); //$NON-NLS-1$
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
- // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.POPUPBAR_ROLE);
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.edit.parts; + +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusDiagramEditPart; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultCompartmentSemanticEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultCreationEditPolicy; +import org.eclipse.papyrus.uml.diagram.common.editpolicies.PasteEditPolicy; +import org.eclipse.papyrus.uml.diagram.communication.custom.edit.policies.CustomDiagramDragDropEditPolicy; +import org.eclipse.papyrus.uml.diagram.communication.custom.edit.policies.CustomOrphanViewPolicy; + +/** + * @generated + */ +public class ModelEditPart extends PapyrusDiagramEditPart { + + /** + * @generated + */ + public final static String MODEL_ID = "PapyrusUMLCommunicationDiagram"; //$NON-NLS-1$ + + /** + * @generated + */ + public static final String VISUAL_ID = "Package_CommunicationDiagram"; + + /** + * @generated + */ + public ModelEditPart(View view) { + super(view); + } + + /** + * @generated + */ + protected void createDefaultEditPolicies() { + super.createDefaultEditPolicies(); + + installEditPolicy(EditPolicyRoles.CREATION_ROLE, new DefaultCreationEditPolicy()); + installEditPolicy(PasteEditPolicy.PASTE_ROLE, new PasteEditPolicy()); + + installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultCompartmentSemanticEditPolicy()); + //in Papyrus diagrams are not strongly synchronised + //installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.uml.diagram.communication.edit.policies.ModelCanonicalEditPolicy()); + + installEditPolicy("RemoveOrphanView", new CustomOrphanViewPolicy()); //$NON-NLS-1$ + installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy()); + // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.POPUPBAR_ROLE); + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/TimeObservationEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/TimeObservationEditPartCN.java index cd29a601438..2df32625b2e 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/TimeObservationEditPartCN.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/TimeObservationEditPartCN.java @@ -1,268 +1,268 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.LayoutEditPolicy;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-import org.eclipse.gef.handles.MoveHandle;
-import org.eclipse.gef.requests.CreateRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.BorderItemSelectionEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
-import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
-import org.eclipse.gmf.runtime.notation.BasicCompartment;
-import org.eclipse.gmf.runtime.notation.Edge;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultGraphicalNodeEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.GetChildLayoutEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.IPapyrusNodeFigure;
-import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.RoundedRectangleNodePlateFigure;
-import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.SelectableBorderedNodeFigure;
-import org.eclipse.papyrus.uml.diagram.common.editparts.RoundedCompartmentEditPart;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeIconlDisplayEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure;
-import org.eclipse.papyrus.uml.diagram.common.locator.ExternalLabelPositionLocator;
-import org.eclipse.papyrus.uml.diagram.common.locator.RoundedRectangleLabelPositionLocator;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * @generated
- */
-public class TimeObservationEditPartCN extends RoundedCompartmentEditPart {
-
- /**
- * @generated
- */
- public static final String VISUAL_ID = "TimeObservation_Shape";
-
- /**
- * @generated
- */
- protected IFigure contentPane;
-
- /**
- * @generated
- */
- protected IFigure primaryShape;
-
- /**
- * @generated
- */
- public TimeObservationEditPartCN(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- 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(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
- installEditPolicy(EditPolicy.LAYOUT_ROLE, new GetChildLayoutEditPolicy());
- // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
- // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
- }
-
- /**
- * @generated
- */
- protected LayoutEditPolicy createLayoutEditPolicy() {
- org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
-
- @Override
- protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View) child.getModel();
- String vid = UMLVisualIDRegistry.getVisualID(childView);
- if (vid != null) {
- switch (vid) {
- case TimeObservationNameEditPartCN.VISUAL_ID:
- case TimeObservationStereotypeLabelEditPartCN.VISUAL_ID:
- return new BorderItemSelectionEditPolicy() {
-
- @Override
- protected List<?> createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost());
- mh.setBorder(null);
- return Collections.singletonList(mh);
- }
- };
- }
- }
- EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (result == null) {
- result = new NonResizableEditPolicy();
- }
- return result;
- }
-
- @Override
- protected Command getMoveChildrenCommand(Request request) {
- return null;
- }
-
- @Override
- protected Command getCreateCommand(CreateRequest request) {
- return null;
- }
- };
- return lep;
- }
-
- /**
- *Papyrus codeGen
- *@generated
- **/
- protected void handleNotificationEvent(Notification event) {
- /*
- * when a node have external node labels, the methods refreshChildren() remove the EditPart corresponding to the Label from the EditPart
- * Registry. After that, we can't reset the visibility to true (using the Show/Hide Label Action)!
- */
- if (NotationPackage.eINSTANCE.getView_Visible().equals(event.getFeature())) {
- Object notifier = event.getNotifier();
- List<?> modelChildren = ((View) getModel()).getChildren();
- if (false == notifier instanceof Edge
- && false == notifier instanceof BasicCompartment) {
- if (modelChildren.contains(event.getNotifier())) {
- return;
- }
- }
- }
- super.handleNotificationEvent(event);
-
- }
-
- /**
- * @generated
- */
- protected IFigure createNodeShape() {
- return primaryShape = new RoundedCompartmentFigure();
- }
-
- /**
- * org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure
- * @generated
- */
- public RoundedCompartmentFigure getPrimaryShape() {
- return (RoundedCompartmentFigure) primaryShape;
- }
-
- /**
- * @generated
- */
- protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if (borderItemEditPart instanceof TimeObservationNameEditPartCN) {
- IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure());
- borderItemContainer.add(borderItemEditPart.getFigure(), locator);
- } else if (borderItemEditPart instanceof TimeObservationStereotypeLabelEditPartCN) {
- IBorderItemLocator locator = new ExternalLabelPositionLocator(getMainFigure());
- borderItemContainer.add(borderItemEditPart.getFigure(), locator);
- } else {
- super.addBorderItem(borderItemContainer, borderItemEditPart);
- }
- }
-
- /**
- * @generated
- */
- protected NodeFigure createNodePlate() {
- RoundedRectangleNodePlateFigure result = new RoundedRectangleNodePlateFigure(20, 20);
- return result;
- }
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected NodeFigure createMainFigure() {
- 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
- * @generated
- */
- protected IFigure setupContentPane(IFigure nodeShape) {
- return nodeShape; // use nodeShape itself as contentPane
- }
-
- /**
- * @generated
- */
- public IFigure getContentPane() {
- if (contentPane != null) {
- return contentPane;
- }
- return super.getContentPane();
- }
-
- /**
- * @generated
- */
- protected void setForegroundColor(Color color) {
- if (primaryShape != null) {
- primaryShape.setForegroundColor(color);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineWidth(int width) {
- super.setLineWidth(width);
- }
-
- /**
- * @generated
- */
- protected void setLineType(int style) {
- if (primaryShape instanceof IPapyrusNodeFigure) {
- ((IPapyrusNodeFigure) primaryShape).setLineStyle(style);
- }
- }
-
- /**
- * @generated
- */
- public EditPart getPrimaryChildEditPart() {
- return getChildBySemanticHint(UMLVisualIDRegistry.getType(TimeObservationNameEditPartCN.VISUAL_ID));
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.edit.parts; + +import java.util.Collections; +import java.util.List; + +import org.eclipse.draw2d.IFigure; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.gef.EditPart; +import org.eclipse.gef.EditPolicy; +import org.eclipse.gef.GraphicalEditPart; +import org.eclipse.gef.Request; +import org.eclipse.gef.commands.Command; +import org.eclipse.gef.editpolicies.LayoutEditPolicy; +import org.eclipse.gef.editpolicies.NonResizableEditPolicy; +import org.eclipse.gef.handles.MoveHandle; +import org.eclipse.gef.requests.CreateRequest; +import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.BorderItemSelectionEditPolicy; +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; +import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator; +import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure; +import org.eclipse.gmf.runtime.notation.BasicCompartment; +import org.eclipse.gmf.runtime.notation.Edge; +import org.eclipse.gmf.runtime.notation.NotationPackage; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultGraphicalNodeEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.GetChildLayoutEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.IPapyrusNodeFigure; +import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.RoundedRectangleNodePlateFigure; +import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.SelectableBorderedNodeFigure; +import org.eclipse.papyrus.uml.diagram.common.editparts.RoundedCompartmentEditPart; +import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeIconlDisplayEditPolicy; +import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy; +import org.eclipse.papyrus.uml.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy; +import org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure; +import org.eclipse.papyrus.uml.diagram.common.locator.ExternalLabelPositionLocator; +import org.eclipse.papyrus.uml.diagram.common.locator.RoundedRectangleLabelPositionLocator; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry; +import org.eclipse.swt.graphics.Color; + +/** + * @generated + */ +public class TimeObservationEditPartCN extends RoundedCompartmentEditPart { + + /** + * @generated + */ + public static final String VISUAL_ID = "TimeObservation_Shape"; + + /** + * @generated + */ + protected IFigure contentPane; + + /** + * @generated + */ + protected IFigure primaryShape; + + /** + * @generated + */ + public TimeObservationEditPartCN(View view) { + super(view); + } + + /** + * @generated + */ + 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(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy()); + installEditPolicy(EditPolicy.LAYOUT_ROLE, new GetChildLayoutEditPolicy()); + // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies + // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); + } + + /** + * @generated + */ + protected LayoutEditPolicy createLayoutEditPolicy() { + org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() { + + @Override + protected EditPolicy createChildEditPolicy(EditPart child) { + View childView = (View) child.getModel(); + String vid = UMLVisualIDRegistry.getVisualID(childView); + if (vid != null) { + switch (vid) { + case TimeObservationNameEditPartCN.VISUAL_ID: + case TimeObservationStereotypeLabelEditPartCN.VISUAL_ID: + return new BorderItemSelectionEditPolicy() { + + @Override + protected List<?> createSelectionHandles() { + MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost()); + mh.setBorder(null); + return Collections.singletonList(mh); + } + }; + } + } + EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); + if (result == null) { + result = new NonResizableEditPolicy(); + } + return result; + } + + @Override + protected Command getMoveChildrenCommand(Request request) { + return null; + } + + @Override + protected Command getCreateCommand(CreateRequest request) { + return null; + } + }; + return lep; + } + + /** + *Papyrus codeGen + *@generated + **/ + protected void handleNotificationEvent(Notification event) { + /* + * when a node have external node labels, the methods refreshChildren() remove the EditPart corresponding to the Label from the EditPart + * Registry. After that, we can't reset the visibility to true (using the Show/Hide Label Action)! + */ + if (NotationPackage.eINSTANCE.getView_Visible().equals(event.getFeature())) { + Object notifier = event.getNotifier(); + List<?> modelChildren = ((View) getModel()).getChildren(); + if (false == notifier instanceof Edge + && false == notifier instanceof BasicCompartment) { + if (modelChildren.contains(event.getNotifier())) { + return; + } + } + } + super.handleNotificationEvent(event); + + } + + /** + * @generated + */ + protected IFigure createNodeShape() { + return primaryShape = new RoundedCompartmentFigure(); + } + + /** + * org.eclipse.papyrus.uml.diagram.common.figure.node.RoundedCompartmentFigure + * @generated + */ + public RoundedCompartmentFigure getPrimaryShape() { + return (RoundedCompartmentFigure) primaryShape; + } + + /** + * @generated + */ + protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) { + if (borderItemEditPart instanceof TimeObservationNameEditPartCN) { + IBorderItemLocator locator = new RoundedRectangleLabelPositionLocator(getMainFigure()); + borderItemContainer.add(borderItemEditPart.getFigure(), locator); + } else if (borderItemEditPart instanceof TimeObservationStereotypeLabelEditPartCN) { + IBorderItemLocator locator = new ExternalLabelPositionLocator(getMainFigure()); + borderItemContainer.add(borderItemEditPart.getFigure(), locator); + } else { + super.addBorderItem(borderItemContainer, borderItemEditPart); + } + } + + /** + * @generated + */ + protected NodeFigure createNodePlate() { + RoundedRectangleNodePlateFigure result = new RoundedRectangleNodePlateFigure(20, 20); + return result; + } + + /** + * Creates figure for this edit part. + * + * Body of this method does not depend on settings in generation model + * so you may safely remove <i>generated</i> tag and modify it. + * + * @generated + */ + protected NodeFigure createMainFigure() { + 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 + * @generated + */ + protected IFigure setupContentPane(IFigure nodeShape) { + return nodeShape; // use nodeShape itself as contentPane + } + + /** + * @generated + */ + public IFigure getContentPane() { + if (contentPane != null) { + return contentPane; + } + return super.getContentPane(); + } + + /** + * @generated + */ + protected void setForegroundColor(Color color) { + if (primaryShape != null) { + primaryShape.setForegroundColor(color); + } + } + + /** + * @generated + */ + protected void setLineWidth(int width) { + super.setLineWidth(width); + } + + /** + * @generated + */ + protected void setLineType(int style) { + if (primaryShape instanceof IPapyrusNodeFigure) { + ((IPapyrusNodeFigure) primaryShape).setLineStyle(style); + } + } + + /** + * @generated + */ + public EditPart getPrimaryChildEditPart() { + return getChildBySemanticHint(UMLVisualIDRegistry.getType(TimeObservationNameEditPartCN.VISUAL_ID)); + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/TimeObservationNameEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/TimeObservationNameEditPartCN.java index 4f739c8ef7d..ce7ebe5f95b 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/TimeObservationNameEditPartCN.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/TimeObservationNameEditPartCN.java @@ -1,817 +1,817 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.ICustomDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.ExternalLabelPrimaryDragRoleEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.PapyrusWrappingLabel;
-import org.eclipse.papyrus.infra.gmfdiag.common.parsers.ParserUtil;
-import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.uml.diagram.common.editparts.FloatingLabelEditPart;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.uml.diagram.communication.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.uml.diagram.communication.providers.UMLElementTypes;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.uml2.uml.Feature;
-
-/**
- * @generated
- */
-public class TimeObservationNameEditPartCN extends FloatingLabelEditPart
- implements ITextAwareEditPart, IBorderItemEditPart {
-
- /**
- * @generated
- */
- public static final String VISUAL_ID = "TimeObservation_NameLabel";
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
- /**
- * 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
- */
- static {
- registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.communication.edit.parts.TimeObservationNameEditPartCN.VISUAL_ID), new Point(0, 0));
- }
-
- /**
- * @generated
- */
- public TimeObservationNameEditPartCN(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ExternalLabelPrimaryDragRoleEditPolicy());
- }
-
- /**
- * @generated
- */
- public IBorderItemLocator getBorderItemLocator() {
- IFigure parentFigure = getFigure().getParent();
- if (parentFigure != null && parentFigure.getLayoutManager() != null) {
- Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator) constraint;
- }
- return null;
- }
-
- /**
- * @generated
- */
- public void refreshBounds() {
- int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
- int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
- getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height));
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if (figure instanceof WrappingLabel) {
- return ((WrappingLabel) figure).getText();
- } else if (figure instanceof ILabelFigure) {
- return ((ILabelFigure) figure).getText();
- } else {
- return ((Label) figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if (figure instanceof WrappingLabel) {
- ((WrappingLabel) figure).setText(text);
- } else if (figure instanceof ILabelFigure) {
- ((ILabelFigure) figure).setText(text);
- } else {
- ((Label) figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if (figure instanceof WrappingLabel) {
- return ((WrappingLabel) figure).getIcon();
- } else if (figure instanceof ILabelFigure) {
- return ((ILabelFigure) figure).getIcon();
- } else {
- return ((Label) figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if (figure instanceof WrappingLabel) {
- ((WrappingLabel) figure).setIcon(icon);
- } else if (figure instanceof ILabelFigure) {
- ((ILabelFigure) figure).setIcon(icon);
- } else {
- ((Label) figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(IFigure figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List<?> getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- public void setParser(IParser parser) {
- this.parser = parser;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if (parserElement != null && getParser() != null) {
- text = getParser().getPrintString(
- ParserUtil.getParserAdapter(getParserElement(), this),
- getParserOptions().intValue());
- }
- if (text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if (getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(
- ParserUtil.getParserAdapter(getParserElement(), this),
- getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- @Override
- public String isValid(final Object value) {
- if (value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(ParserUtil.getParserAdapter(getParserElement(), TimeObservationNameEditPartCN.this), (String) value));
- }
- });
- return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if (getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(ParserUtil.getParserAdapter(getParserElement(), this));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if (parser == null) {
- parser = ParserUtil.getParser(UMLElementTypes.TimeObservation_Shape, getParserElement(), this, VISUAL_ID);
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if (manager == null) {
- setManager(new MultilineLabelDirectEditManager(this,
- MultilineLabelDirectEditManager.getTextCellEditorClass(this),
- UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- BusyIndicator.showWhile(Display.getDefault(), new java.lang.Runnable() {
-
- @Override
- public void run() {
- getManager().show();
- }
- });
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if (getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(char initialCharacter) {
- if (getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager) getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch (directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if (configuration == null || configuration.getLanguage() == null) {
- // Create default edit manager
- 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));
- initializeDirectEditManager(theRequest);
- return;
- } else if (configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if (configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if (configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if (Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
- initializeDirectEditManager(theRequest);
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void initializeDirectEditManager(final Request request) {
- // 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);
- performDirectEdit(initialChar.charValue());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if (maskLabelPolicy == null) {
- maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
- }
- if (maskLabelPolicy == null) {
- View view = (View) getModel();
- if (view.isVisible()) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- } else {
- setLabelTextHelper(getFigure(), ""); //$NON-NLS-1$
- setLabelIconHelper(getFigure(), null);
- }
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
- if (style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
- }
- if (resolveSemanticElement() instanceof Feature) {
- if (((Feature) resolveSemanticElement()).isStatic()) {
- ((WrappingLabel) getFigure()).setTextUnderline(true);
- } else {
- ((WrappingLabel) getFigure()).setTextUnderline(false);
- }
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
- if (style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
- if (style != null) {
- FontData fontData = new FontData(
- style.getFontName(), style.getFontHeight(),
- (style.isBold() ? SWT.BOLD : SWT.NORMAL) |
- (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if (getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
- for (int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if (parserElements != null) {
- for (int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if (accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- @Override
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return getPrimaryView();
- }
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if (checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if (checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if (configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if (languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
- } else {
- 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(), 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
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- @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);
- performDirectEdit(initialChar.charValue());
- } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest) theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- Object feature = event.getFeature();
- if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer) event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) ||
- NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) ||
- NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) ||
- NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if (getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser) getParser();
- if (modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if (resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- IFigure label = createFigurePrim();
- defaultText = getLabelTextHelper(label);
- return label;
- }
-
- /**
- * @generated
- */
- protected IFigure createFigurePrim() {
- return new PapyrusWrappingLabel();
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.edit.parts; + +import java.util.Collections; +import java.util.List; + +import org.eclipse.draw2d.IFigure; +import org.eclipse.draw2d.Label; +import org.eclipse.draw2d.geometry.Point; +import org.eclipse.draw2d.geometry.Rectangle; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.transaction.RecordingCommand; +import org.eclipse.emf.transaction.RunnableWithResult; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.gef.AccessibleEditPart; +import org.eclipse.gef.EditPolicy; +import org.eclipse.gef.Request; +import org.eclipse.gef.requests.DirectEditRequest; +import org.eclipse.gef.tools.DirectEditManager; +import org.eclipse.gmf.runtime.common.ui.services.parser.IParser; +import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus; +import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions; +import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy; +import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator; +import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry; +import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants; +import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager; +import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; +import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser; +import org.eclipse.gmf.runtime.notation.FontStyle; +import org.eclipse.gmf.runtime.notation.NotationPackage; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.text.contentassist.IContentAssistProcessor; +import org.eclipse.jface.viewers.ICellEditorValidator; +import org.eclipse.jface.window.Window; +import org.eclipse.papyrus.extensionpoints.editors.Activator; +import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.configuration.ICustomDirectEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog; +import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog; +import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper; +import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil; +import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.ExternalLabelPrimaryDragRoleEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.PapyrusWrappingLabel; +import org.eclipse.papyrus.infra.gmfdiag.common.parsers.ParserUtil; +import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager; +import org.eclipse.papyrus.uml.diagram.common.editparts.FloatingLabelEditPart; +import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition; +import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure; +import org.eclipse.papyrus.uml.diagram.communication.edit.policies.UMLTextSelectionEditPolicy; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry; +import org.eclipse.papyrus.uml.diagram.communication.providers.UMLElementTypes; +import org.eclipse.swt.SWT; +import org.eclipse.swt.accessibility.AccessibleEvent; +import org.eclipse.swt.custom.BusyIndicator; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.graphics.FontData; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.widgets.Display; +import org.eclipse.ui.PlatformUI; +import org.eclipse.uml2.uml.Feature; + +/** + * @generated + */ +public class TimeObservationNameEditPartCN extends FloatingLabelEditPart + implements ITextAwareEditPart, IBorderItemEditPart { + + /** + * @generated + */ + public static final String VISUAL_ID = "TimeObservation_NameLabel"; + + /** + * @generated + */ + private DirectEditManager manager; + + /** + * @generated + */ + private IParser parser; + + /** + * @generated + */ + private List<?> parserElements; + + /** + * @generated + */ + private String defaultText; + + /** + * 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 + */ + static { + registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.communication.edit.parts.TimeObservationNameEditPartCN.VISUAL_ID), new Point(0, 0)); + } + + /** + * @generated + */ + public TimeObservationNameEditPartCN(View view) { + super(view); + } + + /** + * @generated + */ + protected void createDefaultEditPolicies() { + super.createDefaultEditPolicies(); + installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy()); + installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy()); + installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ExternalLabelPrimaryDragRoleEditPolicy()); + } + + /** + * @generated + */ + public IBorderItemLocator getBorderItemLocator() { + IFigure parentFigure = getFigure().getParent(); + if (parentFigure != null && parentFigure.getLayoutManager() != null) { + Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure()); + return (IBorderItemLocator) constraint; + } + return null; + } + + /** + * @generated + */ + public void refreshBounds() { + int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue(); + int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue(); + int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue(); + int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue(); + getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height)); + } + + /** + * @generated + */ + protected String getLabelTextHelper(IFigure figure) { + if (figure instanceof WrappingLabel) { + return ((WrappingLabel) figure).getText(); + } else if (figure instanceof ILabelFigure) { + return ((ILabelFigure) figure).getText(); + } else { + return ((Label) figure).getText(); + } + } + + /** + * @generated + */ + protected void setLabelTextHelper(IFigure figure, String text) { + if (figure instanceof WrappingLabel) { + ((WrappingLabel) figure).setText(text); + } else if (figure instanceof ILabelFigure) { + ((ILabelFigure) figure).setText(text); + } else { + ((Label) figure).setText(text); + } + } + + /** + * @generated + */ + protected Image getLabelIconHelper(IFigure figure) { + if (figure instanceof WrappingLabel) { + return ((WrappingLabel) figure).getIcon(); + } else if (figure instanceof ILabelFigure) { + return ((ILabelFigure) figure).getIcon(); + } else { + return ((Label) figure).getIcon(); + } + } + + /** + * @generated + */ + protected void setLabelIconHelper(IFigure figure, Image icon) { + if (figure instanceof WrappingLabel) { + ((WrappingLabel) figure).setIcon(icon); + } else if (figure instanceof ILabelFigure) { + ((ILabelFigure) figure).setIcon(icon); + } else { + ((Label) figure).setIcon(icon); + } + } + + /** + * @generated + */ + public void setLabel(IFigure figure) { + unregisterVisuals(); + setFigure(figure); + defaultText = getLabelTextHelper(figure); + registerVisuals(); + refreshVisuals(); + } + + /** + * @generated + */ + protected List<?> getModelChildren() { + return Collections.EMPTY_LIST; + } + + /** + * @generated + */ + public IGraphicalEditPart getChildBySemanticHint(String semanticHint) { + return null; + } + + /** + * @generated + */ + public void setParser(IParser parser) { + this.parser = parser; + } + + /** + * @generated + */ + protected EObject getParserElement() { + return resolveSemanticElement(); + } + + /** + * @generated + */ + protected Image getLabelIcon() { + return null; + } + + /** + * @generated + */ + protected String getLabelText() { + String text = null; + EObject parserElement = getParserElement(); + if (parserElement != null && getParser() != null) { + text = getParser().getPrintString( + ParserUtil.getParserAdapter(getParserElement(), this), + getParserOptions().intValue()); + } + if (text == null || text.length() == 0) { + text = defaultText; + } + return text; + } + + /** + * @generated + */ + public void setLabelText(String text) { + setLabelTextHelper(getFigure(), text); + Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); + if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); + } + Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE); + if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback(); + } + } + + /** + * @generated + */ + public String getEditText() { + if (getParserElement() == null || getParser() == null) { + return ""; //$NON-NLS-1$ + } + return getParser().getEditString( + ParserUtil.getParserAdapter(getParserElement(), this), + getParserOptions().intValue()); + } + + /** + * @generated + */ + protected boolean isEditable() { + return getParser() != null; + } + + /** + * @generated + */ + public ICellEditorValidator getEditTextValidator() { + return new ICellEditorValidator() { + + @Override + public String isValid(final Object value) { + if (value instanceof String) { + final EObject element = getParserElement(); + final IParser parser = getParser(); + try { + IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive( + new RunnableWithResult.Impl<java.lang.Object>() { + + @Override + public void run() { + setResult(parser.isValidEditString(ParserUtil.getParserAdapter(getParserElement(), TimeObservationNameEditPartCN.this), (String) value)); + } + }); + return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage(); + } catch (InterruptedException ie) { + ie.printStackTrace(); + } + } + + // shouldn't get here + return null; + } + }; + } + + /** + * @generated + */ + public IContentAssistProcessor getCompletionProcessor() { + if (getParserElement() == null || getParser() == null) { + return null; + } + return getParser().getCompletionProcessor(ParserUtil.getParserAdapter(getParserElement(), this)); + } + + /** + * @generated + */ + public ParserOptions getParserOptions() { + return ParserOptions.NONE; + } + + /** + * @generated + */ + public IParser getParser() { + if (parser == null) { + parser = ParserUtil.getParser(UMLElementTypes.TimeObservation_Shape, getParserElement(), this, VISUAL_ID); + } + return parser; + } + + /** + * @generated + */ + protected DirectEditManager getManager() { + if (manager == null) { + setManager(new MultilineLabelDirectEditManager(this, + MultilineLabelDirectEditManager.getTextCellEditorClass(this), + UMLEditPartFactory.getTextCellEditorLocator(this))); + } + return manager; + } + + /** + * @generated + */ + protected void setManager(DirectEditManager manager) { + this.manager = manager; + } + + /** + * @generated + */ + protected void performDirectEdit() { + BusyIndicator.showWhile(Display.getDefault(), new java.lang.Runnable() { + + @Override + public void run() { + getManager().show(); + } + }); + } + + /** + * @generated + */ + protected void performDirectEdit(Point eventLocation) { + if (getManager() instanceof TextDirectEditManager) { + ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint()); + } + } + + /** + * @generated + */ + protected void performDirectEdit(char initialCharacter) { + if (getManager() instanceof TextDirectEditManager) { + ((TextDirectEditManager) getManager()).show(initialCharacter); + } else { + performDirectEdit(); + } + } + + /** + * @generated + */ + protected void performDirectEditRequest(Request request) { + + final Request theRequest = request; + + if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) { + directEditionMode = getDirectEditionType(); + } + switch (directEditionMode) { + case IDirectEdition.NO_DIRECT_EDITION: + // no direct edition mode => does nothing + return; + case IDirectEdition.EXTENDED_DIRECT_EDITOR: + updateExtendedEditorConfiguration(); + if (configuration == null || configuration.getLanguage() == null) { + // Create default edit manager + 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)); + initializeDirectEditManager(theRequest); + return; + } else if (configuration instanceof IPopupEditorConfiguration) { + IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this); + helper.showEditor(); + return; + } else if (configuration instanceof IAdvancedEditorConfiguration) { + dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement())); + } else if (configuration instanceof IDirectEditorConfiguration) { + dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration); + } else { + return; + } + final Dialog finalDialog = dialog; + + if (Window.OK == dialog.open()) { + TransactionalEditingDomain domain = getEditingDomain(); + RecordingCommand command = new RecordingCommand(domain, "Edit Label") { + + @Override + protected void doExecute() { + configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue()); + + } + }; + domain.getCommandStack().execute(command); + } + } + break; + case IDirectEdition.DEFAULT_DIRECT_EDITOR: + initializeDirectEditManager(theRequest); + break; + default: + break; + } + } + + /** + * @generated + */ + protected void initializeDirectEditManager(final Request request) { + // 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); + performDirectEdit(initialChar.charValue()); + } else { + performDirectEdit(); + } + } + } + }); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + /** + * @generated + */ + protected void refreshVisuals() { + super.refreshVisuals(); + refreshLabel(); + refreshFont(); + refreshFontColor(); + refreshUnderline(); + refreshStrikeThrough(); + } + + /** + * @generated + */ + protected void refreshLabel() { + EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY); + if (maskLabelPolicy == null) { + maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL); + } + if (maskLabelPolicy == null) { + View view = (View) getModel(); + if (view.isVisible()) { + setLabelTextHelper(getFigure(), getLabelText()); + setLabelIconHelper(getFigure(), getLabelIcon()); + } else { + setLabelTextHelper(getFigure(), ""); //$NON-NLS-1$ + setLabelIconHelper(getFigure(), null); + } + } + Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); + if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); + } + Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE); + if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback(); + } + } + + /** + * @generated + */ + protected void refreshUnderline() { + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( + NotationPackage.eINSTANCE.getFontStyle()); + if (style != null && getFigure() instanceof WrappingLabel) { + ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline()); + } + if (resolveSemanticElement() instanceof Feature) { + if (((Feature) resolveSemanticElement()).isStatic()) { + ((WrappingLabel) getFigure()).setTextUnderline(true); + } else { + ((WrappingLabel) getFigure()).setTextUnderline(false); + } + } + } + + /** + * @generated + */ + protected void refreshStrikeThrough() { + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( + NotationPackage.eINSTANCE.getFontStyle()); + if (style != null && getFigure() instanceof WrappingLabel) { + ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough()); + } + } + + /** + * @generated + */ + protected void refreshFont() { + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( + NotationPackage.eINSTANCE.getFontStyle()); + if (style != null) { + FontData fontData = new FontData( + style.getFontName(), style.getFontHeight(), + (style.isBold() ? SWT.BOLD : SWT.NORMAL) | + (style.isItalic() ? SWT.ITALIC : SWT.NORMAL)); + setFont(fontData); + } + } + + /** + * @generated + */ + protected void setFontColor(Color color) { + getFigure().setForegroundColor(color); + } + + /** + * @generated + */ + protected void addSemanticListeners() { + if (getParser() instanceof ISemanticParser) { + EObject element = resolveSemanticElement(); + parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element); + for (int i = 0; i < parserElements.size(); i++) { + addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$ + } + } else { + super.addSemanticListeners(); + } + } + + /** + * @generated + */ + protected void removeSemanticListeners() { + if (parserElements != null) { + for (int i = 0; i < parserElements.size(); i++) { + removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$ + } + } else { + super.removeSemanticListeners(); + } + } + + /** + * @generated + */ + protected AccessibleEditPart getAccessibleEditPart() { + if (accessibleEP == null) { + accessibleEP = new AccessibleGraphicalEditPart() { + + @Override + public void getName(AccessibleEvent e) { + e.result = getLabelTextHelper(getFigure()); + } + }; + } + return accessibleEP; + } + + /** + * @generated + */ + private View getFontStyleOwnerView() { + return getPrimaryView(); + } + + /** + * Returns the kind of associated editor for direct edition. + * + * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition + * @generated + */ + public int getDirectEditionType() { + if (checkExtendedEditor()) { + initExtendedEditorConfiguration(); + return IDirectEdition.EXTENDED_DIRECT_EDITOR; + } + if (checkDefaultEdition()) { + return IDirectEdition.DEFAULT_DIRECT_EDITOR; + } + + // not a named element. no specific editor => do nothing + return IDirectEdition.NO_DIRECT_EDITION; + } + + /** + * Checks if an extended editor is present. + * + * @return <code>true</code> if an extended editor is present. + * @generated + */ + protected boolean checkExtendedEditor() { + if (resolveSemanticElement() != null) { + return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this); + } + return false; + } + + /** + * Checks if a default direct edition is available + * + * @return <code>true</code> if a default direct edition is available + * @generated + */ + protected boolean checkDefaultEdition() { + return (getParser() != null); + } + + /** + * Initializes the extended editor configuration + * @generated + */ + protected void initExtendedEditorConfiguration() { + if (configuration == null) { + final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName()); + if (languagePreferred != null && !languagePreferred.equals("")) { + configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this); + } else { + 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(), 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 + * @generated + */ + protected void performDefaultDirectEditorEdit(final Request theRequest) { + // initialize the direct edit manager + try { + getEditingDomain().runExclusive(new Runnable() { + + @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); + performDirectEdit(initialChar.charValue()); + } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) { + DirectEditRequest editRequest = (DirectEditRequest) theRequest; + performDirectEdit(editRequest.getLocation()); + } else { + performDirectEdit(); + } + } + } + }); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + /** + * @generated + */ + protected void handleNotificationEvent(Notification event) { + Object feature = event.getFeature(); + if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) { + Integer c = (Integer) event.getNewValue(); + setFontColor(DiagramColorRegistry.getInstance().getColor(c)); + } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) { + refreshUnderline(); + } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) { + refreshStrikeThrough(); + } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || + NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || + NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || + NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) { + refreshFont(); + } else { + if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) { + refreshLabel(); + } + if (getParser() instanceof ISemanticParser) { + ISemanticParser modelParser = (ISemanticParser) getParser(); + if (modelParser.areSemanticElementsAffected(null, event)) { + removeSemanticListeners(); + if (resolveSemanticElement() != null) { + addSemanticListeners(); + } + refreshLabel(); + } + } + } + super.handleNotificationEvent(event); + } + + /** + * @generated + */ + protected IFigure createFigure() { + IFigure label = createFigurePrim(); + defaultText = getLabelTextHelper(label); + return label; + } + + /** + * @generated + */ + protected IFigure createFigurePrim() { + return new PapyrusWrappingLabel(); + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/TimeObservationStereotypeLabelEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/TimeObservationStereotypeLabelEditPartCN.java index b39e989b021..7156aab822c 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/TimeObservationStereotypeLabelEditPartCN.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/TimeObservationStereotypeLabelEditPartCN.java @@ -1,820 +1,820 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.ICustomDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusLabelEditPart;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.ExternalLabelPrimaryDragRoleEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.parsers.ParserUtil;
-import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeExternalNodeEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.AppliedStereotypeWrappingLabelFigure;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.uml.diagram.communication.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.uml.diagram.communication.providers.UMLElementTypes;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.uml2.uml.Feature;
-
-/**
- * @generated
- */
-public class TimeObservationStereotypeLabelEditPartCN extends PapyrusLabelEditPart
- implements ITextAwareEditPart, IBorderItemEditPart {
-
- /**
- * @generated
- */
- public static final String VISUAL_ID = "TimeObservation_StereotypeLabel";
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
- /**
- * 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
- */
- static {
- registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.communication.edit.parts.TimeObservationStereotypeLabelEditPartCN.VISUAL_ID), new Point(0, 0));
- }
-
- /**
- * @generated
- */
- public TimeObservationStereotypeLabelEditPartCN(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy());
- installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeExternalNodeEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ExternalLabelPrimaryDragRoleEditPolicy());
- }
-
- /**
- * @generated
- */
- public IBorderItemLocator getBorderItemLocator() {
- IFigure parentFigure = getFigure().getParent();
- if (parentFigure != null && parentFigure.getLayoutManager() != null) {
- Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator) constraint;
- }
- return null;
- }
-
- /**
- * @generated
- */
- public void refreshBounds() {
- int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
- int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
- getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height));
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if (figure instanceof WrappingLabel) {
- return ((WrappingLabel) figure).getText();
- } else if (figure instanceof ILabelFigure) {
- return ((ILabelFigure) figure).getText();
- } else {
- return ((Label) figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if (figure instanceof WrappingLabel) {
- ((WrappingLabel) figure).setText(text);
- } else if (figure instanceof ILabelFigure) {
- ((ILabelFigure) figure).setText(text);
- } else {
- ((Label) figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if (figure instanceof WrappingLabel) {
- return ((WrappingLabel) figure).getIcon();
- } else if (figure instanceof ILabelFigure) {
- return ((ILabelFigure) figure).getIcon();
- } else {
- return ((Label) figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if (figure instanceof WrappingLabel) {
- ((WrappingLabel) figure).setIcon(icon);
- } else if (figure instanceof ILabelFigure) {
- ((ILabelFigure) figure).setIcon(icon);
- } else {
- ((Label) figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(IFigure figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List<?> getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- public void setParser(IParser parser) {
- this.parser = parser;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if (parserElement != null && getParser() != null) {
- text = getParser().getPrintString(
- ParserUtil.getParserAdapter(getParserElement(), this),
- getParserOptions().intValue());
- }
- if (text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if (getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(
- ParserUtil.getParserAdapter(getParserElement(), this),
- getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- @Override
- public String isValid(final Object value) {
- if (value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
- new RunnableWithResult.Impl<java.lang.Object>() {
-
- @Override
- public void run() {
- setResult(parser.isValidEditString(ParserUtil.getParserAdapter(getParserElement(), TimeObservationStereotypeLabelEditPartCN.this), (String) value));
- }
- });
- return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if (getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(ParserUtil.getParserAdapter(getParserElement(), this));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if (parser == null) {
- parser = ParserUtil.getParser(UMLElementTypes.TimeObservation_Shape, getParserElement(), this, VISUAL_ID);
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if (manager == null) {
- setManager(new MultilineLabelDirectEditManager(this,
- MultilineLabelDirectEditManager.getTextCellEditorClass(this),
- UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- BusyIndicator.showWhile(Display.getDefault(), new java.lang.Runnable() {
-
- @Override
- public void run() {
- getManager().show();
- }
- });
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if (getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(char initialCharacter) {
- if (getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager) getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch (directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if (configuration == null || configuration.getLanguage() == null) {
- // Create default edit manager
- 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));
- initializeDirectEditManager(theRequest);
- return;
- } else if (configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if (configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if (configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if (Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
- initializeDirectEditManager(theRequest);
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void initializeDirectEditManager(final Request request) {
- // 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);
- performDirectEdit(initialChar.charValue());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if (maskLabelPolicy == null) {
- maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
- }
- if (maskLabelPolicy == null) {
- View view = (View) getModel();
- if (view.isVisible()) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- } else {
- setLabelTextHelper(getFigure(), ""); //$NON-NLS-1$
- setLabelIconHelper(getFigure(), null);
- }
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
- ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
- if (style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
- }
- if (resolveSemanticElement() instanceof Feature) {
- if (((Feature) resolveSemanticElement()).isStatic()) {
- ((WrappingLabel) getFigure()).setTextUnderline(true);
- } else {
- ((WrappingLabel) getFigure()).setTextUnderline(false);
- }
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
- if (style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
- if (style != null) {
- FontData fontData = new FontData(
- style.getFontName(), style.getFontHeight(),
- (style.isBold() ? SWT.BOLD : SWT.NORMAL) |
- (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if (getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
- for (int i = 0; i < parserElements.size(); i++) {
- addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if (parserElements != null) {
- for (int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if (accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- @Override
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return getPrimaryView();
- }
-
- /**
- * Returns the kind of associated editor for direct edition.
- *
- * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if (checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if (checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if (resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if (configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if (languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
- } else {
- 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(), 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
- * @generated
- */
- protected void performDefaultDirectEditorEdit(final Request theRequest) {
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- @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);
- performDirectEdit(initialChar.charValue());
- } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest) theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- Object feature = event.getFeature();
- if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer) event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
- refreshUnderline();
- } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
- refreshStrikeThrough();
- } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) ||
- NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) ||
- NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) ||
- NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
- refreshFont();
- } else {
- if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
- refreshLabel();
- }
- if (getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser) getParser();
- if (modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if (resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- IFigure label = createFigurePrim();
- defaultText = getLabelTextHelper(label);
- return label;
- }
-
- /**
- * @generated
- */
- protected IFigure createFigurePrim() {
- return new AppliedStereotypeWrappingLabelFigure();
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.edit.parts; + +import java.util.Collections; +import java.util.List; + +import org.eclipse.draw2d.IFigure; +import org.eclipse.draw2d.Label; +import org.eclipse.draw2d.geometry.Point; +import org.eclipse.draw2d.geometry.Rectangle; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.transaction.RecordingCommand; +import org.eclipse.emf.transaction.RunnableWithResult; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.gef.AccessibleEditPart; +import org.eclipse.gef.EditPolicy; +import org.eclipse.gef.Request; +import org.eclipse.gef.requests.DirectEditRequest; +import org.eclipse.gef.tools.DirectEditManager; +import org.eclipse.gmf.runtime.common.ui.services.parser.IParser; +import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus; +import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions; +import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy; +import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator; +import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry; +import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants; +import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager; +import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; +import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser; +import org.eclipse.gmf.runtime.notation.FontStyle; +import org.eclipse.gmf.runtime.notation.NotationPackage; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.text.contentassist.IContentAssistProcessor; +import org.eclipse.jface.viewers.ICellEditorValidator; +import org.eclipse.jface.window.Window; +import org.eclipse.papyrus.extensionpoints.editors.Activator; +import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.configuration.ICustomDirectEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration; +import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog; +import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog; +import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper; +import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil; +import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds; +import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusLabelEditPart; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.ExternalLabelPrimaryDragRoleEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy; +import org.eclipse.papyrus.infra.gmfdiag.common.parsers.ParserUtil; +import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager; +import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeExternalNodeEditPolicy; +import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy; +import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition; +import org.eclipse.papyrus.uml.diagram.common.figure.node.AppliedStereotypeWrappingLabelFigure; +import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure; +import org.eclipse.papyrus.uml.diagram.communication.edit.policies.UMLTextSelectionEditPolicy; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry; +import org.eclipse.papyrus.uml.diagram.communication.providers.UMLElementTypes; +import org.eclipse.swt.SWT; +import org.eclipse.swt.accessibility.AccessibleEvent; +import org.eclipse.swt.custom.BusyIndicator; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.graphics.FontData; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.widgets.Display; +import org.eclipse.ui.PlatformUI; +import org.eclipse.uml2.uml.Feature; + +/** + * @generated + */ +public class TimeObservationStereotypeLabelEditPartCN extends PapyrusLabelEditPart + implements ITextAwareEditPart, IBorderItemEditPart { + + /** + * @generated + */ + public static final String VISUAL_ID = "TimeObservation_StereotypeLabel"; + + /** + * @generated + */ + private DirectEditManager manager; + + /** + * @generated + */ + private IParser parser; + + /** + * @generated + */ + private List<?> parserElements; + + /** + * @generated + */ + private String defaultText; + + /** + * 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 + */ + static { + registerSnapBackPosition(UMLVisualIDRegistry.getType(org.eclipse.papyrus.uml.diagram.communication.edit.parts.TimeObservationStereotypeLabelEditPartCN.VISUAL_ID), new Point(0, 0)); + } + + /** + * @generated + */ + public TimeObservationStereotypeLabelEditPartCN(View view) { + super(view); + } + + /** + * @generated + */ + protected void createDefaultEditPolicies() { + super.createDefaultEditPolicies(); + installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy()); + installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new UMLTextSelectionEditPolicy()); + installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeExternalNodeEditPolicy()); + installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ExternalLabelPrimaryDragRoleEditPolicy()); + } + + /** + * @generated + */ + public IBorderItemLocator getBorderItemLocator() { + IFigure parentFigure = getFigure().getParent(); + if (parentFigure != null && parentFigure.getLayoutManager() != null) { + Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure()); + return (IBorderItemLocator) constraint; + } + return null; + } + + /** + * @generated + */ + public void refreshBounds() { + int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue(); + int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue(); + int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue(); + int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue(); + getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height)); + } + + /** + * @generated + */ + protected String getLabelTextHelper(IFigure figure) { + if (figure instanceof WrappingLabel) { + return ((WrappingLabel) figure).getText(); + } else if (figure instanceof ILabelFigure) { + return ((ILabelFigure) figure).getText(); + } else { + return ((Label) figure).getText(); + } + } + + /** + * @generated + */ + protected void setLabelTextHelper(IFigure figure, String text) { + if (figure instanceof WrappingLabel) { + ((WrappingLabel) figure).setText(text); + } else if (figure instanceof ILabelFigure) { + ((ILabelFigure) figure).setText(text); + } else { + ((Label) figure).setText(text); + } + } + + /** + * @generated + */ + protected Image getLabelIconHelper(IFigure figure) { + if (figure instanceof WrappingLabel) { + return ((WrappingLabel) figure).getIcon(); + } else if (figure instanceof ILabelFigure) { + return ((ILabelFigure) figure).getIcon(); + } else { + return ((Label) figure).getIcon(); + } + } + + /** + * @generated + */ + protected void setLabelIconHelper(IFigure figure, Image icon) { + if (figure instanceof WrappingLabel) { + ((WrappingLabel) figure).setIcon(icon); + } else if (figure instanceof ILabelFigure) { + ((ILabelFigure) figure).setIcon(icon); + } else { + ((Label) figure).setIcon(icon); + } + } + + /** + * @generated + */ + public void setLabel(IFigure figure) { + unregisterVisuals(); + setFigure(figure); + defaultText = getLabelTextHelper(figure); + registerVisuals(); + refreshVisuals(); + } + + /** + * @generated + */ + protected List<?> getModelChildren() { + return Collections.EMPTY_LIST; + } + + /** + * @generated + */ + public IGraphicalEditPart getChildBySemanticHint(String semanticHint) { + return null; + } + + /** + * @generated + */ + public void setParser(IParser parser) { + this.parser = parser; + } + + /** + * @generated + */ + protected EObject getParserElement() { + return resolveSemanticElement(); + } + + /** + * @generated + */ + protected Image getLabelIcon() { + return null; + } + + /** + * @generated + */ + protected String getLabelText() { + String text = null; + EObject parserElement = getParserElement(); + if (parserElement != null && getParser() != null) { + text = getParser().getPrintString( + ParserUtil.getParserAdapter(getParserElement(), this), + getParserOptions().intValue()); + } + if (text == null || text.length() == 0) { + text = defaultText; + } + return text; + } + + /** + * @generated + */ + public void setLabelText(String text) { + setLabelTextHelper(getFigure(), text); + Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); + if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); + } + Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE); + if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback(); + } + } + + /** + * @generated + */ + public String getEditText() { + if (getParserElement() == null || getParser() == null) { + return ""; //$NON-NLS-1$ + } + return getParser().getEditString( + ParserUtil.getParserAdapter(getParserElement(), this), + getParserOptions().intValue()); + } + + /** + * @generated + */ + protected boolean isEditable() { + return getParser() != null; + } + + /** + * @generated + */ + public ICellEditorValidator getEditTextValidator() { + return new ICellEditorValidator() { + + @Override + public String isValid(final Object value) { + if (value instanceof String) { + final EObject element = getParserElement(); + final IParser parser = getParser(); + try { + IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive( + new RunnableWithResult.Impl<java.lang.Object>() { + + @Override + public void run() { + setResult(parser.isValidEditString(ParserUtil.getParserAdapter(getParserElement(), TimeObservationStereotypeLabelEditPartCN.this), (String) value)); + } + }); + return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage(); + } catch (InterruptedException ie) { + ie.printStackTrace(); + } + } + + // shouldn't get here + return null; + } + }; + } + + /** + * @generated + */ + public IContentAssistProcessor getCompletionProcessor() { + if (getParserElement() == null || getParser() == null) { + return null; + } + return getParser().getCompletionProcessor(ParserUtil.getParserAdapter(getParserElement(), this)); + } + + /** + * @generated + */ + public ParserOptions getParserOptions() { + return ParserOptions.NONE; + } + + /** + * @generated + */ + public IParser getParser() { + if (parser == null) { + parser = ParserUtil.getParser(UMLElementTypes.TimeObservation_Shape, getParserElement(), this, VISUAL_ID); + } + return parser; + } + + /** + * @generated + */ + protected DirectEditManager getManager() { + if (manager == null) { + setManager(new MultilineLabelDirectEditManager(this, + MultilineLabelDirectEditManager.getTextCellEditorClass(this), + UMLEditPartFactory.getTextCellEditorLocator(this))); + } + return manager; + } + + /** + * @generated + */ + protected void setManager(DirectEditManager manager) { + this.manager = manager; + } + + /** + * @generated + */ + protected void performDirectEdit() { + BusyIndicator.showWhile(Display.getDefault(), new java.lang.Runnable() { + + @Override + public void run() { + getManager().show(); + } + }); + } + + /** + * @generated + */ + protected void performDirectEdit(Point eventLocation) { + if (getManager() instanceof TextDirectEditManager) { + ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint()); + } + } + + /** + * @generated + */ + protected void performDirectEdit(char initialCharacter) { + if (getManager() instanceof TextDirectEditManager) { + ((TextDirectEditManager) getManager()).show(initialCharacter); + } else { + performDirectEdit(); + } + } + + /** + * @generated + */ + protected void performDirectEditRequest(Request request) { + + final Request theRequest = request; + + if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) { + directEditionMode = getDirectEditionType(); + } + switch (directEditionMode) { + case IDirectEdition.NO_DIRECT_EDITION: + // no direct edition mode => does nothing + return; + case IDirectEdition.EXTENDED_DIRECT_EDITOR: + updateExtendedEditorConfiguration(); + if (configuration == null || configuration.getLanguage() == null) { + // Create default edit manager + 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)); + initializeDirectEditManager(theRequest); + return; + } else if (configuration instanceof IPopupEditorConfiguration) { + IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this); + helper.showEditor(); + return; + } else if (configuration instanceof IAdvancedEditorConfiguration) { + dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement())); + } else if (configuration instanceof IDirectEditorConfiguration) { + dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration); + } else { + return; + } + final Dialog finalDialog = dialog; + + if (Window.OK == dialog.open()) { + TransactionalEditingDomain domain = getEditingDomain(); + RecordingCommand command = new RecordingCommand(domain, "Edit Label") { + + @Override + protected void doExecute() { + configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue()); + + } + }; + domain.getCommandStack().execute(command); + } + } + break; + case IDirectEdition.DEFAULT_DIRECT_EDITOR: + initializeDirectEditManager(theRequest); + break; + default: + break; + } + } + + /** + * @generated + */ + protected void initializeDirectEditManager(final Request request) { + // 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); + performDirectEdit(initialChar.charValue()); + } else { + performDirectEdit(); + } + } + } + }); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + /** + * @generated + */ + protected void refreshVisuals() { + super.refreshVisuals(); + refreshLabel(); + refreshFont(); + refreshFontColor(); + refreshUnderline(); + refreshStrikeThrough(); + } + + /** + * @generated + */ + protected void refreshLabel() { + EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY); + if (maskLabelPolicy == null) { + maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL); + } + if (maskLabelPolicy == null) { + View view = (View) getModel(); + if (view.isVisible()) { + setLabelTextHelper(getFigure(), getLabelText()); + setLabelIconHelper(getFigure(), getLabelIcon()); + } else { + setLabelTextHelper(getFigure(), ""); //$NON-NLS-1$ + setLabelIconHelper(getFigure(), null); + } + } + Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); + if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); + } + Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE); + if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) { + ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback(); + } + } + + /** + * @generated + */ + protected void refreshUnderline() { + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( + NotationPackage.eINSTANCE.getFontStyle()); + if (style != null && getFigure() instanceof WrappingLabel) { + ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline()); + } + if (resolveSemanticElement() instanceof Feature) { + if (((Feature) resolveSemanticElement()).isStatic()) { + ((WrappingLabel) getFigure()).setTextUnderline(true); + } else { + ((WrappingLabel) getFigure()).setTextUnderline(false); + } + } + } + + /** + * @generated + */ + protected void refreshStrikeThrough() { + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( + NotationPackage.eINSTANCE.getFontStyle()); + if (style != null && getFigure() instanceof WrappingLabel) { + ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough()); + } + } + + /** + * @generated + */ + protected void refreshFont() { + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( + NotationPackage.eINSTANCE.getFontStyle()); + if (style != null) { + FontData fontData = new FontData( + style.getFontName(), style.getFontHeight(), + (style.isBold() ? SWT.BOLD : SWT.NORMAL) | + (style.isItalic() ? SWT.ITALIC : SWT.NORMAL)); + setFont(fontData); + } + } + + /** + * @generated + */ + protected void setFontColor(Color color) { + getFigure().setForegroundColor(color); + } + + /** + * @generated + */ + protected void addSemanticListeners() { + if (getParser() instanceof ISemanticParser) { + EObject element = resolveSemanticElement(); + parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element); + for (int i = 0; i < parserElements.size(); i++) { + addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$ + } + } else { + super.addSemanticListeners(); + } + } + + /** + * @generated + */ + protected void removeSemanticListeners() { + if (parserElements != null) { + for (int i = 0; i < parserElements.size(); i++) { + removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$ + } + } else { + super.removeSemanticListeners(); + } + } + + /** + * @generated + */ + protected AccessibleEditPart getAccessibleEditPart() { + if (accessibleEP == null) { + accessibleEP = new AccessibleGraphicalEditPart() { + + @Override + public void getName(AccessibleEvent e) { + e.result = getLabelTextHelper(getFigure()); + } + }; + } + return accessibleEP; + } + + /** + * @generated + */ + private View getFontStyleOwnerView() { + return getPrimaryView(); + } + + /** + * Returns the kind of associated editor for direct edition. + * + * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition + * @generated + */ + public int getDirectEditionType() { + if (checkExtendedEditor()) { + initExtendedEditorConfiguration(); + return IDirectEdition.EXTENDED_DIRECT_EDITOR; + } + if (checkDefaultEdition()) { + return IDirectEdition.DEFAULT_DIRECT_EDITOR; + } + + // not a named element. no specific editor => do nothing + return IDirectEdition.NO_DIRECT_EDITION; + } + + /** + * Checks if an extended editor is present. + * + * @return <code>true</code> if an extended editor is present. + * @generated + */ + protected boolean checkExtendedEditor() { + if (resolveSemanticElement() != null) { + return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this); + } + return false; + } + + /** + * Checks if a default direct edition is available + * + * @return <code>true</code> if a default direct edition is available + * @generated + */ + protected boolean checkDefaultEdition() { + return (getParser() != null); + } + + /** + * Initializes the extended editor configuration + * @generated + */ + protected void initExtendedEditorConfiguration() { + if (configuration == null) { + final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName()); + if (languagePreferred != null && !languagePreferred.equals("")) { + configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this); + } else { + 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(), 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 + * @generated + */ + protected void performDefaultDirectEditorEdit(final Request theRequest) { + // initialize the direct edit manager + try { + getEditingDomain().runExclusive(new Runnable() { + + @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); + performDirectEdit(initialChar.charValue()); + } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) { + DirectEditRequest editRequest = (DirectEditRequest) theRequest; + performDirectEdit(editRequest.getLocation()); + } else { + performDirectEdit(); + } + } + } + }); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + /** + * @generated + */ + protected void handleNotificationEvent(Notification event) { + Object feature = event.getFeature(); + if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) { + Integer c = (Integer) event.getNewValue(); + setFontColor(DiagramColorRegistry.getInstance().getColor(c)); + } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) { + refreshUnderline(); + } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) { + refreshStrikeThrough(); + } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || + NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || + NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || + NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) { + refreshFont(); + } else { + if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) { + refreshLabel(); + } + if (getParser() instanceof ISemanticParser) { + ISemanticParser modelParser = (ISemanticParser) getParser(); + if (modelParser.areSemanticElementsAffected(null, event)) { + removeSemanticListeners(); + if (resolveSemanticElement() != null) { + addSemanticListeners(); + } + refreshLabel(); + } + } + } + super.handleNotificationEvent(event); + } + + /** + * @generated + */ + protected IFigure createFigure() { + IFigure label = createFigurePrim(); + defaultText = getLabelTextHelper(label); + return label; + } + + /** + * @generated + */ + protected IFigure createFigurePrim() { + return new AppliedStereotypeWrappingLabelFigure(); + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/UMLEditPartFactory.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/UMLEditPartFactory.java index 43c41c4d45a..741998fceeb 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/UMLEditPartFactory.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/parts/UMLEditPartFactory.java @@ -1,192 +1,192 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.edit.parts;
-
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.gef.tools.CellEditorLocator;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.directedit.locator.CellEditorLocatorAccess;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.IMultilineEditableFigure;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * @generated
- */
-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)) {
-
- case ModelEditPart.VISUAL_ID:
- return new ModelEditPart(view);
-
- case InteractionEditPart.VISUAL_ID:
- return new InteractionEditPart(view);
-
- case InteractionNameEditPart.VISUAL_ID:
- return new InteractionNameEditPart(view);
-
- case InteractionFloatingLabelEditPart.VISUAL_ID:
- return new InteractionFloatingLabelEditPart(view);
-
- case LifelineEditPartCN.VISUAL_ID:
- return new LifelineEditPartCN(view);
-
- case LifelineNameEditPart.VISUAL_ID:
- return new LifelineNameEditPart(view);
-
- case LifelineFloatingLabelEditPartCN.VISUAL_ID:
- return new LifelineFloatingLabelEditPartCN(view);
-
- case ConstraintEditPartCN.VISUAL_ID:
- return new ConstraintEditPartCN(view);
-
- case ConstraintNameEditPartCN.VISUAL_ID:
- return new ConstraintNameEditPartCN(view);
-
- case ConstraintBodyEditPartCN.VISUAL_ID:
- return new ConstraintBodyEditPartCN(view);
-
- case CommentEditPartCN.VISUAL_ID:
- return new CommentEditPartCN(view);
-
- case CommentBodyEditPartCN.VISUAL_ID:
- return new CommentBodyEditPartCN(view);
-
- case TimeObservationEditPartCN.VISUAL_ID:
- return new TimeObservationEditPartCN(view);
-
- case TimeObservationNameEditPartCN.VISUAL_ID:
- return new TimeObservationNameEditPartCN(view);
-
- case TimeObservationStereotypeLabelEditPartCN.VISUAL_ID:
- return new TimeObservationStereotypeLabelEditPartCN(view);
-
- case DurationObservationEditPartCN.VISUAL_ID:
- return new DurationObservationEditPartCN(view);
-
- case DurationObservationLabelEditPartCN.VISUAL_ID:
- return new DurationObservationLabelEditPartCN(view);
-
- case DurationObservationStereotypeLabelEditPartCN.VISUAL_ID:
- return new DurationObservationStereotypeLabelEditPartCN(view);
-
- case InteractionCompartmentEditPart.VISUAL_ID:
- return new InteractionCompartmentEditPart(view);
-
- case MessageEditPart.VISUAL_ID:
- return new MessageEditPart(view);
-
- case MessageNameEditPart.VISUAL_ID:
- return new MessageNameEditPart(view);
-
- case AppliedStereotypeMessageEditPart.VISUAL_ID:
- return new AppliedStereotypeMessageEditPart(view);
-
-
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return new CommentAnnotatedElementEditPart(view);
-
-
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return new ConstraintConstrainedElementEditPart(view);
-
-
- case ConnectorDurationObservationEditPart.VISUAL_ID:
- return new ConnectorDurationObservationEditPart(view);
-
-
- case ConnectorTimeObservationEditPart.VISUAL_ID:
- return new ConnectorTimeObservationEditPart(view);
-
- }
- }
- return createUnrecognizedEditPart(context, model);
- }
-
- /**
- * @generated
- */
- private EditPart createUnrecognizedEditPart(EditPart context, Object model) {
- // Handle creation of unrecognized child node EditParts here
- return null;
- }
-
- /**
- * @generated
- */
- public static CellEditorLocator getTextCellEditorLocator(ITextAwareEditPart source) {
- if (source.getFigure() instanceof IMultilineEditableFigure) {
- return new MultilineCellEditorLocator(
- (IMultilineEditableFigure) source.getFigure());
- } else {
- return CellEditorLocatorAccess.INSTANCE.getTextCellEditorLocator(source);
-
- }
- }
-
- /**
- * @generated
- */
- static private class MultilineCellEditorLocator implements CellEditorLocator {
-
- /**
- * @generated
- */
- private IMultilineEditableFigure multilineEditableFigure;
-
- /**
- * @generated
- */
- public MultilineCellEditorLocator(IMultilineEditableFigure figure) {
- this.multilineEditableFigure = figure;
- }
-
- /**
- * @generated
- */
- public IMultilineEditableFigure getMultilineEditableFigure() {
- return multilineEditableFigure;
- }
-
- /**
- * @generated
- */
- public void relocate(CellEditor celleditor) {
- Text text = (Text) celleditor.getControl();
- Rectangle rect = getMultilineEditableFigure().getBounds().getCopy();
- rect.x = getMultilineEditableFigure().getEditionLocation().x;
- rect.y = getMultilineEditableFigure().getEditionLocation().y;
- getMultilineEditableFigure().translateToAbsolute(rect);
- if (getMultilineEditableFigure().getText().length() > 0) {
- rect.setSize(new Dimension(text.computeSize(rect.width,
- SWT.DEFAULT)));
- }
- if (!rect.equals(new Rectangle(text.getBounds()))) {
- text.setBounds(rect.x, rect.y, rect.width, rect.height);
- }
- }
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.edit.parts; + +import org.eclipse.draw2d.geometry.Dimension; +import org.eclipse.draw2d.geometry.Rectangle; +import org.eclipse.gef.EditPart; +import org.eclipse.gef.EditPartFactory; +import org.eclipse.gef.tools.CellEditorLocator; +import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.jface.viewers.CellEditor; +import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.directedit.locator.CellEditorLocatorAccess; +import org.eclipse.papyrus.uml.diagram.common.figure.node.IMultilineEditableFigure; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry; +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.Text; + +/** + * @generated + */ +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)) { + + case ModelEditPart.VISUAL_ID: + return new ModelEditPart(view); + + case InteractionEditPart.VISUAL_ID: + return new InteractionEditPart(view); + + case InteractionNameEditPart.VISUAL_ID: + return new InteractionNameEditPart(view); + + case InteractionFloatingLabelEditPart.VISUAL_ID: + return new InteractionFloatingLabelEditPart(view); + + case LifelineEditPartCN.VISUAL_ID: + return new LifelineEditPartCN(view); + + case LifelineNameEditPart.VISUAL_ID: + return new LifelineNameEditPart(view); + + case LifelineFloatingLabelEditPartCN.VISUAL_ID: + return new LifelineFloatingLabelEditPartCN(view); + + case ConstraintEditPartCN.VISUAL_ID: + return new ConstraintEditPartCN(view); + + case ConstraintNameEditPartCN.VISUAL_ID: + return new ConstraintNameEditPartCN(view); + + case ConstraintBodyEditPartCN.VISUAL_ID: + return new ConstraintBodyEditPartCN(view); + + case CommentEditPartCN.VISUAL_ID: + return new CommentEditPartCN(view); + + case CommentBodyEditPartCN.VISUAL_ID: + return new CommentBodyEditPartCN(view); + + case TimeObservationEditPartCN.VISUAL_ID: + return new TimeObservationEditPartCN(view); + + case TimeObservationNameEditPartCN.VISUAL_ID: + return new TimeObservationNameEditPartCN(view); + + case TimeObservationStereotypeLabelEditPartCN.VISUAL_ID: + return new TimeObservationStereotypeLabelEditPartCN(view); + + case DurationObservationEditPartCN.VISUAL_ID: + return new DurationObservationEditPartCN(view); + + case DurationObservationLabelEditPartCN.VISUAL_ID: + return new DurationObservationLabelEditPartCN(view); + + case DurationObservationStereotypeLabelEditPartCN.VISUAL_ID: + return new DurationObservationStereotypeLabelEditPartCN(view); + + case InteractionCompartmentEditPart.VISUAL_ID: + return new InteractionCompartmentEditPart(view); + + case MessageEditPart.VISUAL_ID: + return new MessageEditPart(view); + + case MessageNameEditPart.VISUAL_ID: + return new MessageNameEditPart(view); + + case AppliedStereotypeMessageEditPart.VISUAL_ID: + return new AppliedStereotypeMessageEditPart(view); + + + case CommentAnnotatedElementEditPart.VISUAL_ID: + return new CommentAnnotatedElementEditPart(view); + + + case ConstraintConstrainedElementEditPart.VISUAL_ID: + return new ConstraintConstrainedElementEditPart(view); + + + case ConnectorDurationObservationEditPart.VISUAL_ID: + return new ConnectorDurationObservationEditPart(view); + + + case ConnectorTimeObservationEditPart.VISUAL_ID: + return new ConnectorTimeObservationEditPart(view); + + } + } + return createUnrecognizedEditPart(context, model); + } + + /** + * @generated + */ + private EditPart createUnrecognizedEditPart(EditPart context, Object model) { + // Handle creation of unrecognized child node EditParts here + return null; + } + + /** + * @generated + */ + public static CellEditorLocator getTextCellEditorLocator(ITextAwareEditPart source) { + if (source.getFigure() instanceof IMultilineEditableFigure) { + return new MultilineCellEditorLocator( + (IMultilineEditableFigure) source.getFigure()); + } else { + return CellEditorLocatorAccess.INSTANCE.getTextCellEditorLocator(source); + + } + } + + /** + * @generated + */ + static private class MultilineCellEditorLocator implements CellEditorLocator { + + /** + * @generated + */ + private IMultilineEditableFigure multilineEditableFigure; + + /** + * @generated + */ + public MultilineCellEditorLocator(IMultilineEditableFigure figure) { + this.multilineEditableFigure = figure; + } + + /** + * @generated + */ + public IMultilineEditableFigure getMultilineEditableFigure() { + return multilineEditableFigure; + } + + /** + * @generated + */ + public void relocate(CellEditor celleditor) { + Text text = (Text) celleditor.getControl(); + Rectangle rect = getMultilineEditableFigure().getBounds().getCopy(); + rect.x = getMultilineEditableFigure().getEditionLocation().x; + rect.y = getMultilineEditableFigure().getEditionLocation().y; + getMultilineEditableFigure().translateToAbsolute(rect); + if (getMultilineEditableFigure().getText().length() > 0) { + rect.setSize(new Dimension(text.computeSize(rect.width, + SWT.DEFAULT))); + } + if (!rect.equals(new Rectangle(text.getBounds()))) { + text.setBounds(rect.x, rect.y, rect.width, rect.height); + } + } + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/policies/UMLBaseItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/policies/UMLBaseItemSemanticEditPolicy.java index 98bb1bc6179..27a48b257e9 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/policies/UMLBaseItemSemanticEditPolicy.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/policies/UMLBaseItemSemanticEditPolicy.java @@ -1,489 +1,489 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.edit.policies;
-
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gef.requests.ReconnectRequest;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.core.command.ICompositeCommand;
-import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.SemanticEditPolicy;
-import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.MoveElementsCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DuplicateElementsRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.GetEditContextRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.MoveRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.edit.helpers.GeneratedEditHelperBase;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
-import org.eclipse.papyrus.uml.diagram.communication.expressions.UMLOCLFactory;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.uml.diagram.communication.providers.UMLElementTypes;
-import org.eclipse.uml2.uml.Comment;
-import org.eclipse.uml2.uml.Constraint;
-import org.eclipse.uml2.uml.DurationObservation;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Interaction;
-import org.eclipse.uml2.uml.Message;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.TimeObservation;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * @generated
- */
-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$
- /**
- * @generated
- */
- private final IElementType myElementType;
-
- /**
- * @generated
- */
- protected UMLBaseItemSemanticEditPolicy(IElementType elementType) {
- myElementType = elementType;
- }
-
- /**
- * Extended request data key to hold editpart visual id.
- * Add visual id of edited editpart to extended data of the request
- * so command switch can decide what kind of diagram element is being edited.
- * It is done in those cases when it's not possible to deduce diagram
- * element kind from domain element.
- * 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
- *
- * @generated
- */
- @SuppressWarnings("unchecked")
- public Command getCommand(Request request) {
- if (request instanceof ReconnectRequest) {
- Object view = ((ReconnectRequest) request).getConnectionEditPart().getModel();
- if (view instanceof View) {
- String id = UMLVisualIDRegistry.getVisualID((View) view);
- request.getExtendedData().put(VISUAL_ID_KEY, id);
- request.getExtendedData().put(GRAPHICAL_RECONNECTED_EDGE, view);
- }
- }
- return super.getCommand(request);
- }
-
- /**
- * Returns visual id from request parameters.
- * @generated
- */
- protected String getVisualID(IEditCommandRequest request) {
- return (String) request.getParameter(VISUAL_ID_KEY);
- }
-
- /**
- * @generated
- */
- protected Command getSemanticCommand(IEditCommandRequest request) {
- IEditCommandRequest completedRequest = completeRequest(request);
- Command semanticCommand = getSemanticCommandSwitch(completedRequest);
- semanticCommand = getEditHelperCommand(completedRequest, semanticCommand);
- if (completedRequest instanceof DestroyRequest) {
- DestroyRequest destroyRequest = (DestroyRequest) completedRequest;
- return shouldProceed(destroyRequest) ? addDeleteViewCommand(semanticCommand, destroyRequest) : null;
- }
- return semanticCommand;
- }
-
- /**
- * @generated
- */
- protected Command addDeleteViewCommand(Command mainCommand, DestroyRequest completedRequest) {
- Command deleteViewCommand = getGEFWrapper(new DeleteCommand(getEditingDomain(), (View) getHost().getModel()));
- return mainCommand == null ? deleteViewCommand : mainCommand.chain(deleteViewCommand);
- }
-
- /**
- * @generated
- */
- private Command getEditHelperCommand(IEditCommandRequest request, Command editPolicyCommand) {
- if (editPolicyCommand != null) {
- ICommand command = editPolicyCommand instanceof ICommandProxy ? ((ICommandProxy) editPolicyCommand).getICommand() : new CommandProxy(editPolicyCommand);
- request.setParameter(GeneratedEditHelperBase.EDIT_POLICY_COMMAND, command);
- }
- IElementType requestContextElementType = getContextElementType(request);
- request.setParameter(GeneratedEditHelperBase.CONTEXT_ELEMENT_TYPE, requestContextElementType);
- 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)) {
- command = new CompositeTransactionalCommand(getEditingDomain(), command.getLabel()).compose(command);
- }
- return new ICommandProxy(command);
- }
- return editPolicyCommand;
- }
-
- /**
- * @generated
- */
- protected IElementType getContextElementType(IEditCommandRequest request) {
- IElementType requestContextElementType = UMLElementTypes.getElementType(getVisualID(request));
- return requestContextElementType != null ? requestContextElementType : myElementType;
- }
-
- /**
- * @generated
- */
- protected Command getSemanticCommandSwitch(IEditCommandRequest req) {
- if (req instanceof CreateRelationshipRequest) {
- return getCreateRelationshipCommand((CreateRelationshipRequest) req);
- } else if (req instanceof CreateElementRequest) {
- return getCreateCommand((CreateElementRequest) req);
- } else if (req instanceof ConfigureRequest) {
- return getConfigureCommand((ConfigureRequest) req);
- } else if (req instanceof DestroyElementRequest) {
- return getDestroyElementCommand((DestroyElementRequest) req);
- } else if (req instanceof DestroyReferenceRequest) {
- return getDestroyReferenceCommand((DestroyReferenceRequest) req);
- } else if (req instanceof DuplicateElementsRequest) {
- return getDuplicateCommand((DuplicateElementsRequest) req);
- } else if (req instanceof GetEditContextRequest) {
- return getEditContextCommand((GetEditContextRequest) req);
- } else if (req instanceof MoveRequest) {
- return getMoveCommand((MoveRequest) req);
- } else if (req instanceof ReorientReferenceRelationshipRequest) {
- return getReorientReferenceRelationshipCommand((ReorientReferenceRelationshipRequest) req);
- } else if (req instanceof ReorientRelationshipRequest) {
- return getReorientRelationshipCommand((ReorientRelationshipRequest) req);
- } else if (req instanceof SetRequest) {
- return getSetCommand((SetRequest) req);
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getConfigureCommand(ConfigureRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCreateCommand(CreateElementRequest req) {
- IElementType requestElementType = req.getElementType();
- if (requestElementType instanceof IElementType) {
- IElementEditService commandProvider = ElementEditServiceUtils.getCommandProvider(req.getContainer());
- if (commandProvider != null) {
- ICommand command = commandProvider.getEditCommand(req);
- if (command != null && command.canExecute()) {
- return new ICommandProxy(command);
- }
- }
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getSetCommand(SetRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getEditContextCommand(GetEditContextRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getDestroyReferenceCommand(DestroyReferenceRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getDuplicateCommand(DuplicateElementsRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getMoveCommand(MoveRequest req) {
- EObject targetCEObject = req.getTargetContainer();
- if (targetCEObject != null) {
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(targetCEObject);
- if (provider != null) {
- ICommand moveCommand = provider.getEditCommand(req);
- if (moveCommand != null) {
- return new ICommandProxy(moveCommand);
- }
- }
- return UnexecutableCommand.INSTANCE;
- } else {
- return getGEFWrapper(new MoveElementsCommand(req));
- }
-
- }
-
- /**
- * @generated
- */
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * @generated
- */
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * @generated
- */
- protected final Command getGEFWrapper(ICommand cmd) {
- return (cmd == null) ? UnexecutableCommand.INSTANCE : new ICommandProxy(cmd);
- }
-
- /**
- * Returns editing domain from the host edit part.
- * @generated
- */
- protected TransactionalEditingDomain getEditingDomain() {
- return ((IGraphicalEditPart) getHost()).getEditingDomain();
- }
-
- /**
- * Clean all shortcuts to the host element from the same diagram
- * @generated
- */
- protected void addDestroyShortcutsCommand(ICompositeCommand cmd, View view) {
- assert view.getEAnnotation("Shortcut") == null; //$NON-NLS-1$
- for (Iterator<?> it = view.getDiagram().getChildren().iterator(); it.hasNext();) {
- View nextView = (View) it.next();
- if (nextView.getEAnnotation("Shortcut") == null || !nextView.isSetElement() || nextView.getElement() != view.getElement()) { //$NON-NLS-1$
- continue;
- }
- cmd.add(new DeleteCommand(getEditingDomain(), nextView));
- }
- }
-
- /**
- * @generated
- */
- public static LinkConstraints getLinkConstraints() {
- LinkConstraints cached = UMLDiagramEditorPlugin.getInstance().getLinkConstraints();
- if (cached == null) {
- UMLDiagramEditorPlugin.getInstance().setLinkConstraints(cached = new LinkConstraints());
- }
- return cached;
- }
-
- /**
- * @generated
- */
- public static class LinkConstraints {
-
- /**
- * @generated
- */
- public LinkConstraints() { // use static method #getLinkConstraints() to access instance
- }
-
- /**
- * @generated
- */
- public boolean canCreatePath_Edge(Interaction container, Element source, Element target) {
- return canExistPath_Edge(
- container, null, source, target);
- }
-
- /**
- * @generated
- */
- public boolean canCreateComment_AnnotatedElementEdge(Comment source, Element target) {
- if (source != null) {
- if (source.getAnnotatedElements()
- .contains(target)) {
- return false;
- }
- }
-
- return canExistComment_AnnotatedElementEdge(
- source, target);
- }
-
- /**
- * @generated
- */
- public boolean canCreateConstraint_ConstrainedElementEdge(Constraint source, Element target) {
- if (source != null) {
- if (source.getConstrainedElements()
- .contains(target)) {
- return false;
- }
- }
-
- return canExistConstraint_ConstrainedElementEdge(
- source, target);
- }
-
- /**
- * @generated
- */
- public boolean canCreateDurationObservation_EventEdge(DurationObservation source, NamedElement target) {
- if (source != null) {
- if (source.getEvents()
- .size() >= 2
- ||
- source.getEvents()
- .contains(target)) {
- return false;
- }
- }
-
- return canExistDurationObservation_EventEdge(
- source, target);
- }
-
- /**
- * @generated
- */
- public boolean canCreateTimeObservation_EventEdge(TimeObservation source, NamedElement target) {
- if (source != null) {
- if (source.getEvent() != null) {
- return false;
- }
- }
-
- return canExistTimeObservation_EventEdge(
- source, target);
- }
-
- /**
- * @generated
- */
- public boolean canExistPath_Edge(Interaction container, Message linkInstance, Element source, Element target) {
- try {
- if (source == null) {
- return true;
- } else {
- Map<String, EClassifier> env = Collections.<String, EClassifier> singletonMap("oppositeEnd", UMLPackage.eINSTANCE.getElement()); //$NON-NLS-1$
- Object sourceVal = UMLOCLFactory.getExpression(3, UMLPackage.eINSTANCE.getElement(), env).evaluate(source, Collections.singletonMap("oppositeEnd", target)); //$NON-NLS-1$
- if (false == sourceVal instanceof Boolean || !((Boolean) sourceVal).booleanValue()) {
- return false;
- } // else fall-through
- }
- if (target == null) {
- return true;
- } else {
- Map<String, EClassifier> env = Collections.<String, EClassifier> singletonMap("oppositeEnd", UMLPackage.eINSTANCE.getElement()); //$NON-NLS-1$
- Object targetVal = UMLOCLFactory.getExpression(3, UMLPackage.eINSTANCE.getElement(), env).evaluate(target, Collections.singletonMap("oppositeEnd", source)); //$NON-NLS-1$
- if (false == targetVal instanceof Boolean || !((Boolean) targetVal).booleanValue()) {
- return false;
- } // else fall-through
- }
- return true;
- } catch (Exception e) {
- UMLDiagramEditorPlugin.getInstance().logError("Link constraint evaluation error", e); //$NON-NLS-1$
- return false;
- }
- }
-
- /**
- * @generated
- */
- public boolean canExistComment_AnnotatedElementEdge(Comment source, Element target) {
- return true;
- }
-
- /**
- * @generated
- */
- public boolean canExistConstraint_ConstrainedElementEdge(Constraint source, Element target) {
- return true;
- }
-
- /**
- * @generated
- */
- public boolean canExistDurationObservation_EventEdge(DurationObservation source, NamedElement target) {
- return true;
- }
-
- /**
- * @generated
- */
- public boolean canExistTimeObservation_EventEdge(TimeObservation source, NamedElement target) {
- return true;
- }
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.edit.policies; + +import java.util.Collections; +import java.util.Iterator; +import java.util.Map; + +import org.eclipse.emf.ecore.EClassifier; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.gef.Request; +import org.eclipse.gef.commands.Command; +import org.eclipse.gef.commands.UnexecutableCommand; +import org.eclipse.gef.requests.ReconnectRequest; +import org.eclipse.gmf.runtime.common.core.command.ICommand; +import org.eclipse.gmf.runtime.common.core.command.ICompositeCommand; +import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand; +import org.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy; +import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; +import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.SemanticEditPolicy; +import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.gmf.runtime.emf.type.core.commands.MoveElementsCommand; +import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest; +import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest; +import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest; +import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest; +import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest; +import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyRequest; +import org.eclipse.gmf.runtime.emf.type.core.requests.DuplicateElementsRequest; +import org.eclipse.gmf.runtime.emf.type.core.requests.GetEditContextRequest; +import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; +import org.eclipse.gmf.runtime.emf.type.core.requests.MoveRequest; +import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest; +import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest; +import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.edit.helpers.GeneratedEditHelperBase; +import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils; +import org.eclipse.papyrus.infra.services.edit.service.IElementEditService; +import org.eclipse.papyrus.uml.diagram.communication.expressions.UMLOCLFactory; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditorPlugin; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry; +import org.eclipse.papyrus.uml.diagram.communication.providers.UMLElementTypes; +import org.eclipse.uml2.uml.Comment; +import org.eclipse.uml2.uml.Constraint; +import org.eclipse.uml2.uml.DurationObservation; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.Interaction; +import org.eclipse.uml2.uml.Message; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.TimeObservation; +import org.eclipse.uml2.uml.UMLPackage; + +/** + * @generated + */ +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$ + /** + * @generated + */ + private final IElementType myElementType; + + /** + * @generated + */ + protected UMLBaseItemSemanticEditPolicy(IElementType elementType) { + myElementType = elementType; + } + + /** + * Extended request data key to hold editpart visual id. + * Add visual id of edited editpart to extended data of the request + * so command switch can decide what kind of diagram element is being edited. + * It is done in those cases when it's not possible to deduce diagram + * element kind from domain element. + * 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 + * + * @generated + */ + @SuppressWarnings("unchecked") + public Command getCommand(Request request) { + if (request instanceof ReconnectRequest) { + Object view = ((ReconnectRequest) request).getConnectionEditPart().getModel(); + if (view instanceof View) { + String id = UMLVisualIDRegistry.getVisualID((View) view); + request.getExtendedData().put(VISUAL_ID_KEY, id); + request.getExtendedData().put(GRAPHICAL_RECONNECTED_EDGE, view); + } + } + return super.getCommand(request); + } + + /** + * Returns visual id from request parameters. + * @generated + */ + protected String getVisualID(IEditCommandRequest request) { + return (String) request.getParameter(VISUAL_ID_KEY); + } + + /** + * @generated + */ + protected Command getSemanticCommand(IEditCommandRequest request) { + IEditCommandRequest completedRequest = completeRequest(request); + Command semanticCommand = getSemanticCommandSwitch(completedRequest); + semanticCommand = getEditHelperCommand(completedRequest, semanticCommand); + if (completedRequest instanceof DestroyRequest) { + DestroyRequest destroyRequest = (DestroyRequest) completedRequest; + return shouldProceed(destroyRequest) ? addDeleteViewCommand(semanticCommand, destroyRequest) : null; + } + return semanticCommand; + } + + /** + * @generated + */ + protected Command addDeleteViewCommand(Command mainCommand, DestroyRequest completedRequest) { + Command deleteViewCommand = getGEFWrapper(new DeleteCommand(getEditingDomain(), (View) getHost().getModel())); + return mainCommand == null ? deleteViewCommand : mainCommand.chain(deleteViewCommand); + } + + /** + * @generated + */ + private Command getEditHelperCommand(IEditCommandRequest request, Command editPolicyCommand) { + if (editPolicyCommand != null) { + ICommand command = editPolicyCommand instanceof ICommandProxy ? ((ICommandProxy) editPolicyCommand).getICommand() : new CommandProxy(editPolicyCommand); + request.setParameter(GeneratedEditHelperBase.EDIT_POLICY_COMMAND, command); + } + IElementType requestContextElementType = getContextElementType(request); + request.setParameter(GeneratedEditHelperBase.CONTEXT_ELEMENT_TYPE, requestContextElementType); + 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)) { + command = new CompositeTransactionalCommand(getEditingDomain(), command.getLabel()).compose(command); + } + return new ICommandProxy(command); + } + return editPolicyCommand; + } + + /** + * @generated + */ + protected IElementType getContextElementType(IEditCommandRequest request) { + IElementType requestContextElementType = UMLElementTypes.getElementType(getVisualID(request)); + return requestContextElementType != null ? requestContextElementType : myElementType; + } + + /** + * @generated + */ + protected Command getSemanticCommandSwitch(IEditCommandRequest req) { + if (req instanceof CreateRelationshipRequest) { + return getCreateRelationshipCommand((CreateRelationshipRequest) req); + } else if (req instanceof CreateElementRequest) { + return getCreateCommand((CreateElementRequest) req); + } else if (req instanceof ConfigureRequest) { + return getConfigureCommand((ConfigureRequest) req); + } else if (req instanceof DestroyElementRequest) { + return getDestroyElementCommand((DestroyElementRequest) req); + } else if (req instanceof DestroyReferenceRequest) { + return getDestroyReferenceCommand((DestroyReferenceRequest) req); + } else if (req instanceof DuplicateElementsRequest) { + return getDuplicateCommand((DuplicateElementsRequest) req); + } else if (req instanceof GetEditContextRequest) { + return getEditContextCommand((GetEditContextRequest) req); + } else if (req instanceof MoveRequest) { + return getMoveCommand((MoveRequest) req); + } else if (req instanceof ReorientReferenceRelationshipRequest) { + return getReorientReferenceRelationshipCommand((ReorientReferenceRelationshipRequest) req); + } else if (req instanceof ReorientRelationshipRequest) { + return getReorientRelationshipCommand((ReorientRelationshipRequest) req); + } else if (req instanceof SetRequest) { + return getSetCommand((SetRequest) req); + } + return null; + } + + /** + * @generated + */ + protected Command getConfigureCommand(ConfigureRequest req) { + return null; + } + + /** + * @generated + */ + protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) { + return null; + } + + /** + * @generated + */ + protected Command getCreateCommand(CreateElementRequest req) { + IElementType requestElementType = req.getElementType(); + if (requestElementType instanceof IElementType) { + IElementEditService commandProvider = ElementEditServiceUtils.getCommandProvider(req.getContainer()); + if (commandProvider != null) { + ICommand command = commandProvider.getEditCommand(req); + if (command != null && command.canExecute()) { + return new ICommandProxy(command); + } + } + } + return null; + } + + /** + * @generated + */ + protected Command getSetCommand(SetRequest req) { + return null; + } + + /** + * @generated + */ + protected Command getEditContextCommand(GetEditContextRequest req) { + return null; + } + + /** + * @generated + */ + protected Command getDestroyElementCommand(DestroyElementRequest req) { + return null; + } + + /** + * @generated + */ + protected Command getDestroyReferenceCommand(DestroyReferenceRequest req) { + return null; + } + + /** + * @generated + */ + protected Command getDuplicateCommand(DuplicateElementsRequest req) { + return null; + } + + /** + * @generated + */ + protected Command getMoveCommand(MoveRequest req) { + EObject targetCEObject = req.getTargetContainer(); + if (targetCEObject != null) { + IElementEditService provider = ElementEditServiceUtils.getCommandProvider(targetCEObject); + if (provider != null) { + ICommand moveCommand = provider.getEditCommand(req); + if (moveCommand != null) { + return new ICommandProxy(moveCommand); + } + } + return UnexecutableCommand.INSTANCE; + } else { + return getGEFWrapper(new MoveElementsCommand(req)); + } + + } + + /** + * @generated + */ + protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) { + return UnexecutableCommand.INSTANCE; + } + + /** + * @generated + */ + protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) { + return UnexecutableCommand.INSTANCE; + } + + /** + * @generated + */ + protected final Command getGEFWrapper(ICommand cmd) { + return (cmd == null) ? UnexecutableCommand.INSTANCE : new ICommandProxy(cmd); + } + + /** + * Returns editing domain from the host edit part. + * @generated + */ + protected TransactionalEditingDomain getEditingDomain() { + return ((IGraphicalEditPart) getHost()).getEditingDomain(); + } + + /** + * Clean all shortcuts to the host element from the same diagram + * @generated + */ + protected void addDestroyShortcutsCommand(ICompositeCommand cmd, View view) { + assert view.getEAnnotation("Shortcut") == null; //$NON-NLS-1$ + for (Iterator<?> it = view.getDiagram().getChildren().iterator(); it.hasNext();) { + View nextView = (View) it.next(); + if (nextView.getEAnnotation("Shortcut") == null || !nextView.isSetElement() || nextView.getElement() != view.getElement()) { //$NON-NLS-1$ + continue; + } + cmd.add(new DeleteCommand(getEditingDomain(), nextView)); + } + } + + /** + * @generated + */ + public static LinkConstraints getLinkConstraints() { + LinkConstraints cached = UMLDiagramEditorPlugin.getInstance().getLinkConstraints(); + if (cached == null) { + UMLDiagramEditorPlugin.getInstance().setLinkConstraints(cached = new LinkConstraints()); + } + return cached; + } + + /** + * @generated + */ + public static class LinkConstraints { + + /** + * @generated + */ + public LinkConstraints() { // use static method #getLinkConstraints() to access instance + } + + /** + * @generated + */ + public boolean canCreatePath_Edge(Interaction container, Element source, Element target) { + return canExistPath_Edge( + container, null, source, target); + } + + /** + * @generated + */ + public boolean canCreateComment_AnnotatedElementEdge(Comment source, Element target) { + if (source != null) { + if (source.getAnnotatedElements() + .contains(target)) { + return false; + } + } + + return canExistComment_AnnotatedElementEdge( + source, target); + } + + /** + * @generated + */ + public boolean canCreateConstraint_ConstrainedElementEdge(Constraint source, Element target) { + if (source != null) { + if (source.getConstrainedElements() + .contains(target)) { + return false; + } + } + + return canExistConstraint_ConstrainedElementEdge( + source, target); + } + + /** + * @generated + */ + public boolean canCreateDurationObservation_EventEdge(DurationObservation source, NamedElement target) { + if (source != null) { + if (source.getEvents() + .size() >= 2 + || + source.getEvents() + .contains(target)) { + return false; + } + } + + return canExistDurationObservation_EventEdge( + source, target); + } + + /** + * @generated + */ + public boolean canCreateTimeObservation_EventEdge(TimeObservation source, NamedElement target) { + if (source != null) { + if (source.getEvent() != null) { + return false; + } + } + + return canExistTimeObservation_EventEdge( + source, target); + } + + /** + * @generated + */ + public boolean canExistPath_Edge(Interaction container, Message linkInstance, Element source, Element target) { + try { + if (source == null) { + return true; + } else { + Map<String, EClassifier> env = Collections.<String, EClassifier> singletonMap("oppositeEnd", UMLPackage.eINSTANCE.getElement()); //$NON-NLS-1$ + Object sourceVal = UMLOCLFactory.getExpression(3, UMLPackage.eINSTANCE.getElement(), env).evaluate(source, Collections.singletonMap("oppositeEnd", target)); //$NON-NLS-1$ + if (false == sourceVal instanceof Boolean || !((Boolean) sourceVal).booleanValue()) { + return false; + } // else fall-through + } + if (target == null) { + return true; + } else { + Map<String, EClassifier> env = Collections.<String, EClassifier> singletonMap("oppositeEnd", UMLPackage.eINSTANCE.getElement()); //$NON-NLS-1$ + Object targetVal = UMLOCLFactory.getExpression(3, UMLPackage.eINSTANCE.getElement(), env).evaluate(target, Collections.singletonMap("oppositeEnd", source)); //$NON-NLS-1$ + if (false == targetVal instanceof Boolean || !((Boolean) targetVal).booleanValue()) { + return false; + } // else fall-through + } + return true; + } catch (Exception e) { + UMLDiagramEditorPlugin.getInstance().logError("Link constraint evaluation error", e); //$NON-NLS-1$ + return false; + } + } + + /** + * @generated + */ + public boolean canExistComment_AnnotatedElementEdge(Comment source, Element target) { + return true; + } + + /** + * @generated + */ + public boolean canExistConstraint_ConstrainedElementEdge(Constraint source, Element target) { + return true; + } + + /** + * @generated + */ + public boolean canExistDurationObservation_EventEdge(DurationObservation source, NamedElement target) { + return true; + } + + /** + * @generated + */ + public boolean canExistTimeObservation_EventEdge(TimeObservation source, NamedElement target) { + return true; + } + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/policies/UMLTextNonResizableEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/policies/UMLTextNonResizableEditPolicy.java index dd63c0b027f..59510a57c64 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/policies/UMLTextNonResizableEditPolicy.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/policies/UMLTextNonResizableEditPolicy.java @@ -1,238 +1,238 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.edit.policies;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.FigureListener;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.handles.MoveHandle;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableEditPolicyEx;
-import org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.edit.policies.labels.IRefreshableFeedbackEditPolicy;
-
-/**
- * @generated
- */
-public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx implements IRefreshableFeedbackEditPolicy {
-
- /**
- * @generated
- */
- private IFigure selectionFeedbackFigure;
-
- /**
- * @generated
- */
- private IFigure focusFeedbackFigure;
-
- /**
- * @generated
- */
- private FigureListener hostPositionListener;
-
- /**
- * @generated
- */
- protected void showPrimarySelection() {
- if (getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getHostFigure()).setSelected(true);
- ((WrappingLabel) getHostFigure()).setFocus(true);
- } else {
- showSelection();
- showFocus();
- }
- }
-
- /**
- * @generated
- */
- protected void showSelection() {
- if (getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getHostFigure()).setSelected(true);
- ((WrappingLabel) getHostFigure()).setFocus(false);
- } else {
- hideSelection();
- addFeedback(selectionFeedbackFigure = createSelectionFeedbackFigure());
- getHostFigure().addFigureListener(getHostPositionListener());
- refreshSelectionFeedback();
- hideFocus();
- }
- }
-
- /**
- * @generated
- */
- protected void hideSelection() {
- if (getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getHostFigure()).setSelected(false);
- ((WrappingLabel) getHostFigure()).setFocus(false);
- } else {
- if (selectionFeedbackFigure != null) {
- removeFeedback(selectionFeedbackFigure);
- getHostFigure().removeFigureListener(getHostPositionListener());
- selectionFeedbackFigure = null;
- }
- hideFocus();
- }
- }
-
- /**
- * @generated
- */
- protected void showFocus() {
- if (getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getHostFigure()).setFocus(true);
- } else {
- hideFocus();
- addFeedback(focusFeedbackFigure = createFocusFeedbackFigure());
- refreshFocusFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void hideFocus() {
- if (getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getHostFigure()).setFocus(false);
- } else {
- if (focusFeedbackFigure != null) {
- removeFeedback(focusFeedbackFigure);
- focusFeedbackFigure = null;
- }
- }
- }
-
- /**
- * @generated
- */
- protected Rectangle getFeedbackBounds() {
- Rectangle bounds;
- if (getHostFigure() instanceof Label) {
- bounds = ((Label) getHostFigure()).getTextBounds();
- bounds.intersect(getHostFigure().getBounds());
- } else {
- bounds = getHostFigure().getBounds().getCopy();
- }
- getHostFigure().getParent().translateToAbsolute(bounds);
- getFeedbackLayer().translateToRelative(bounds);
- return bounds;
- }
-
- /**
- * @generated
- */
- protected IFigure createSelectionFeedbackFigure() {
- if (getHostFigure() instanceof Label) {
- Label feedbackFigure = new Label();
- feedbackFigure.setOpaque(true);
- feedbackFigure.setBackgroundColor(ColorConstants.menuBackgroundSelected);
- feedbackFigure.setForegroundColor(ColorConstants.menuForegroundSelected);
- return feedbackFigure;
- } else {
- RectangleFigure feedbackFigure = new RectangleFigure();
- feedbackFigure.setFill(false);
- return feedbackFigure;
- }
- }
-
- /**
- * @generated
- */
- protected IFigure createFocusFeedbackFigure() {
- return new Figure() {
-
- @Override
- protected void paintFigure(Graphics graphics) {
- graphics.drawFocus(getBounds().getResized(-1, -1));
- }
- };
- }
-
- /**
- * @generated
- */
- protected void updateLabel(Label target) {
- Label source = (Label) getHostFigure();
- target.setText(source.getText());
- target.setTextAlignment(source.getTextAlignment());
- target.setFont(source.getFont());
- }
-
- /**
- * @generated
- */
- protected void refreshSelectionFeedback() {
- if (selectionFeedbackFigure != null) {
- if (selectionFeedbackFigure instanceof Label) {
- updateLabel((Label) selectionFeedbackFigure);
- selectionFeedbackFigure.setBounds(getFeedbackBounds());
- } else {
- selectionFeedbackFigure.setBounds(getFeedbackBounds().expand(5, 5));
- }
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFocusFeedback() {
- if (focusFeedbackFigure != null) {
- focusFeedbackFigure.setBounds(getFeedbackBounds());
- }
- }
-
- /**
- * @generated
- */
- @Override
- public void refreshFeedback() {
- refreshSelectionFeedback();
- refreshFocusFeedback();
- }
-
- /**
- * @generated
- */
- private FigureListener getHostPositionListener() {
- if (hostPositionListener == null) {
- hostPositionListener = new FigureListener() {
- @Override
- public void figureMoved(IFigure source) {
- refreshFeedback();
- }
- };
- }
- return hostPositionListener;
- }
-
- /**
- * @generated
- */
- protected List<?> createSelectionHandles() {
- MoveHandle moveHandle = new MoveHandle((GraphicalEditPart) getHost());
- moveHandle.setBorder(null);
- moveHandle.setDragTracker(new DragEditPartsTrackerEx(getHost()));
- return Collections.singletonList(moveHandle);
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.edit.policies; + +import java.util.Collections; +import java.util.List; + +import org.eclipse.draw2d.ColorConstants; +import org.eclipse.draw2d.Figure; +import org.eclipse.draw2d.FigureListener; +import org.eclipse.draw2d.Graphics; +import org.eclipse.draw2d.IFigure; +import org.eclipse.draw2d.Label; +import org.eclipse.draw2d.RectangleFigure; +import org.eclipse.draw2d.geometry.Rectangle; +import org.eclipse.gef.GraphicalEditPart; +import org.eclipse.gef.handles.MoveHandle; +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableEditPolicyEx; +import org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx; +import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; +import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.edit.policies.labels.IRefreshableFeedbackEditPolicy; + +/** + * @generated + */ +public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx implements IRefreshableFeedbackEditPolicy { + + /** + * @generated + */ + private IFigure selectionFeedbackFigure; + + /** + * @generated + */ + private IFigure focusFeedbackFigure; + + /** + * @generated + */ + private FigureListener hostPositionListener; + + /** + * @generated + */ + protected void showPrimarySelection() { + if (getHostFigure() instanceof WrappingLabel) { + ((WrappingLabel) getHostFigure()).setSelected(true); + ((WrappingLabel) getHostFigure()).setFocus(true); + } else { + showSelection(); + showFocus(); + } + } + + /** + * @generated + */ + protected void showSelection() { + if (getHostFigure() instanceof WrappingLabel) { + ((WrappingLabel) getHostFigure()).setSelected(true); + ((WrappingLabel) getHostFigure()).setFocus(false); + } else { + hideSelection(); + addFeedback(selectionFeedbackFigure = createSelectionFeedbackFigure()); + getHostFigure().addFigureListener(getHostPositionListener()); + refreshSelectionFeedback(); + hideFocus(); + } + } + + /** + * @generated + */ + protected void hideSelection() { + if (getHostFigure() instanceof WrappingLabel) { + ((WrappingLabel) getHostFigure()).setSelected(false); + ((WrappingLabel) getHostFigure()).setFocus(false); + } else { + if (selectionFeedbackFigure != null) { + removeFeedback(selectionFeedbackFigure); + getHostFigure().removeFigureListener(getHostPositionListener()); + selectionFeedbackFigure = null; + } + hideFocus(); + } + } + + /** + * @generated + */ + protected void showFocus() { + if (getHostFigure() instanceof WrappingLabel) { + ((WrappingLabel) getHostFigure()).setFocus(true); + } else { + hideFocus(); + addFeedback(focusFeedbackFigure = createFocusFeedbackFigure()); + refreshFocusFeedback(); + } + } + + /** + * @generated + */ + protected void hideFocus() { + if (getHostFigure() instanceof WrappingLabel) { + ((WrappingLabel) getHostFigure()).setFocus(false); + } else { + if (focusFeedbackFigure != null) { + removeFeedback(focusFeedbackFigure); + focusFeedbackFigure = null; + } + } + } + + /** + * @generated + */ + protected Rectangle getFeedbackBounds() { + Rectangle bounds; + if (getHostFigure() instanceof Label) { + bounds = ((Label) getHostFigure()).getTextBounds(); + bounds.intersect(getHostFigure().getBounds()); + } else { + bounds = getHostFigure().getBounds().getCopy(); + } + getHostFigure().getParent().translateToAbsolute(bounds); + getFeedbackLayer().translateToRelative(bounds); + return bounds; + } + + /** + * @generated + */ + protected IFigure createSelectionFeedbackFigure() { + if (getHostFigure() instanceof Label) { + Label feedbackFigure = new Label(); + feedbackFigure.setOpaque(true); + feedbackFigure.setBackgroundColor(ColorConstants.menuBackgroundSelected); + feedbackFigure.setForegroundColor(ColorConstants.menuForegroundSelected); + return feedbackFigure; + } else { + RectangleFigure feedbackFigure = new RectangleFigure(); + feedbackFigure.setFill(false); + return feedbackFigure; + } + } + + /** + * @generated + */ + protected IFigure createFocusFeedbackFigure() { + return new Figure() { + + @Override + protected void paintFigure(Graphics graphics) { + graphics.drawFocus(getBounds().getResized(-1, -1)); + } + }; + } + + /** + * @generated + */ + protected void updateLabel(Label target) { + Label source = (Label) getHostFigure(); + target.setText(source.getText()); + target.setTextAlignment(source.getTextAlignment()); + target.setFont(source.getFont()); + } + + /** + * @generated + */ + protected void refreshSelectionFeedback() { + if (selectionFeedbackFigure != null) { + if (selectionFeedbackFigure instanceof Label) { + updateLabel((Label) selectionFeedbackFigure); + selectionFeedbackFigure.setBounds(getFeedbackBounds()); + } else { + selectionFeedbackFigure.setBounds(getFeedbackBounds().expand(5, 5)); + } + } + } + + /** + * @generated + */ + protected void refreshFocusFeedback() { + if (focusFeedbackFigure != null) { + focusFeedbackFigure.setBounds(getFeedbackBounds()); + } + } + + /** + * @generated + */ + @Override + public void refreshFeedback() { + refreshSelectionFeedback(); + refreshFocusFeedback(); + } + + /** + * @generated + */ + private FigureListener getHostPositionListener() { + if (hostPositionListener == null) { + hostPositionListener = new FigureListener() { + @Override + public void figureMoved(IFigure source) { + refreshFeedback(); + } + }; + } + return hostPositionListener; + } + + /** + * @generated + */ + protected List<?> createSelectionHandles() { + MoveHandle moveHandle = new MoveHandle((GraphicalEditPart) getHost()); + moveHandle.setBorder(null); + moveHandle.setDragTracker(new DragEditPartsTrackerEx(getHost())); + return Collections.singletonList(moveHandle); + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/policies/UMLTextSelectionEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/policies/UMLTextSelectionEditPolicy.java index ec42c4db5f5..fb830e9f894 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/policies/UMLTextSelectionEditPolicy.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/edit/policies/UMLTextSelectionEditPolicy.java @@ -1,222 +1,222 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.edit.policies;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.FigureListener;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.editpolicies.SelectionEditPolicy;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.edit.policies.labels.IRefreshableFeedbackEditPolicy;
-
-/**
- * @generated
- */
-public class UMLTextSelectionEditPolicy extends SelectionEditPolicy implements IRefreshableFeedbackEditPolicy {
-
- /**
- * @generated
- */
- private IFigure selectionFeedbackFigure;
-
- /**
- * @generated
- */
- private IFigure focusFeedbackFigure;
-
- /**
- * @generated
- */
- private FigureListener hostPositionListener;
-
- /**
- * @generated
- */
- protected void showPrimarySelection() {
- if (getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getHostFigure()).setSelected(true);
- ((WrappingLabel) getHostFigure()).setFocus(true);
- } else {
- showSelection();
- showFocus();
- }
- }
-
- /**
- * @generated
- */
- protected void showSelection() {
- if (getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getHostFigure()).setSelected(true);
- ((WrappingLabel) getHostFigure()).setFocus(false);
- } else {
- hideSelection();
- addFeedback(selectionFeedbackFigure = createSelectionFeedbackFigure());
- getHostFigure().addFigureListener(getHostPositionListener());
- refreshSelectionFeedback();
- hideFocus();
- }
- }
-
- /**
- * @generated
- */
- protected void hideSelection() {
- if (getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getHostFigure()).setSelected(false);
- ((WrappingLabel) getHostFigure()).setFocus(false);
- } else {
- if (selectionFeedbackFigure != null) {
- removeFeedback(selectionFeedbackFigure);
- getHostFigure().removeFigureListener(getHostPositionListener());
- selectionFeedbackFigure = null;
- }
- hideFocus();
- }
- }
-
- /**
- * @generated
- */
- protected void showFocus() {
- if (getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getHostFigure()).setFocus(true);
- } else {
- hideFocus();
- addFeedback(focusFeedbackFigure = createFocusFeedbackFigure());
- refreshFocusFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void hideFocus() {
- if (getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getHostFigure()).setFocus(false);
- } else {
- if (focusFeedbackFigure != null) {
- removeFeedback(focusFeedbackFigure);
- focusFeedbackFigure = null;
- }
- }
- }
-
- /**
- * @generated
- */
- protected Rectangle getFeedbackBounds() {
- Rectangle bounds;
- if (getHostFigure() instanceof Label) {
- bounds = ((Label) getHostFigure()).getTextBounds();
- bounds.intersect(getHostFigure().getBounds());
- } else {
- bounds = getHostFigure().getBounds().getCopy();
- }
- getHostFigure().getParent().translateToAbsolute(bounds);
- getFeedbackLayer().translateToRelative(bounds);
- return bounds;
- }
-
- /**
- * @generated
- */
- protected IFigure createSelectionFeedbackFigure() {
- if (getHostFigure() instanceof Label) {
- Label feedbackFigure = new Label();
- feedbackFigure.setOpaque(true);
- feedbackFigure.setBackgroundColor(ColorConstants.menuBackgroundSelected);
- feedbackFigure.setForegroundColor(ColorConstants.menuForegroundSelected);
- return feedbackFigure;
- } else {
- RectangleFigure feedbackFigure = new RectangleFigure();
- feedbackFigure.setFill(false);
- return feedbackFigure;
- }
- }
-
- /**
- * @generated
- */
- protected IFigure createFocusFeedbackFigure() {
- return new Figure() {
-
- @Override
- protected void paintFigure(Graphics graphics) {
- graphics.drawFocus(getBounds().getResized(-1, -1));
- }
- };
- }
-
- /**
- * @generated
- */
- protected void updateLabel(Label target) {
- Label source = (Label) getHostFigure();
- target.setText(source.getText());
- target.setTextAlignment(source.getTextAlignment());
- target.setFont(source.getFont());
- }
-
- /**
- * @generated
- */
- protected void refreshSelectionFeedback() {
- if (selectionFeedbackFigure != null) {
- if (selectionFeedbackFigure instanceof Label) {
- updateLabel((Label) selectionFeedbackFigure);
- selectionFeedbackFigure.setBounds(getFeedbackBounds());
- } else {
- selectionFeedbackFigure.setBounds(getFeedbackBounds().expand(5, 5));
- }
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFocusFeedback() {
- if (focusFeedbackFigure != null) {
- focusFeedbackFigure.setBounds(getFeedbackBounds());
- }
- }
-
- /**
- * @generated
- */
- @Override
- public void refreshFeedback() {
- refreshSelectionFeedback();
- refreshFocusFeedback();
- }
-
- /**
- * @generated
- */
- private FigureListener getHostPositionListener() {
- if (hostPositionListener == null) {
- hostPositionListener = new FigureListener() {
- @Override
- public void figureMoved(IFigure source) {
- refreshFeedback();
- }
- };
- }
- return hostPositionListener;
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.edit.policies; + +import org.eclipse.draw2d.ColorConstants; +import org.eclipse.draw2d.Figure; +import org.eclipse.draw2d.FigureListener; +import org.eclipse.draw2d.Graphics; +import org.eclipse.draw2d.IFigure; +import org.eclipse.draw2d.Label; +import org.eclipse.draw2d.RectangleFigure; +import org.eclipse.draw2d.geometry.Rectangle; +import org.eclipse.gef.editpolicies.SelectionEditPolicy; +import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; +import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.edit.policies.labels.IRefreshableFeedbackEditPolicy; + +/** + * @generated + */ +public class UMLTextSelectionEditPolicy extends SelectionEditPolicy implements IRefreshableFeedbackEditPolicy { + + /** + * @generated + */ + private IFigure selectionFeedbackFigure; + + /** + * @generated + */ + private IFigure focusFeedbackFigure; + + /** + * @generated + */ + private FigureListener hostPositionListener; + + /** + * @generated + */ + protected void showPrimarySelection() { + if (getHostFigure() instanceof WrappingLabel) { + ((WrappingLabel) getHostFigure()).setSelected(true); + ((WrappingLabel) getHostFigure()).setFocus(true); + } else { + showSelection(); + showFocus(); + } + } + + /** + * @generated + */ + protected void showSelection() { + if (getHostFigure() instanceof WrappingLabel) { + ((WrappingLabel) getHostFigure()).setSelected(true); + ((WrappingLabel) getHostFigure()).setFocus(false); + } else { + hideSelection(); + addFeedback(selectionFeedbackFigure = createSelectionFeedbackFigure()); + getHostFigure().addFigureListener(getHostPositionListener()); + refreshSelectionFeedback(); + hideFocus(); + } + } + + /** + * @generated + */ + protected void hideSelection() { + if (getHostFigure() instanceof WrappingLabel) { + ((WrappingLabel) getHostFigure()).setSelected(false); + ((WrappingLabel) getHostFigure()).setFocus(false); + } else { + if (selectionFeedbackFigure != null) { + removeFeedback(selectionFeedbackFigure); + getHostFigure().removeFigureListener(getHostPositionListener()); + selectionFeedbackFigure = null; + } + hideFocus(); + } + } + + /** + * @generated + */ + protected void showFocus() { + if (getHostFigure() instanceof WrappingLabel) { + ((WrappingLabel) getHostFigure()).setFocus(true); + } else { + hideFocus(); + addFeedback(focusFeedbackFigure = createFocusFeedbackFigure()); + refreshFocusFeedback(); + } + } + + /** + * @generated + */ + protected void hideFocus() { + if (getHostFigure() instanceof WrappingLabel) { + ((WrappingLabel) getHostFigure()).setFocus(false); + } else { + if (focusFeedbackFigure != null) { + removeFeedback(focusFeedbackFigure); + focusFeedbackFigure = null; + } + } + } + + /** + * @generated + */ + protected Rectangle getFeedbackBounds() { + Rectangle bounds; + if (getHostFigure() instanceof Label) { + bounds = ((Label) getHostFigure()).getTextBounds(); + bounds.intersect(getHostFigure().getBounds()); + } else { + bounds = getHostFigure().getBounds().getCopy(); + } + getHostFigure().getParent().translateToAbsolute(bounds); + getFeedbackLayer().translateToRelative(bounds); + return bounds; + } + + /** + * @generated + */ + protected IFigure createSelectionFeedbackFigure() { + if (getHostFigure() instanceof Label) { + Label feedbackFigure = new Label(); + feedbackFigure.setOpaque(true); + feedbackFigure.setBackgroundColor(ColorConstants.menuBackgroundSelected); + feedbackFigure.setForegroundColor(ColorConstants.menuForegroundSelected); + return feedbackFigure; + } else { + RectangleFigure feedbackFigure = new RectangleFigure(); + feedbackFigure.setFill(false); + return feedbackFigure; + } + } + + /** + * @generated + */ + protected IFigure createFocusFeedbackFigure() { + return new Figure() { + + @Override + protected void paintFigure(Graphics graphics) { + graphics.drawFocus(getBounds().getResized(-1, -1)); + } + }; + } + + /** + * @generated + */ + protected void updateLabel(Label target) { + Label source = (Label) getHostFigure(); + target.setText(source.getText()); + target.setTextAlignment(source.getTextAlignment()); + target.setFont(source.getFont()); + } + + /** + * @generated + */ + protected void refreshSelectionFeedback() { + if (selectionFeedbackFigure != null) { + if (selectionFeedbackFigure instanceof Label) { + updateLabel((Label) selectionFeedbackFigure); + selectionFeedbackFigure.setBounds(getFeedbackBounds()); + } else { + selectionFeedbackFigure.setBounds(getFeedbackBounds().expand(5, 5)); + } + } + } + + /** + * @generated + */ + protected void refreshFocusFeedback() { + if (focusFeedbackFigure != null) { + focusFeedbackFigure.setBounds(getFeedbackBounds()); + } + } + + /** + * @generated + */ + @Override + public void refreshFeedback() { + refreshSelectionFeedback(); + refreshFocusFeedback(); + } + + /** + * @generated + */ + private FigureListener getHostPositionListener() { + if (hostPositionListener == null) { + hostPositionListener = new FigureListener() { + @Override + public void figureMoved(IFigure source) { + refreshFeedback(); + } + }; + } + return hostPositionListener; + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/expressions/UMLAbstractExpression.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/expressions/UMLAbstractExpression.java index fc138e8747e..80bf0684538 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/expressions/UMLAbstractExpression.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/expressions/UMLAbstractExpression.java @@ -1,169 +1,169 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.expressions;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.util.Collections;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EEnumLiteral;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditorPlugin;
-
-/**
- * @generated
- */
-public abstract class UMLAbstractExpression {
-
- /**
- * @generated
- */
- private IStatus status = Status.OK_STATUS;
-
- /**
- * @generated
- */
- protected void setStatus(int severity, String message, Throwable throwable) {
- String pluginID = UMLDiagramEditorPlugin.ID;
- this.status = new Status(severity, pluginID, -1, (message != null) ? message : "", throwable); //$NON-NLS-1$
- if (!this.status.isOK()) {
- UMLDiagramEditorPlugin.getInstance().logError("Expression problem:" + message + "body:" + body(), throwable); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- /**
- * @generated
- */
- public IStatus getStatus() {
- return status;
- }
-
- /**
- * @generated
- */
- private final String myBody;
-
- /**
- * @generated
- */
- public String body() {
- return myBody;
- }
-
- /**
- * @generated
- */
- private final EClassifier myContext;
-
- /**
- * @generated
- */
- public EClassifier context() {
- return myContext;
- }
-
- /**
- * @generated
- */
- protected UMLAbstractExpression(String body, EClassifier context) {
- myBody = body;
- myContext = context;
- }
-
- /**
- * @generated
- */
- @SuppressWarnings("rawtypes")
- protected abstract Object doEvaluate(Object context, Map env);
-
- /**
- * @generated
- */
- public Object evaluate(Object context) {
- return evaluate(context, Collections.EMPTY_MAP);
- }
-
- /**
- * @generated
- */
- @SuppressWarnings("rawtypes")
- public Object evaluate(Object context, Map env) {
- if (context().isInstance(context)) {
- try {
- return doEvaluate(context, env);
- } catch (Exception e) {
- UMLDiagramEditorPlugin.getInstance().logError("Expression evaluation failure: " + body(), e); //$NON-NLS-1$
- }
- }
- return null;
- }
-
- /**
- * Expression may return number value which is not directly compatible with feature type (e.g. Double when Integer is expected), or EEnumLiteral meta-object when literal instance is expected
- * @generated
- */
- public static Object performCast(Object value, EDataType targetType) {
- if (targetType instanceof EEnum) {
- if (value instanceof EEnumLiteral) {
- EEnumLiteral literal = (EEnumLiteral) value;
- return (literal.getInstance() != null) ? literal.getInstance() : literal;
- }
- }
- if (false == value instanceof Number || targetType == null || targetType.getInstanceClass() == null) {
- return value;
- }
- Class<?> targetClass = targetType.getInstanceClass();
- Number num = (Number) value;
- Class<?> valClass = value.getClass();
- Class<?> targetWrapperClass = targetClass;
- if (targetClass.isPrimitive()) {
- targetWrapperClass = EcoreUtil.wrapperClassFor(targetClass);
- }
- if (valClass.equals(targetWrapperClass)) {
- return value;
- }
- if (Number.class.isAssignableFrom(targetWrapperClass)) {
- if (targetWrapperClass.equals(Byte.class)) {
- return new Byte(num.byteValue());
- }
- if (targetWrapperClass.equals(Integer.class)) {
- return new Integer(num.intValue());
- }
- if (targetWrapperClass.equals(Short.class)) {
- return new Short(num.shortValue());
- }
- if (targetWrapperClass.equals(Long.class)) {
- return new Long(num.longValue());
- }
- if (targetWrapperClass.equals(BigInteger.class)) {
- return BigInteger.valueOf(num.longValue());
- }
- if (targetWrapperClass.equals(Float.class)) {
- return new Float(num.floatValue());
- }
- if (targetWrapperClass.equals(Double.class)) {
- return new Double(num.doubleValue());
- }
- if (targetWrapperClass.equals(BigDecimal.class)) {
- return new BigDecimal(num.doubleValue());
- }
- }
- return value;
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.expressions; + +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Collections; +import java.util.Map; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.emf.ecore.EClassifier; +import org.eclipse.emf.ecore.EDataType; +import org.eclipse.emf.ecore.EEnum; +import org.eclipse.emf.ecore.EEnumLiteral; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditorPlugin; + +/** + * @generated + */ +public abstract class UMLAbstractExpression { + + /** + * @generated + */ + private IStatus status = Status.OK_STATUS; + + /** + * @generated + */ + protected void setStatus(int severity, String message, Throwable throwable) { + String pluginID = UMLDiagramEditorPlugin.ID; + this.status = new Status(severity, pluginID, -1, (message != null) ? message : "", throwable); //$NON-NLS-1$ + if (!this.status.isOK()) { + UMLDiagramEditorPlugin.getInstance().logError("Expression problem:" + message + "body:" + body(), throwable); //$NON-NLS-1$ //$NON-NLS-2$ + } + } + + /** + * @generated + */ + public IStatus getStatus() { + return status; + } + + /** + * @generated + */ + private final String myBody; + + /** + * @generated + */ + public String body() { + return myBody; + } + + /** + * @generated + */ + private final EClassifier myContext; + + /** + * @generated + */ + public EClassifier context() { + return myContext; + } + + /** + * @generated + */ + protected UMLAbstractExpression(String body, EClassifier context) { + myBody = body; + myContext = context; + } + + /** + * @generated + */ + @SuppressWarnings("rawtypes") + protected abstract Object doEvaluate(Object context, Map env); + + /** + * @generated + */ + public Object evaluate(Object context) { + return evaluate(context, Collections.EMPTY_MAP); + } + + /** + * @generated + */ + @SuppressWarnings("rawtypes") + public Object evaluate(Object context, Map env) { + if (context().isInstance(context)) { + try { + return doEvaluate(context, env); + } catch (Exception e) { + UMLDiagramEditorPlugin.getInstance().logError("Expression evaluation failure: " + body(), e); //$NON-NLS-1$ + } + } + return null; + } + + /** + * Expression may return number value which is not directly compatible with feature type (e.g. Double when Integer is expected), or EEnumLiteral meta-object when literal instance is expected + * @generated + */ + public static Object performCast(Object value, EDataType targetType) { + if (targetType instanceof EEnum) { + if (value instanceof EEnumLiteral) { + EEnumLiteral literal = (EEnumLiteral) value; + return (literal.getInstance() != null) ? literal.getInstance() : literal; + } + } + if (false == value instanceof Number || targetType == null || targetType.getInstanceClass() == null) { + return value; + } + Class<?> targetClass = targetType.getInstanceClass(); + Number num = (Number) value; + Class<?> valClass = value.getClass(); + Class<?> targetWrapperClass = targetClass; + if (targetClass.isPrimitive()) { + targetWrapperClass = EcoreUtil.wrapperClassFor(targetClass); + } + if (valClass.equals(targetWrapperClass)) { + return value; + } + if (Number.class.isAssignableFrom(targetWrapperClass)) { + if (targetWrapperClass.equals(Byte.class)) { + return new Byte(num.byteValue()); + } + if (targetWrapperClass.equals(Integer.class)) { + return new Integer(num.intValue()); + } + if (targetWrapperClass.equals(Short.class)) { + return new Short(num.shortValue()); + } + if (targetWrapperClass.equals(Long.class)) { + return new Long(num.longValue()); + } + if (targetWrapperClass.equals(BigInteger.class)) { + return BigInteger.valueOf(num.longValue()); + } + if (targetWrapperClass.equals(Float.class)) { + return new Float(num.floatValue()); + } + if (targetWrapperClass.equals(Double.class)) { + return new Double(num.doubleValue()); + } + if (targetWrapperClass.equals(BigDecimal.class)) { + return new BigDecimal(num.doubleValue()); + } + } + return value; + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/expressions/UMLOCLFactory.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/expressions/UMLOCLFactory.java index 972bb5f1d64..c544ba21c46 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/expressions/UMLOCLFactory.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/expressions/UMLOCLFactory.java @@ -1,190 +1,190 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.expressions;
-
-import java.util.Collections;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EParameter;
-import org.eclipse.emf.ecore.EcorePackage;
-import org.eclipse.ocl.Environment;
-import org.eclipse.ocl.EvaluationEnvironment;
-import org.eclipse.ocl.ParserException;
-import org.eclipse.ocl.ecore.EcoreFactory;
-import org.eclipse.ocl.ecore.OCLExpression;
-import org.eclipse.ocl.ecore.Variable;
-import org.eclipse.ocl.ecore.OCL.Helper;
-import org.eclipse.ocl.options.ParsingOptions;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditorPlugin;
-
-/**
- * @generated
- */
-public class UMLOCLFactory {
-
- /**
- * @generated
- */
- private final UMLAbstractExpression[] expressions;
-
- /**
- * @generated
- */
- private final String[] expressionBodies;
-
- /**
- * @generated
- */
- protected UMLOCLFactory() {
- this.expressions = new UMLAbstractExpression[8];
- this.expressionBodies = new String[] {
- "let base : String = \'Lifeline\' in\r\nlet suffixes : Sequence(String) = Sequence {\'\', \'1\', \'2\', \'3\', \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'10\'} in \r\nlet space : Namespace = self.namespace in\r\nlet allMissed : Sequence(String) = suffixes->\r\n select(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s))\r\n ) in\r\nlet firstMissed : String = allMissed->first() in \r\nlet noMisses : Boolean = firstMissed.oclIsUndefined() in\r\nlet allNames : Set(String) = \r\n if noMisses \r\n then \r\n space.member->collect(e : NamedElement | \r\n if e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base\r\n then \'\' \r\n else e.name \r\n endif)->asSet()->excluding(\'\') else Set{\'not in use\'} \r\n endif in \r\nlet longestName : String = \r\n if noMisses\r\n then allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first() \r\n else \'not in use\' \r\n endif in \r\nif noMisses then \r\n if longestName.oclIsUndefined() \r\n then base \r\n else longestName.concat(\'1\') \r\n endif \r\nelse \r\n base.concat(firstMissed) \r\nendif ", //$NON-NLS-1$
- "let base : String = \'Interaction\' in\r\nlet suffixes : Sequence(String) = Sequence {\'\', \'1\', \'2\', \'3\', \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'10\'} in \r\nlet space : Namespace = self.namespace in\r\nlet allMissed : Sequence(String) = suffixes->\r\n select(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s))\r\n ) in\r\nlet firstMissed : String = allMissed->first() in \r\nlet noMisses : Boolean = firstMissed.oclIsUndefined() in\r\nlet allNames : Set(String) = \r\n if noMisses \r\n then \r\n space.member->collect(e : NamedElement | \r\n if e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base\r\n then \'\' \r\n else e.name \r\n endif)->asSet()->excluding(\'\') else Set{\'not in use\'} \r\n endif in \r\nlet longestName : String = \r\n if noMisses\r\n then allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first() \r\n else \'not in use\' \r\n endif in \r\nif noMisses then \r\n if longestName.oclIsUndefined() \r\n then base \r\n else longestName.concat(\'1\') \r\n endif \r\nelse \r\n base.concat(firstMissed) \r\nendif ", //$NON-NLS-1$
- "self.messageSort=MessageSort::createMessage and self.sendEvent<>null and self.receiveEvent<>null", //$NON-NLS-1$
- "self.oclIsKindOf(uml::Lifeline)", //$NON-NLS-1$
- "self.oclIsKindOf(uml::InteractionFragment) or self.oclIsKindOf(uml::Lifeline)", //$NON-NLS-1$
- "self.sendEvent<>null and self.receiveEvent<>null", //$NON-NLS-1$
- "\'OpaqueExpression\'", //$NON-NLS-1$
- "\' \'", //$NON-NLS-1$
- };
- }
-
- /**
- * @generated
- */
- private static UMLOCLFactory getInstance() {
- UMLOCLFactory instance = UMLDiagramEditorPlugin.getInstance().getUMLOCLFactory();
- if (instance == null) {
- UMLDiagramEditorPlugin.getInstance().setUMLOCLFactory(instance = new UMLOCLFactory());
- }
- return instance;
- }
-
- /**
- * @generated
- */
- public static String getExpressionBody(int index) {
- return getInstance().expressionBodies[index];
- }
-
- /**
- * @generated
- */
- public static UMLAbstractExpression getExpression(int index, EClassifier context,
- Map<String, EClassifier> environment) {
- UMLOCLFactory cached = getInstance();
- if (index < 0 || index >= cached.expressions.length) {
- throw new IllegalArgumentException();
- }
- if (cached.expressions[index] == null) {
- cached.expressions[index] = getExpression(cached.expressionBodies[index], context, environment == null ? Collections.<String, EClassifier> emptyMap() : environment);
- }
- return cached.expressions[index];
- }
-
- /**
- * This is factory method, callers are responsible to keep reference to the return value if they want to reuse parsed expression
- * @generated
- */
- public static UMLAbstractExpression getExpression(String body, EClassifier context,
- Map<String, EClassifier> environment) {
- return new Expression(body, context, environment);
- }
-
- /**
- * This method will become private in the next release
- * @generated
- */
- public static UMLAbstractExpression getExpression(String body, EClassifier context) {
- return getExpression(body, context, Collections.<String, EClassifier> emptyMap());
- }
-
- /**
- * @generated
- */
- private static class Expression extends UMLAbstractExpression {
-
- /**
- * @generated
- */
- private final org.eclipse.ocl.ecore.OCL oclInstance;
-
- /**
- * @generated
- */
- private OCLExpression oclExpression;
-
- /**
- * @generated
- */
- public Expression(String body, EClassifier context, Map<String, EClassifier> environment) {
- super(body, context);
- oclInstance = org.eclipse.ocl.ecore.OCL.newInstance();
- initCustomEnv(oclInstance.getEnvironment(), environment);
- Helper oclHelper = oclInstance.createOCLHelper();
- oclHelper.setContext(context());
- try {
- oclExpression = oclHelper.createQuery(body());
- setStatus(IStatus.OK, null, null);
- } catch (ParserException e) {
- setStatus(IStatus.ERROR, e.getMessage(), e);
- }
- }
-
- /**
- * @generated
- */
- @SuppressWarnings("rawtypes")
- protected Object doEvaluate(Object context, Map env) {
- if (oclExpression == null) {
- return null;
- }
- // on the first call, both evalEnvironment and extentMap are clear, for later we have finally, below.
- EvaluationEnvironment<?, ?, ?, ?, ?> evalEnv = oclInstance.getEvaluationEnvironment();
- // initialize environment
- for (Object nextKey : env.keySet()) {
- evalEnv.replace((String) nextKey, env.get(nextKey));
- }
- try {
- Object result = oclInstance.evaluate(context, oclExpression);
- return oclInstance.isInvalid(result) ? null : result;
- } finally {
- evalEnv.clear();
- oclInstance.setExtentMap(null); // clear allInstances cache, and get the oclInstance ready for the next call
- }
- }
-
- /**
- * @generated
- */
- private static void initCustomEnv(Environment<?, EClassifier, ?, ?, ?, EParameter, ?, ?, ?, ?, ?, ?> ecoreEnv, Map<String, EClassifier> environment) {
- // Use EObject as implicit root class for any object, to allow eContainer() and other EObject operations from OCL expressions
- ParsingOptions.setOption(ecoreEnv, ParsingOptions.implicitRootClass(ecoreEnv), EcorePackage.eINSTANCE.getEObject());
- for (String varName : environment.keySet()) {
- EClassifier varType = environment.get(varName);
- ecoreEnv.addElement(varName, createVar(ecoreEnv, varName, varType), false);
- }
- }
-
- /**
- * @generated
- */
- private static Variable createVar(Environment<?, EClassifier, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?> ecoreEnv, String name, EClassifier type) {
- Variable var = EcoreFactory.eINSTANCE.createVariable();
- var.setName(name);
- var.setType(ecoreEnv.getUMLReflection().getOCLType(type));
- return var;
- }
- }
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.expressions; + +import java.util.Collections; +import java.util.Map; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.ecore.EClassifier; +import org.eclipse.emf.ecore.EParameter; +import org.eclipse.emf.ecore.EcorePackage; +import org.eclipse.ocl.Environment; +import org.eclipse.ocl.EvaluationEnvironment; +import org.eclipse.ocl.ParserException; +import org.eclipse.ocl.ecore.EcoreFactory; +import org.eclipse.ocl.ecore.OCLExpression; +import org.eclipse.ocl.ecore.Variable; +import org.eclipse.ocl.ecore.OCL.Helper; +import org.eclipse.ocl.options.ParsingOptions; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditorPlugin; + +/** + * @generated + */ +public class UMLOCLFactory { + + /** + * @generated + */ + private final UMLAbstractExpression[] expressions; + + /** + * @generated + */ + private final String[] expressionBodies; + + /** + * @generated + */ + protected UMLOCLFactory() { + this.expressions = new UMLAbstractExpression[8]; + this.expressionBodies = new String[] { + "let base : String = \'Lifeline\' in\r\nlet suffixes : Sequence(String) = Sequence {\'\', \'1\', \'2\', \'3\', \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'10\'} in \r\nlet space : Namespace = self.namespace in\r\nlet allMissed : Sequence(String) = suffixes->\r\n select(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s))\r\n ) in\r\nlet firstMissed : String = allMissed->first() in \r\nlet noMisses : Boolean = firstMissed.oclIsUndefined() in\r\nlet allNames : Set(String) = \r\n if noMisses \r\n then \r\n space.member->collect(e : NamedElement | \r\n if e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base\r\n then \'\' \r\n else e.name \r\n endif)->asSet()->excluding(\'\') else Set{\'not in use\'} \r\n endif in \r\nlet longestName : String = \r\n if noMisses\r\n then allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first() \r\n else \'not in use\' \r\n endif in \r\nif noMisses then \r\n if longestName.oclIsUndefined() \r\n then base \r\n else longestName.concat(\'1\') \r\n endif \r\nelse \r\n base.concat(firstMissed) \r\nendif ", //$NON-NLS-1$ + "let base : String = \'Interaction\' in\r\nlet suffixes : Sequence(String) = Sequence {\'\', \'1\', \'2\', \'3\', \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'10\'} in \r\nlet space : Namespace = self.namespace in\r\nlet allMissed : Sequence(String) = suffixes->\r\n select(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s))\r\n ) in\r\nlet firstMissed : String = allMissed->first() in \r\nlet noMisses : Boolean = firstMissed.oclIsUndefined() in\r\nlet allNames : Set(String) = \r\n if noMisses \r\n then \r\n space.member->collect(e : NamedElement | \r\n if e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base\r\n then \'\' \r\n else e.name \r\n endif)->asSet()->excluding(\'\') else Set{\'not in use\'} \r\n endif in \r\nlet longestName : String = \r\n if noMisses\r\n then allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first() \r\n else \'not in use\' \r\n endif in \r\nif noMisses then \r\n if longestName.oclIsUndefined() \r\n then base \r\n else longestName.concat(\'1\') \r\n endif \r\nelse \r\n base.concat(firstMissed) \r\nendif ", //$NON-NLS-1$ + "self.messageSort=MessageSort::createMessage and self.sendEvent<>null and self.receiveEvent<>null", //$NON-NLS-1$ + "self.oclIsKindOf(uml::Lifeline)", //$NON-NLS-1$ + "self.oclIsKindOf(uml::InteractionFragment) or self.oclIsKindOf(uml::Lifeline)", //$NON-NLS-1$ + "self.sendEvent<>null and self.receiveEvent<>null", //$NON-NLS-1$ + "\'OpaqueExpression\'", //$NON-NLS-1$ + "\' \'", //$NON-NLS-1$ + }; + } + + /** + * @generated + */ + private static UMLOCLFactory getInstance() { + UMLOCLFactory instance = UMLDiagramEditorPlugin.getInstance().getUMLOCLFactory(); + if (instance == null) { + UMLDiagramEditorPlugin.getInstance().setUMLOCLFactory(instance = new UMLOCLFactory()); + } + return instance; + } + + /** + * @generated + */ + public static String getExpressionBody(int index) { + return getInstance().expressionBodies[index]; + } + + /** + * @generated + */ + public static UMLAbstractExpression getExpression(int index, EClassifier context, + Map<String, EClassifier> environment) { + UMLOCLFactory cached = getInstance(); + if (index < 0 || index >= cached.expressions.length) { + throw new IllegalArgumentException(); + } + if (cached.expressions[index] == null) { + cached.expressions[index] = getExpression(cached.expressionBodies[index], context, environment == null ? Collections.<String, EClassifier> emptyMap() : environment); + } + return cached.expressions[index]; + } + + /** + * This is factory method, callers are responsible to keep reference to the return value if they want to reuse parsed expression + * @generated + */ + public static UMLAbstractExpression getExpression(String body, EClassifier context, + Map<String, EClassifier> environment) { + return new Expression(body, context, environment); + } + + /** + * This method will become private in the next release + * @generated + */ + public static UMLAbstractExpression getExpression(String body, EClassifier context) { + return getExpression(body, context, Collections.<String, EClassifier> emptyMap()); + } + + /** + * @generated + */ + private static class Expression extends UMLAbstractExpression { + + /** + * @generated + */ + private final org.eclipse.ocl.ecore.OCL oclInstance; + + /** + * @generated + */ + private OCLExpression oclExpression; + + /** + * @generated + */ + public Expression(String body, EClassifier context, Map<String, EClassifier> environment) { + super(body, context); + oclInstance = org.eclipse.ocl.ecore.OCL.newInstance(); + initCustomEnv(oclInstance.getEnvironment(), environment); + Helper oclHelper = oclInstance.createOCLHelper(); + oclHelper.setContext(context()); + try { + oclExpression = oclHelper.createQuery(body()); + setStatus(IStatus.OK, null, null); + } catch (ParserException e) { + setStatus(IStatus.ERROR, e.getMessage(), e); + } + } + + /** + * @generated + */ + @SuppressWarnings("rawtypes") + protected Object doEvaluate(Object context, Map env) { + if (oclExpression == null) { + return null; + } + // on the first call, both evalEnvironment and extentMap are clear, for later we have finally, below. + EvaluationEnvironment<?, ?, ?, ?, ?> evalEnv = oclInstance.getEvaluationEnvironment(); + // initialize environment + for (Object nextKey : env.keySet()) { + evalEnv.replace((String) nextKey, env.get(nextKey)); + } + try { + Object result = oclInstance.evaluate(context, oclExpression); + return oclInstance.isInvalid(result) ? null : result; + } finally { + evalEnv.clear(); + oclInstance.setExtentMap(null); // clear allInstances cache, and get the oclInstance ready for the next call + } + } + + /** + * @generated + */ + private static void initCustomEnv(Environment<?, EClassifier, ?, ?, ?, EParameter, ?, ?, ?, ?, ?, ?> ecoreEnv, Map<String, EClassifier> environment) { + // Use EObject as implicit root class for any object, to allow eContainer() and other EObject operations from OCL expressions + ParsingOptions.setOption(ecoreEnv, ParsingOptions.implicitRootClass(ecoreEnv), EcorePackage.eINSTANCE.getEObject()); + for (String varName : environment.keySet()) { + EClassifier varType = environment.get(varName); + ecoreEnv.addElement(varName, createVar(ecoreEnv, varName, varType), false); + } + } + + /** + * @generated + */ + private static Variable createVar(Environment<?, EClassifier, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?> ecoreEnv, String name, EClassifier type) { + Variable var = EcoreFactory.eINSTANCE.createVariable(); + var.setName(name); + var.setType(ecoreEnv.getUMLReflection().getOCLType(type)); + return var; + } + } +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/navigator/UMLAbstractNavigatorItem.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/navigator/UMLAbstractNavigatorItem.java index 5a5ac81149f..72321de975d 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/navigator/UMLAbstractNavigatorItem.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/navigator/UMLAbstractNavigatorItem.java @@ -1,40 +1,40 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.navigator;
-
-import org.eclipse.core.runtime.PlatformObject;
-
-/**
- * @generated
- */
-public abstract class UMLAbstractNavigatorItem extends PlatformObject {
-
- /**
- * @generated
- */
- private Object myParent;
-
- /**
- * @generated
- */
- protected UMLAbstractNavigatorItem(Object parent) {
- myParent = parent;
- }
-
- /**
- * @generated
- */
- public Object getParent() {
- return myParent;
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.navigator; + +import org.eclipse.core.runtime.PlatformObject; + +/** + * @generated + */ +public abstract class UMLAbstractNavigatorItem extends PlatformObject { + + /** + * @generated + */ + private Object myParent; + + /** + * @generated + */ + protected UMLAbstractNavigatorItem(Object parent) { + myParent = parent; + } + + /** + * @generated + */ + public Object getParent() { + return myParent; + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/navigator/UMLDomainNavigatorContentProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/navigator/UMLDomainNavigatorContentProvider.java index bd5e418aa14..1f4113c0193 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/navigator/UMLDomainNavigatorContentProvider.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/navigator/UMLDomainNavigatorContentProvider.java @@ -1,259 +1,259 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.navigator;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
-import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.workspace.WorkspaceEditingDomainFactory;
-import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditorPlugin;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.navigator.ICommonContentExtensionSite;
-import org.eclipse.ui.navigator.ICommonContentProvider;
-
-/**
- * @generated
- */
-public class UMLDomainNavigatorContentProvider implements ICommonContentProvider {
-
- /**
- * @generated
- */
- private AdapterFactoryContentProvider myAdapterFctoryContentProvier;
-
- /**
- * @generated
- */
- private static final Object[] EMPTY_ARRAY = new Object[0];
-
- /**
- * @generated
- */
- private Viewer myViewer;
-
- /**
- * @generated
- */
- private AdapterFactoryEditingDomain myEditingDomain;
-
- /**
- * @generated
- */
- private WorkspaceSynchronizer myWorkspaceSynchronizer;
-
- /**
- * @generated
- */
- private Runnable myViewerRefreshRunnable;
-
- /**
- * @generated
- */
- public UMLDomainNavigatorContentProvider() {
- myAdapterFctoryContentProvier = new AdapterFactoryContentProvider(UMLDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory());
- TransactionalEditingDomain editingDomain = WorkspaceEditingDomainFactory.INSTANCE.createEditingDomain();
- myEditingDomain = (AdapterFactoryEditingDomain) editingDomain;
- @SuppressWarnings("serial")
- Map<Resource, Boolean> map = new HashMap<Resource, Boolean>() {
-
- @Override
- public Boolean get(java.lang.Object key) {
- if (!containsKey(key)) {
- if (key instanceof Resource) {
- put((Resource) key, Boolean.TRUE);
- }
- }
- return super.get(key);
- }
- };
- myEditingDomain.setResourceToReadOnlyMap(map);
- myViewerRefreshRunnable = new Runnable() {
-
- @Override
- public void run() {
- if (myViewer != null) {
- myViewer.refresh();
- }
- }
- };
- myWorkspaceSynchronizer = new WorkspaceSynchronizer(editingDomain, new WorkspaceSynchronizer.Delegate() {
-
- @Override
- public void dispose() {
- }
-
- @Override
- public boolean handleResourceChanged(final Resource resource) {
- for (Iterator<Resource> it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) {
- Resource nextResource = it.next();
- nextResource.unload();
- }
- if (myViewer != null) {
- myViewer.getControl().getDisplay().asyncExec(myViewerRefreshRunnable);
- }
- return true;
- }
-
- @Override
- public boolean handleResourceDeleted(Resource resource) {
- for (Iterator<Resource> it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) {
- Resource nextResource = it.next();
- nextResource.unload();
- }
- if (myViewer != null) {
- myViewer.getControl().getDisplay().asyncExec(myViewerRefreshRunnable);
- }
- return true;
- }
-
- @Override
- public boolean handleResourceMoved(Resource resource, final URI newURI) {
- for (Iterator<Resource> it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) {
- Resource nextResource = it.next();
- nextResource.unload();
- }
- if (myViewer != null) {
- myViewer.getControl().getDisplay().asyncExec(myViewerRefreshRunnable);
- }
- return true;
- }
- });
- }
-
- /**
- * @generated
- */
- public void dispose() {
- myWorkspaceSynchronizer.dispose();
- myWorkspaceSynchronizer = null;
- myViewerRefreshRunnable = null;
-
- for (Iterator<Resource> it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) {
- Resource resource = it.next();
- resource.unload();
- }
-
- ((TransactionalEditingDomain) myEditingDomain).dispose();
- myEditingDomain = null;
- }
-
- /**
- * @generated
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- myViewer = viewer;
- }
-
- /**
- * @generated
- */
- void unloadAllResources() {
- for (Resource nextResource : myEditingDomain.getResourceSet().getResources()) {
- nextResource.unload();
- }
- }
-
- /**
- * @generated
- */
- void asyncRefresh() {
- if (myViewer != null && !myViewer.getControl().isDisposed()) {
- myViewer.getControl().getDisplay().asyncExec(myViewerRefreshRunnable);
- }
- }
-
- /**
- * @generated
- */
- public Object[] getElements(Object inputElement) {
- return getChildren(inputElement);
- }
-
- /**
- * @generated
- */
- public void restoreState(IMemento aMemento) {
- }
-
- /**
- * @generated
- */
- public void saveState(IMemento aMemento) {
- }
-
- /**
- * @generated
- */
- public void init(ICommonContentExtensionSite aConfig) {
- }
-
- /**
- * @generated
- */
- public Object[] getChildren(Object parentElement) {
- if (parentElement instanceof IFile) {
- IFile file = (IFile) parentElement;
- URI fileURI = URI.createPlatformResourceURI(file.getFullPath().toString(), true);
- Resource resource = myEditingDomain.getResourceSet().getResource(fileURI, true);
- return wrapEObjects(myAdapterFctoryContentProvier.getChildren(resource), parentElement);
- }
-
- if (parentElement instanceof UMLDomainNavigatorItem) {
- return wrapEObjects(myAdapterFctoryContentProvier.getChildren(((UMLDomainNavigatorItem) parentElement).getEObject()), parentElement);
- }
- return EMPTY_ARRAY;
- }
-
- /**
- * @generated
- */
- public Object[] wrapEObjects(Object[] objects, Object parentElement) {
- Collection<UMLDomainNavigatorItem> result = new ArrayList<UMLDomainNavigatorItem>();
- for (int i = 0; i < objects.length; i++) {
- if (objects[i] instanceof EObject) {
- result.add(new UMLDomainNavigatorItem((EObject) objects[i], parentElement, myAdapterFctoryContentProvier));
- }
- }
- return result.toArray();
- }
-
- /**
- * @generated
- */
- public Object getParent(Object element) {
- if (element instanceof UMLAbstractNavigatorItem) {
- UMLAbstractNavigatorItem abstractNavigatorItem = (UMLAbstractNavigatorItem) element;
- return abstractNavigatorItem.getParent();
- }
- return null;
- }
-
- /**
- * @generated
- */
- public boolean hasChildren(Object element) {
- return element instanceof IFile || getChildren(element).length > 0;
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.navigator; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import org.eclipse.core.resources.IFile; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain; +import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.emf.workspace.WorkspaceEditingDomainFactory; +import org.eclipse.emf.workspace.util.WorkspaceSynchronizer; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditorPlugin; +import org.eclipse.ui.IMemento; +import org.eclipse.ui.navigator.ICommonContentExtensionSite; +import org.eclipse.ui.navigator.ICommonContentProvider; + +/** + * @generated + */ +public class UMLDomainNavigatorContentProvider implements ICommonContentProvider { + + /** + * @generated + */ + private AdapterFactoryContentProvider myAdapterFctoryContentProvier; + + /** + * @generated + */ + private static final Object[] EMPTY_ARRAY = new Object[0]; + + /** + * @generated + */ + private Viewer myViewer; + + /** + * @generated + */ + private AdapterFactoryEditingDomain myEditingDomain; + + /** + * @generated + */ + private WorkspaceSynchronizer myWorkspaceSynchronizer; + + /** + * @generated + */ + private Runnable myViewerRefreshRunnable; + + /** + * @generated + */ + public UMLDomainNavigatorContentProvider() { + myAdapterFctoryContentProvier = new AdapterFactoryContentProvider(UMLDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory()); + TransactionalEditingDomain editingDomain = WorkspaceEditingDomainFactory.INSTANCE.createEditingDomain(); + myEditingDomain = (AdapterFactoryEditingDomain) editingDomain; + @SuppressWarnings("serial") + Map<Resource, Boolean> map = new HashMap<Resource, Boolean>() { + + @Override + public Boolean get(java.lang.Object key) { + if (!containsKey(key)) { + if (key instanceof Resource) { + put((Resource) key, Boolean.TRUE); + } + } + return super.get(key); + } + }; + myEditingDomain.setResourceToReadOnlyMap(map); + myViewerRefreshRunnable = new Runnable() { + + @Override + public void run() { + if (myViewer != null) { + myViewer.refresh(); + } + } + }; + myWorkspaceSynchronizer = new WorkspaceSynchronizer(editingDomain, new WorkspaceSynchronizer.Delegate() { + + @Override + public void dispose() { + } + + @Override + public boolean handleResourceChanged(final Resource resource) { + for (Iterator<Resource> it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) { + Resource nextResource = it.next(); + nextResource.unload(); + } + if (myViewer != null) { + myViewer.getControl().getDisplay().asyncExec(myViewerRefreshRunnable); + } + return true; + } + + @Override + public boolean handleResourceDeleted(Resource resource) { + for (Iterator<Resource> it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) { + Resource nextResource = it.next(); + nextResource.unload(); + } + if (myViewer != null) { + myViewer.getControl().getDisplay().asyncExec(myViewerRefreshRunnable); + } + return true; + } + + @Override + public boolean handleResourceMoved(Resource resource, final URI newURI) { + for (Iterator<Resource> it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) { + Resource nextResource = it.next(); + nextResource.unload(); + } + if (myViewer != null) { + myViewer.getControl().getDisplay().asyncExec(myViewerRefreshRunnable); + } + return true; + } + }); + } + + /** + * @generated + */ + public void dispose() { + myWorkspaceSynchronizer.dispose(); + myWorkspaceSynchronizer = null; + myViewerRefreshRunnable = null; + + for (Iterator<Resource> it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) { + Resource resource = it.next(); + resource.unload(); + } + + ((TransactionalEditingDomain) myEditingDomain).dispose(); + myEditingDomain = null; + } + + /** + * @generated + */ + public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { + myViewer = viewer; + } + + /** + * @generated + */ + void unloadAllResources() { + for (Resource nextResource : myEditingDomain.getResourceSet().getResources()) { + nextResource.unload(); + } + } + + /** + * @generated + */ + void asyncRefresh() { + if (myViewer != null && !myViewer.getControl().isDisposed()) { + myViewer.getControl().getDisplay().asyncExec(myViewerRefreshRunnable); + } + } + + /** + * @generated + */ + public Object[] getElements(Object inputElement) { + return getChildren(inputElement); + } + + /** + * @generated + */ + public void restoreState(IMemento aMemento) { + } + + /** + * @generated + */ + public void saveState(IMemento aMemento) { + } + + /** + * @generated + */ + public void init(ICommonContentExtensionSite aConfig) { + } + + /** + * @generated + */ + public Object[] getChildren(Object parentElement) { + if (parentElement instanceof IFile) { + IFile file = (IFile) parentElement; + URI fileURI = URI.createPlatformResourceURI(file.getFullPath().toString(), true); + Resource resource = myEditingDomain.getResourceSet().getResource(fileURI, true); + return wrapEObjects(myAdapterFctoryContentProvier.getChildren(resource), parentElement); + } + + if (parentElement instanceof UMLDomainNavigatorItem) { + return wrapEObjects(myAdapterFctoryContentProvier.getChildren(((UMLDomainNavigatorItem) parentElement).getEObject()), parentElement); + } + return EMPTY_ARRAY; + } + + /** + * @generated + */ + public Object[] wrapEObjects(Object[] objects, Object parentElement) { + Collection<UMLDomainNavigatorItem> result = new ArrayList<UMLDomainNavigatorItem>(); + for (int i = 0; i < objects.length; i++) { + if (objects[i] instanceof EObject) { + result.add(new UMLDomainNavigatorItem((EObject) objects[i], parentElement, myAdapterFctoryContentProvier)); + } + } + return result.toArray(); + } + + /** + * @generated + */ + public Object getParent(Object element) { + if (element instanceof UMLAbstractNavigatorItem) { + UMLAbstractNavigatorItem abstractNavigatorItem = (UMLAbstractNavigatorItem) element; + return abstractNavigatorItem.getParent(); + } + return null; + } + + /** + * @generated + */ + public boolean hasChildren(Object element) { + return element instanceof IFile || getChildren(element).length > 0; + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/navigator/UMLDomainNavigatorItem.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/navigator/UMLDomainNavigatorItem.java index d71008cd86a..ab3e5eb6830 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/navigator/UMLDomainNavigatorItem.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/navigator/UMLDomainNavigatorItem.java @@ -1,122 +1,122 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.navigator;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.IPropertySourceProvider;
-
-/**
- * @generated
- */
-public class UMLDomainNavigatorItem extends PlatformObject {
-
- /**
- * @generated
- */
- static {
- @SuppressWarnings("rawtypes")
- final Class[] supportedTypes = new Class[] { EObject.class, IPropertySource.class };
- Platform.getAdapterManager().registerAdapters(new IAdapterFactory() {
-
- @Override
- @SuppressWarnings("rawtypes")
- public Object getAdapter(Object adaptableObject, Class adapterType) {
- if (adaptableObject instanceof org.eclipse.papyrus.uml.diagram.communication.navigator.UMLDomainNavigatorItem) {
- org.eclipse.papyrus.uml.diagram.communication.navigator.UMLDomainNavigatorItem domainNavigatorItem = (org.eclipse.papyrus.uml.diagram.communication.navigator.UMLDomainNavigatorItem) adaptableObject;
- EObject eObject = domainNavigatorItem.getEObject();
- if (adapterType == EObject.class) {
- return eObject;
- }
- if (adapterType == IPropertySource.class) {
- return domainNavigatorItem.getPropertySourceProvider().getPropertySource(eObject);
- }
- }
-
- return null;
- }
-
- @Override
- @SuppressWarnings("rawtypes")
- public Class[] getAdapterList() {
- return supportedTypes;
- }
- }, org.eclipse.papyrus.uml.diagram.communication.navigator.UMLDomainNavigatorItem.class);
- }
-
- /**
- * @generated
- */
- private Object myParent;
-
- /**
- * @generated
- */
- private EObject myEObject;
-
- /**
- * @generated
- */
- private IPropertySourceProvider myPropertySourceProvider;
-
- /**
- * @generated
- */
- public UMLDomainNavigatorItem(EObject eObject, Object parent, IPropertySourceProvider propertySourceProvider) {
- myParent = parent;
- myEObject = eObject;
- myPropertySourceProvider = propertySourceProvider;
- }
-
- /**
- * @generated
- */
- public Object getParent() {
- return myParent;
- }
-
- /**
- * @generated
- */
- public EObject getEObject() {
- return myEObject;
- }
-
- /**
- * @generated
- */
- public IPropertySourceProvider getPropertySourceProvider() {
- return myPropertySourceProvider;
- }
-
- /**
- * @generated
- */
- public boolean equals(Object obj) {
- if (obj instanceof org.eclipse.papyrus.uml.diagram.communication.navigator.UMLDomainNavigatorItem) {
- return EcoreUtil.getURI(getEObject()).equals(EcoreUtil.getURI(((org.eclipse.papyrus.uml.diagram.communication.navigator.UMLDomainNavigatorItem) obj).getEObject()));
- }
- return super.equals(obj);
- }
-
- /**
- * @generated
- */
- public int hashCode() {
- return EcoreUtil.getURI(getEObject()).hashCode();
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.navigator; + +import org.eclipse.core.runtime.IAdapterFactory; +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.PlatformObject; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.ui.views.properties.IPropertySource; +import org.eclipse.ui.views.properties.IPropertySourceProvider; + +/** + * @generated + */ +public class UMLDomainNavigatorItem extends PlatformObject { + + /** + * @generated + */ + static { + @SuppressWarnings("rawtypes") + final Class[] supportedTypes = new Class[] { EObject.class, IPropertySource.class }; + Platform.getAdapterManager().registerAdapters(new IAdapterFactory() { + + @Override + @SuppressWarnings("rawtypes") + public Object getAdapter(Object adaptableObject, Class adapterType) { + if (adaptableObject instanceof org.eclipse.papyrus.uml.diagram.communication.navigator.UMLDomainNavigatorItem) { + org.eclipse.papyrus.uml.diagram.communication.navigator.UMLDomainNavigatorItem domainNavigatorItem = (org.eclipse.papyrus.uml.diagram.communication.navigator.UMLDomainNavigatorItem) adaptableObject; + EObject eObject = domainNavigatorItem.getEObject(); + if (adapterType == EObject.class) { + return eObject; + } + if (adapterType == IPropertySource.class) { + return domainNavigatorItem.getPropertySourceProvider().getPropertySource(eObject); + } + } + + return null; + } + + @Override + @SuppressWarnings("rawtypes") + public Class[] getAdapterList() { + return supportedTypes; + } + }, org.eclipse.papyrus.uml.diagram.communication.navigator.UMLDomainNavigatorItem.class); + } + + /** + * @generated + */ + private Object myParent; + + /** + * @generated + */ + private EObject myEObject; + + /** + * @generated + */ + private IPropertySourceProvider myPropertySourceProvider; + + /** + * @generated + */ + public UMLDomainNavigatorItem(EObject eObject, Object parent, IPropertySourceProvider propertySourceProvider) { + myParent = parent; + myEObject = eObject; + myPropertySourceProvider = propertySourceProvider; + } + + /** + * @generated + */ + public Object getParent() { + return myParent; + } + + /** + * @generated + */ + public EObject getEObject() { + return myEObject; + } + + /** + * @generated + */ + public IPropertySourceProvider getPropertySourceProvider() { + return myPropertySourceProvider; + } + + /** + * @generated + */ + public boolean equals(Object obj) { + if (obj instanceof org.eclipse.papyrus.uml.diagram.communication.navigator.UMLDomainNavigatorItem) { + return EcoreUtil.getURI(getEObject()).equals(EcoreUtil.getURI(((org.eclipse.papyrus.uml.diagram.communication.navigator.UMLDomainNavigatorItem) obj).getEObject())); + } + return super.equals(obj); + } + + /** + * @generated + */ + public int hashCode() { + return EcoreUtil.getURI(getEObject()).hashCode(); + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/navigator/UMLDomainNavigatorLabelProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/navigator/UMLDomainNavigatorLabelProvider.java index 6f7fa5b84df..3e4b933c0d0 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/navigator/UMLDomainNavigatorLabelProvider.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/navigator/UMLDomainNavigatorLabelProvider.java @@ -1,105 +1,105 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.navigator;
-
-import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditorPlugin;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.navigator.ICommonContentExtensionSite;
-import org.eclipse.ui.navigator.ICommonLabelProvider;
-
-/**
- * @generated
- */
-public class UMLDomainNavigatorLabelProvider implements ICommonLabelProvider {
-
- /**
- * @generated
- */
- private AdapterFactoryLabelProvider myAdapterFactoryLabelProvider = new AdapterFactoryLabelProvider(UMLDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory());
-
- /**
- * @generated
- */
- public void init(ICommonContentExtensionSite aConfig) {
- }
-
- /**
- * @generated
- */
- public Image getImage(Object element) {
- if (element instanceof UMLDomainNavigatorItem) {
- return myAdapterFactoryLabelProvider.getImage(((UMLDomainNavigatorItem) element).getEObject());
- }
- return null;
- }
-
- /**
- * @generated
- */
- public String getText(Object element) {
- if (element instanceof UMLDomainNavigatorItem) {
- return myAdapterFactoryLabelProvider.getText(((UMLDomainNavigatorItem) element).getEObject());
- }
- return null;
- }
-
- /**
- * @generated
- */
- public void addListener(ILabelProviderListener listener) {
- myAdapterFactoryLabelProvider.addListener(listener);
- }
-
- /**
- * @generated
- */
- public void dispose() {
- myAdapterFactoryLabelProvider.dispose();
- }
-
- /**
- * @generated
- */
- public boolean isLabelProperty(Object element, String property) {
- return myAdapterFactoryLabelProvider.isLabelProperty(element, property);
- }
-
- /**
- * @generated
- */
- public void removeListener(ILabelProviderListener listener) {
- myAdapterFactoryLabelProvider.removeListener(listener);
- }
-
- /**
- * @generated
- */
- public void restoreState(IMemento aMemento) {
- }
-
- /**
- * @generated
- */
- public void saveState(IMemento aMemento) {
- }
-
- /**
- * @generated
- */
- public String getDescription(Object anElement) {
- return null;
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.navigator; + +import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; +import org.eclipse.jface.viewers.ILabelProviderListener; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditorPlugin; +import org.eclipse.swt.graphics.Image; +import org.eclipse.ui.IMemento; +import org.eclipse.ui.navigator.ICommonContentExtensionSite; +import org.eclipse.ui.navigator.ICommonLabelProvider; + +/** + * @generated + */ +public class UMLDomainNavigatorLabelProvider implements ICommonLabelProvider { + + /** + * @generated + */ + private AdapterFactoryLabelProvider myAdapterFactoryLabelProvider = new AdapterFactoryLabelProvider(UMLDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory()); + + /** + * @generated + */ + public void init(ICommonContentExtensionSite aConfig) { + } + + /** + * @generated + */ + public Image getImage(Object element) { + if (element instanceof UMLDomainNavigatorItem) { + return myAdapterFactoryLabelProvider.getImage(((UMLDomainNavigatorItem) element).getEObject()); + } + return null; + } + + /** + * @generated + */ + public String getText(Object element) { + if (element instanceof UMLDomainNavigatorItem) { + return myAdapterFactoryLabelProvider.getText(((UMLDomainNavigatorItem) element).getEObject()); + } + return null; + } + + /** + * @generated + */ + public void addListener(ILabelProviderListener listener) { + myAdapterFactoryLabelProvider.addListener(listener); + } + + /** + * @generated + */ + public void dispose() { + myAdapterFactoryLabelProvider.dispose(); + } + + /** + * @generated + */ + public boolean isLabelProperty(Object element, String property) { + return myAdapterFactoryLabelProvider.isLabelProperty(element, property); + } + + /** + * @generated + */ + public void removeListener(ILabelProviderListener listener) { + myAdapterFactoryLabelProvider.removeListener(listener); + } + + /** + * @generated + */ + public void restoreState(IMemento aMemento) { + } + + /** + * @generated + */ + public void saveState(IMemento aMemento) { + } + + /** + * @generated + */ + public String getDescription(Object anElement) { + return null; + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/navigator/UMLNavigatorActionProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/navigator/UMLNavigatorActionProvider.java index 59859b03837..e2a1cddd64f 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/navigator/UMLNavigatorActionProvider.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/navigator/UMLNavigatorActionProvider.java @@ -1,179 +1,179 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.navigator;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.common.ui.URIEditorInput;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ModelEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.part.Messages;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditor;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.navigator.CommonActionProvider;
-import org.eclipse.ui.navigator.ICommonActionConstants;
-import org.eclipse.ui.navigator.ICommonActionExtensionSite;
-import org.eclipse.ui.navigator.ICommonViewerWorkbenchSite;
-import org.eclipse.ui.part.FileEditorInput;
-
-/**
- * @generated
- */
-public class UMLNavigatorActionProvider extends CommonActionProvider {
-
- /**
- * @generated
- */
- private boolean myContribute;
-
- /**
- * @generated
- */
- private OpenDiagramAction myOpenDiagramAction;
-
- /**
- * @generated
- */
- public void init(ICommonActionExtensionSite aSite) {
- super.init(aSite);
- if (aSite.getViewSite() instanceof ICommonViewerWorkbenchSite) {
- myContribute = true;
- makeActions((ICommonViewerWorkbenchSite) aSite.getViewSite());
- } else {
- myContribute = false;
- }
- }
-
- /**
- * @generated
- */
- private void makeActions(ICommonViewerWorkbenchSite viewerSite) {
- myOpenDiagramAction = new OpenDiagramAction(viewerSite);
- }
-
- /**
- * @generated
- */
- public void fillActionBars(IActionBars actionBars) {
- if (!myContribute) {
- return;
- }
- IStructuredSelection selection = (IStructuredSelection) getContext().getSelection();
- myOpenDiagramAction.selectionChanged(selection);
- if (myOpenDiagramAction.isEnabled()) {
- actionBars.setGlobalActionHandler(ICommonActionConstants.OPEN, myOpenDiagramAction);
- }
- }
-
- /**
- * @generated
- */
- public void fillContextMenu(IMenuManager menu) {
- }
-
- /**
- * @generated
- */
- private static class OpenDiagramAction extends Action {
-
- /**
- * @generated
- */
- private Diagram myDiagram;
-
- /**
- * @generated
- */
- private ICommonViewerWorkbenchSite myViewerSite;
-
- /**
- * @generated
- */
- public OpenDiagramAction(ICommonViewerWorkbenchSite viewerSite) {
- super(Messages.NavigatorActionProvider_OpenDiagramActionName);
- myViewerSite = viewerSite;
- }
-
- /**
- * @generated
- */
- public final void selectionChanged(IStructuredSelection selection) {
- myDiagram = null;
- if (selection.size() == 1) {
- Object selectedElement = selection.getFirstElement();
- if (selectedElement instanceof UMLNavigatorItem) {
- selectedElement = ((UMLNavigatorItem) selectedElement).getView();
- } else if (selectedElement instanceof IAdaptable) {
- selectedElement = ((IAdaptable) selectedElement).getAdapter(View.class);
- }
- if (selectedElement instanceof Diagram) {
- Diagram diagram = (Diagram) selectedElement;
- if (ModelEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(diagram))) {
- myDiagram = diagram;
- }
- }
- }
- setEnabled(myDiagram != null);
- }
-
- /**
- * @generated
- */
- public void run() {
- if (myDiagram == null || myDiagram.eResource() == null) {
- return;
- }
-
- IEditorInput editorInput = getEditorInput(myDiagram);
- IWorkbenchPage page = myViewerSite.getPage();
- try {
- page.openEditor(editorInput, UMLDiagramEditor.ID);
- } catch (PartInitException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Exception while openning diagram", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- private static IEditorInput getEditorInput(Diagram diagram) {
- Resource diagramResource = diagram.eResource();
- for (EObject nextEObject : diagramResource.getContents()) {
- if (nextEObject == diagram) {
- return new FileEditorInput(WorkspaceSynchronizer.getFile(diagramResource));
- }
- if (nextEObject instanceof Diagram) {
- break;
- }
- }
- URI uri = EcoreUtil.getURI(diagram);
- String editorName = uri.lastSegment() + '#' + diagram.eResource().getContents().indexOf(diagram);
- IEditorInput editorInput = new URIEditorInput(uri, editorName);
- return editorInput;
- }
-
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.navigator; + +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.emf.common.ui.URIEditorInput; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.emf.workspace.util.WorkspaceSynchronizer; +import org.eclipse.gmf.runtime.notation.Diagram; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.jface.action.Action; +import org.eclipse.jface.action.IMenuManager; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ModelEditPart; +import org.eclipse.papyrus.uml.diagram.communication.part.Messages; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditor; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditorPlugin; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry; +import org.eclipse.ui.IActionBars; +import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.navigator.CommonActionProvider; +import org.eclipse.ui.navigator.ICommonActionConstants; +import org.eclipse.ui.navigator.ICommonActionExtensionSite; +import org.eclipse.ui.navigator.ICommonViewerWorkbenchSite; +import org.eclipse.ui.part.FileEditorInput; + +/** + * @generated + */ +public class UMLNavigatorActionProvider extends CommonActionProvider { + + /** + * @generated + */ + private boolean myContribute; + + /** + * @generated + */ + private OpenDiagramAction myOpenDiagramAction; + + /** + * @generated + */ + public void init(ICommonActionExtensionSite aSite) { + super.init(aSite); + if (aSite.getViewSite() instanceof ICommonViewerWorkbenchSite) { + myContribute = true; + makeActions((ICommonViewerWorkbenchSite) aSite.getViewSite()); + } else { + myContribute = false; + } + } + + /** + * @generated + */ + private void makeActions(ICommonViewerWorkbenchSite viewerSite) { + myOpenDiagramAction = new OpenDiagramAction(viewerSite); + } + + /** + * @generated + */ + public void fillActionBars(IActionBars actionBars) { + if (!myContribute) { + return; + } + IStructuredSelection selection = (IStructuredSelection) getContext().getSelection(); + myOpenDiagramAction.selectionChanged(selection); + if (myOpenDiagramAction.isEnabled()) { + actionBars.setGlobalActionHandler(ICommonActionConstants.OPEN, myOpenDiagramAction); + } + } + + /** + * @generated + */ + public void fillContextMenu(IMenuManager menu) { + } + + /** + * @generated + */ + private static class OpenDiagramAction extends Action { + + /** + * @generated + */ + private Diagram myDiagram; + + /** + * @generated + */ + private ICommonViewerWorkbenchSite myViewerSite; + + /** + * @generated + */ + public OpenDiagramAction(ICommonViewerWorkbenchSite viewerSite) { + super(Messages.NavigatorActionProvider_OpenDiagramActionName); + myViewerSite = viewerSite; + } + + /** + * @generated + */ + public final void selectionChanged(IStructuredSelection selection) { + myDiagram = null; + if (selection.size() == 1) { + Object selectedElement = selection.getFirstElement(); + if (selectedElement instanceof UMLNavigatorItem) { + selectedElement = ((UMLNavigatorItem) selectedElement).getView(); + } else if (selectedElement instanceof IAdaptable) { + selectedElement = ((IAdaptable) selectedElement).getAdapter(View.class); + } + if (selectedElement instanceof Diagram) { + Diagram diagram = (Diagram) selectedElement; + if (ModelEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(diagram))) { + myDiagram = diagram; + } + } + } + setEnabled(myDiagram != null); + } + + /** + * @generated + */ + public void run() { + if (myDiagram == null || myDiagram.eResource() == null) { + return; + } + + IEditorInput editorInput = getEditorInput(myDiagram); + IWorkbenchPage page = myViewerSite.getPage(); + try { + page.openEditor(editorInput, UMLDiagramEditor.ID); + } catch (PartInitException e) { + UMLDiagramEditorPlugin.getInstance().logError("Exception while openning diagram", e); //$NON-NLS-1$ + } + } + + /** + * @generated + */ + private static IEditorInput getEditorInput(Diagram diagram) { + Resource diagramResource = diagram.eResource(); + for (EObject nextEObject : diagramResource.getContents()) { + if (nextEObject == diagram) { + return new FileEditorInput(WorkspaceSynchronizer.getFile(diagramResource)); + } + if (nextEObject instanceof Diagram) { + break; + } + } + URI uri = EcoreUtil.getURI(diagram); + String editorName = uri.lastSegment() + '#' + diagram.eResource().getContents().indexOf(diagram); + IEditorInput editorInput = new URIEditorInput(uri, editorName); + return editorInput; + } + + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/navigator/UMLNavigatorContentProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/navigator/UMLNavigatorContentProvider.java index cc86d54f0da..321a5a769f4 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/navigator/UMLNavigatorContentProvider.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/navigator/UMLNavigatorContentProvider.java @@ -1,278 +1,278 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.navigator;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.workspace.WorkspaceEditingDomainFactory;
-import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ModelEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.navigator.ICommonContentExtensionSite;
-import org.eclipse.ui.navigator.ICommonContentProvider;
-
-/**
- * @generated
- */
-public class UMLNavigatorContentProvider implements ICommonContentProvider {
-
- /**
- * @generated
- */
- private static final Object[] EMPTY_ARRAY = new Object[0];
-
- /**
- * @generated
- */
- private Viewer myViewer;
-
- /**
- * @generated
- */
- private AdapterFactoryEditingDomain myEditingDomain;
-
- /**
- * @generated
- */
- private WorkspaceSynchronizer myWorkspaceSynchronizer;
-
- /**
- * @generated
- */
- private Runnable myViewerRefreshRunnable;
-
- /**
- * @generated
- */
- public UMLNavigatorContentProvider() {
- TransactionalEditingDomain editingDomain = WorkspaceEditingDomainFactory.INSTANCE.createEditingDomain();
- myEditingDomain = (AdapterFactoryEditingDomain) editingDomain;
- @SuppressWarnings("serial")
- Map<Resource, Boolean> map = new HashMap<Resource, Boolean>() {
-
- @Override
- public Boolean get(java.lang.Object key) {
- if (!containsKey(key)) {
- if (key instanceof Resource) {
- put((Resource) key, Boolean.TRUE);
- }
- }
- return super.get(key);
- }
- };
- myEditingDomain.setResourceToReadOnlyMap(map);
- myViewerRefreshRunnable = new Runnable() {
-
- @Override
- public void run() {
- if (myViewer != null) {
- myViewer.refresh();
- }
- }
- };
- myWorkspaceSynchronizer = new WorkspaceSynchronizer(editingDomain, new WorkspaceSynchronizer.Delegate() {
-
- @Override
- public void dispose() {
- }
-
- @Override
- public boolean handleResourceChanged(final Resource resource) {
- for (Iterator<Resource> it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) {
- Resource nextResource = it.next();
- nextResource.unload();
- }
- if (myViewer != null) {
- myViewer.getControl().getDisplay().asyncExec(myViewerRefreshRunnable);
- }
- return true;
- }
-
- @Override
- public boolean handleResourceDeleted(Resource resource) {
- for (Iterator<Resource> it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) {
- Resource nextResource = it.next();
- nextResource.unload();
- }
- if (myViewer != null) {
- myViewer.getControl().getDisplay().asyncExec(myViewerRefreshRunnable);
- }
- return true;
- }
-
- @Override
- public boolean handleResourceMoved(Resource resource, final URI newURI) {
- for (Iterator<Resource> it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) {
- Resource nextResource = it.next();
- nextResource.unload();
- }
- if (myViewer != null) {
- myViewer.getControl().getDisplay().asyncExec(myViewerRefreshRunnable);
- }
- return true;
- }
- });
- }
-
- /**
- * @generated
- */
- public void dispose() {
- myWorkspaceSynchronizer.dispose();
- myWorkspaceSynchronizer = null;
- myViewerRefreshRunnable = null;
-
- for (Iterator<Resource> it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) {
- Resource resource = it.next();
- resource.unload();
- }
-
- ((TransactionalEditingDomain) myEditingDomain).dispose();
- myEditingDomain = null;
- }
-
- /**
- * @generated
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- myViewer = viewer;
- }
-
- /**
- * @generated
- */
- void unloadAllResources() {
- for (Resource nextResource : myEditingDomain.getResourceSet().getResources()) {
- nextResource.unload();
- }
- }
-
- /**
- * @generated
- */
- void asyncRefresh() {
- if (myViewer != null && !myViewer.getControl().isDisposed()) {
- myViewer.getControl().getDisplay().asyncExec(myViewerRefreshRunnable);
- }
- }
-
- /**
- * @generated
- */
- public Object[] getElements(Object inputElement) {
- return getChildren(inputElement);
- }
-
- /**
- * @generated
- */
- public void restoreState(IMemento aMemento) {
- }
-
- /**
- * @generated
- */
- public void saveState(IMemento aMemento) {
- }
-
- /**
- * @generated
- */
- public void init(ICommonContentExtensionSite aConfig) {
- }
-
- /**
- * @generated
- */
- public Object[] getChildren(Object parentElement) {
- if (parentElement instanceof IFile) {
- IFile file = (IFile) parentElement;
- URI fileURI = URI.createPlatformResourceURI(file.getFullPath().toString(), true);
- Resource resource = myEditingDomain.getResourceSet().getResource(fileURI, true);
- Collection<Object> result = new ArrayList<Object>();
- List<View> topViews = new ArrayList<View>(resource.getContents().size());
- for (EObject o : resource.getContents()) {
- if (o instanceof View) {
- topViews.add((View) o);
- }
- }
- return result.toArray();
- }
-
- if (parentElement instanceof UMLNavigatorGroup) {
- UMLNavigatorGroup group = (UMLNavigatorGroup) parentElement;
- return group.getChildren();
- }
-
- if (parentElement instanceof UMLNavigatorItem) {
- UMLNavigatorItem navigatorItem = (UMLNavigatorItem) parentElement;
- if (navigatorItem.isLeaf() || !isOwnView(navigatorItem.getView())) {
- return EMPTY_ARRAY;
- }
- return getViewChildren(navigatorItem.getView(), parentElement);
- }
-
- return EMPTY_ARRAY;
- }
-
- /**
- * @generated
- */
- private Object[] getViewChildren(View view, Object parentElement) {
- String vid = UMLVisualIDRegistry.getVisualID(view);
- if (vid != null) {
- switch (vid) {
- }
- }
- return EMPTY_ARRAY;
- }
-
- /**
- * @generated
- */
- private boolean isOwnView(View view) {
- return ModelEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(view));
- }
-
- /**
- * @generated
- */
- public Object getParent(Object element) {
- if (element instanceof UMLAbstractNavigatorItem) {
- UMLAbstractNavigatorItem abstractNavigatorItem = (UMLAbstractNavigatorItem) element;
- return abstractNavigatorItem.getParent();
- }
- return null;
- }
-
- /**
- * @generated
- */
- public boolean hasChildren(Object element) {
- return element instanceof IFile || getChildren(element).length > 0;
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.navigator; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import org.eclipse.core.resources.IFile; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.emf.workspace.WorkspaceEditingDomainFactory; +import org.eclipse.emf.workspace.util.WorkspaceSynchronizer; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ModelEditPart; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry; +import org.eclipse.ui.IMemento; +import org.eclipse.ui.navigator.ICommonContentExtensionSite; +import org.eclipse.ui.navigator.ICommonContentProvider; + +/** + * @generated + */ +public class UMLNavigatorContentProvider implements ICommonContentProvider { + + /** + * @generated + */ + private static final Object[] EMPTY_ARRAY = new Object[0]; + + /** + * @generated + */ + private Viewer myViewer; + + /** + * @generated + */ + private AdapterFactoryEditingDomain myEditingDomain; + + /** + * @generated + */ + private WorkspaceSynchronizer myWorkspaceSynchronizer; + + /** + * @generated + */ + private Runnable myViewerRefreshRunnable; + + /** + * @generated + */ + public UMLNavigatorContentProvider() { + TransactionalEditingDomain editingDomain = WorkspaceEditingDomainFactory.INSTANCE.createEditingDomain(); + myEditingDomain = (AdapterFactoryEditingDomain) editingDomain; + @SuppressWarnings("serial") + Map<Resource, Boolean> map = new HashMap<Resource, Boolean>() { + + @Override + public Boolean get(java.lang.Object key) { + if (!containsKey(key)) { + if (key instanceof Resource) { + put((Resource) key, Boolean.TRUE); + } + } + return super.get(key); + } + }; + myEditingDomain.setResourceToReadOnlyMap(map); + myViewerRefreshRunnable = new Runnable() { + + @Override + public void run() { + if (myViewer != null) { + myViewer.refresh(); + } + } + }; + myWorkspaceSynchronizer = new WorkspaceSynchronizer(editingDomain, new WorkspaceSynchronizer.Delegate() { + + @Override + public void dispose() { + } + + @Override + public boolean handleResourceChanged(final Resource resource) { + for (Iterator<Resource> it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) { + Resource nextResource = it.next(); + nextResource.unload(); + } + if (myViewer != null) { + myViewer.getControl().getDisplay().asyncExec(myViewerRefreshRunnable); + } + return true; + } + + @Override + public boolean handleResourceDeleted(Resource resource) { + for (Iterator<Resource> it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) { + Resource nextResource = it.next(); + nextResource.unload(); + } + if (myViewer != null) { + myViewer.getControl().getDisplay().asyncExec(myViewerRefreshRunnable); + } + return true; + } + + @Override + public boolean handleResourceMoved(Resource resource, final URI newURI) { + for (Iterator<Resource> it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) { + Resource nextResource = it.next(); + nextResource.unload(); + } + if (myViewer != null) { + myViewer.getControl().getDisplay().asyncExec(myViewerRefreshRunnable); + } + return true; + } + }); + } + + /** + * @generated + */ + public void dispose() { + myWorkspaceSynchronizer.dispose(); + myWorkspaceSynchronizer = null; + myViewerRefreshRunnable = null; + + for (Iterator<Resource> it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) { + Resource resource = it.next(); + resource.unload(); + } + + ((TransactionalEditingDomain) myEditingDomain).dispose(); + myEditingDomain = null; + } + + /** + * @generated + */ + public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { + myViewer = viewer; + } + + /** + * @generated + */ + void unloadAllResources() { + for (Resource nextResource : myEditingDomain.getResourceSet().getResources()) { + nextResource.unload(); + } + } + + /** + * @generated + */ + void asyncRefresh() { + if (myViewer != null && !myViewer.getControl().isDisposed()) { + myViewer.getControl().getDisplay().asyncExec(myViewerRefreshRunnable); + } + } + + /** + * @generated + */ + public Object[] getElements(Object inputElement) { + return getChildren(inputElement); + } + + /** + * @generated + */ + public void restoreState(IMemento aMemento) { + } + + /** + * @generated + */ + public void saveState(IMemento aMemento) { + } + + /** + * @generated + */ + public void init(ICommonContentExtensionSite aConfig) { + } + + /** + * @generated + */ + public Object[] getChildren(Object parentElement) { + if (parentElement instanceof IFile) { + IFile file = (IFile) parentElement; + URI fileURI = URI.createPlatformResourceURI(file.getFullPath().toString(), true); + Resource resource = myEditingDomain.getResourceSet().getResource(fileURI, true); + Collection<Object> result = new ArrayList<Object>(); + List<View> topViews = new ArrayList<View>(resource.getContents().size()); + for (EObject o : resource.getContents()) { + if (o instanceof View) { + topViews.add((View) o); + } + } + return result.toArray(); + } + + if (parentElement instanceof UMLNavigatorGroup) { + UMLNavigatorGroup group = (UMLNavigatorGroup) parentElement; + return group.getChildren(); + } + + if (parentElement instanceof UMLNavigatorItem) { + UMLNavigatorItem navigatorItem = (UMLNavigatorItem) parentElement; + if (navigatorItem.isLeaf() || !isOwnView(navigatorItem.getView())) { + return EMPTY_ARRAY; + } + return getViewChildren(navigatorItem.getView(), parentElement); + } + + return EMPTY_ARRAY; + } + + /** + * @generated + */ + private Object[] getViewChildren(View view, Object parentElement) { + String vid = UMLVisualIDRegistry.getVisualID(view); + if (vid != null) { + switch (vid) { + } + } + return EMPTY_ARRAY; + } + + /** + * @generated + */ + private boolean isOwnView(View view) { + return ModelEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(view)); + } + + /** + * @generated + */ + public Object getParent(Object element) { + if (element instanceof UMLAbstractNavigatorItem) { + UMLAbstractNavigatorItem abstractNavigatorItem = (UMLAbstractNavigatorItem) element; + return abstractNavigatorItem.getParent(); + } + return null; + } + + /** + * @generated + */ + public boolean hasChildren(Object element) { + return element instanceof IFile || getChildren(element).length > 0; + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/navigator/UMLNavigatorGroup.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/navigator/UMLNavigatorGroup.java index d57a62d82e1..2fefd488502 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/navigator/UMLNavigatorGroup.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/navigator/UMLNavigatorGroup.java @@ -1,108 +1,108 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.navigator;
-
-import java.util.Collection;
-import java.util.LinkedList;
-
-/**
- * @generated
- */
-public class UMLNavigatorGroup extends UMLAbstractNavigatorItem {
-
- /**
- * @generated
- */
- private String myGroupName;
-
- /**
- * @generated
- */
- private String myIcon;
-
- /**
- * @generated
- */
- private Collection<java.lang.Object> myChildren = new LinkedList<java.lang.Object>();
-
- /**
- * @generated
- */
- UMLNavigatorGroup(String groupName, String icon, Object parent) {
- super(parent);
- myGroupName = groupName;
- myIcon = icon;
- }
-
- /**
- * @generated
- */
- public String getGroupName() {
- return myGroupName;
- }
-
- /**
- * @generated
- */
- public String getIcon() {
- return myIcon;
- }
-
- /**
- * @generated
- */
- public Object[] getChildren() {
- return myChildren.toArray();
- }
-
- /**
- * @generated
- */
- public void addChildren(Collection<java.lang.Object> children) {
- myChildren.addAll(children);
- }
-
- /**
- * @generated
- */
- public void addChild(Object child) {
- myChildren.add(child);
- }
-
- /**
- * @generated
- */
- public boolean isEmpty() {
- return myChildren.size() == 0;
- }
-
- /**
- * @generated
- */
- public boolean equals(Object obj) {
- if (obj instanceof org.eclipse.papyrus.uml.diagram.communication.navigator.UMLNavigatorGroup) {
- org.eclipse.papyrus.uml.diagram.communication.navigator.UMLNavigatorGroup anotherGroup = (org.eclipse.papyrus.uml.diagram.communication.navigator.UMLNavigatorGroup) obj;
- if (getGroupName().equals(anotherGroup.getGroupName())) {
- return getParent().equals(anotherGroup.getParent());
- }
- }
- return super.equals(obj);
- }
-
- /**
- * @generated
- */
- public int hashCode() {
- return getGroupName().hashCode();
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.navigator; + +import java.util.Collection; +import java.util.LinkedList; + +/** + * @generated + */ +public class UMLNavigatorGroup extends UMLAbstractNavigatorItem { + + /** + * @generated + */ + private String myGroupName; + + /** + * @generated + */ + private String myIcon; + + /** + * @generated + */ + private Collection<java.lang.Object> myChildren = new LinkedList<java.lang.Object>(); + + /** + * @generated + */ + UMLNavigatorGroup(String groupName, String icon, Object parent) { + super(parent); + myGroupName = groupName; + myIcon = icon; + } + + /** + * @generated + */ + public String getGroupName() { + return myGroupName; + } + + /** + * @generated + */ + public String getIcon() { + return myIcon; + } + + /** + * @generated + */ + public Object[] getChildren() { + return myChildren.toArray(); + } + + /** + * @generated + */ + public void addChildren(Collection<java.lang.Object> children) { + myChildren.addAll(children); + } + + /** + * @generated + */ + public void addChild(Object child) { + myChildren.add(child); + } + + /** + * @generated + */ + public boolean isEmpty() { + return myChildren.size() == 0; + } + + /** + * @generated + */ + public boolean equals(Object obj) { + if (obj instanceof org.eclipse.papyrus.uml.diagram.communication.navigator.UMLNavigatorGroup) { + org.eclipse.papyrus.uml.diagram.communication.navigator.UMLNavigatorGroup anotherGroup = (org.eclipse.papyrus.uml.diagram.communication.navigator.UMLNavigatorGroup) obj; + if (getGroupName().equals(anotherGroup.getGroupName())) { + return getParent().equals(anotherGroup.getParent()); + } + } + return super.equals(obj); + } + + /** + * @generated + */ + public int hashCode() { + return getGroupName().hashCode(); + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/navigator/UMLNavigatorItem.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/navigator/UMLNavigatorItem.java index 7b813513f00..519c5e0eca2 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/navigator/UMLNavigatorItem.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/navigator/UMLNavigatorItem.java @@ -1,100 +1,100 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.navigator;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.gmf.runtime.notation.View;
-
-/**
- * @generated
- */
-public class UMLNavigatorItem extends UMLAbstractNavigatorItem {
-
- /**
- * @generated
- */
- static {
- @SuppressWarnings("rawtypes")
- final Class[] supportedTypes = new Class[] { View.class, EObject.class };
- Platform.getAdapterManager().registerAdapters(new IAdapterFactory() {
-
- @Override
- @SuppressWarnings("rawtypes")
- public Object getAdapter(Object adaptableObject, Class adapterType) {
- if (adaptableObject instanceof org.eclipse.papyrus.uml.diagram.communication.navigator.UMLNavigatorItem && (adapterType == View.class || adapterType == EObject.class)) {
- return ((org.eclipse.papyrus.uml.diagram.communication.navigator.UMLNavigatorItem) adaptableObject).getView();
- }
- return null;
- }
-
- @Override
- @SuppressWarnings("rawtypes")
- public Class[] getAdapterList() {
- return supportedTypes;
- }
- }, org.eclipse.papyrus.uml.diagram.communication.navigator.UMLNavigatorItem.class);
- }
-
- /**
- * @generated
- */
- private View myView;
-
- /**
- * @generated
- */
- private boolean myLeaf = false;
-
- /**
- * @generated
- */
- public UMLNavigatorItem(View view, Object parent, boolean isLeaf) {
- super(parent);
- myView = view;
- myLeaf = isLeaf;
- }
-
- /**
- * @generated
- */
- public View getView() {
- return myView;
- }
-
- /**
- * @generated
- */
- public boolean isLeaf() {
- return myLeaf;
- }
-
- /**
- * @generated
- */
- public boolean equals(Object obj) {
- if (obj instanceof org.eclipse.papyrus.uml.diagram.communication.navigator.UMLNavigatorItem) {
- return EcoreUtil.getURI(getView()).equals(EcoreUtil.getURI(((org.eclipse.papyrus.uml.diagram.communication.navigator.UMLNavigatorItem) obj).getView()));
- }
- return super.equals(obj);
- }
-
- /**
- * @generated
- */
- public int hashCode() {
- return EcoreUtil.getURI(getView()).hashCode();
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.navigator; + +import org.eclipse.core.runtime.IAdapterFactory; +import org.eclipse.core.runtime.Platform; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.gmf.runtime.notation.View; + +/** + * @generated + */ +public class UMLNavigatorItem extends UMLAbstractNavigatorItem { + + /** + * @generated + */ + static { + @SuppressWarnings("rawtypes") + final Class[] supportedTypes = new Class[] { View.class, EObject.class }; + Platform.getAdapterManager().registerAdapters(new IAdapterFactory() { + + @Override + @SuppressWarnings("rawtypes") + public Object getAdapter(Object adaptableObject, Class adapterType) { + if (adaptableObject instanceof org.eclipse.papyrus.uml.diagram.communication.navigator.UMLNavigatorItem && (adapterType == View.class || adapterType == EObject.class)) { + return ((org.eclipse.papyrus.uml.diagram.communication.navigator.UMLNavigatorItem) adaptableObject).getView(); + } + return null; + } + + @Override + @SuppressWarnings("rawtypes") + public Class[] getAdapterList() { + return supportedTypes; + } + }, org.eclipse.papyrus.uml.diagram.communication.navigator.UMLNavigatorItem.class); + } + + /** + * @generated + */ + private View myView; + + /** + * @generated + */ + private boolean myLeaf = false; + + /** + * @generated + */ + public UMLNavigatorItem(View view, Object parent, boolean isLeaf) { + super(parent); + myView = view; + myLeaf = isLeaf; + } + + /** + * @generated + */ + public View getView() { + return myView; + } + + /** + * @generated + */ + public boolean isLeaf() { + return myLeaf; + } + + /** + * @generated + */ + public boolean equals(Object obj) { + if (obj instanceof org.eclipse.papyrus.uml.diagram.communication.navigator.UMLNavigatorItem) { + return EcoreUtil.getURI(getView()).equals(EcoreUtil.getURI(((org.eclipse.papyrus.uml.diagram.communication.navigator.UMLNavigatorItem) obj).getView())); + } + return super.equals(obj); + } + + /** + * @generated + */ + public int hashCode() { + return EcoreUtil.getURI(getView()).hashCode(); + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/navigator/UMLNavigatorLabelProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/navigator/UMLNavigatorLabelProvider.java index 0008b88ee0d..3ae339e6af5 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/navigator/UMLNavigatorLabelProvider.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/navigator/UMLNavigatorLabelProvider.java @@ -1,179 +1,179 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.navigator;
-
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.jface.viewers.ITreePathLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.jface.viewers.ViewerLabel;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ModelEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.uml.diagram.communication.providers.UMLElementTypes;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.navigator.ICommonContentExtensionSite;
-import org.eclipse.ui.navigator.ICommonLabelProvider;
-
-/**
- * @generated
- */
-public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonLabelProvider, ITreePathLabelProvider {
-
- /**
- * @generated
- */
- static {
- UMLDiagramEditorPlugin.getInstance().getImageRegistry().put("Navigator?UnknownElement", ImageDescriptor.getMissingImageDescriptor()); //$NON-NLS-1$
- UMLDiagramEditorPlugin.getInstance().getImageRegistry().put("Navigator?ImageNotFound", ImageDescriptor.getMissingImageDescriptor()); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- public void updateLabel(ViewerLabel label, TreePath elementPath) {
- Object element = elementPath.getLastSegment();
- if (element instanceof UMLNavigatorItem && !isOwnView(((UMLNavigatorItem) element).getView())) {
- return;
- }
- label.setText(getText(element));
- label.setImage(getImage(element));
- }
-
- /**
- * @generated
- */
- public Image getImage(Object element) {
- if (element instanceof UMLNavigatorGroup) {
- UMLNavigatorGroup group = (UMLNavigatorGroup) element;
- return UMLDiagramEditorPlugin.getInstance().getBundledImage(group.getIcon());
- }
-
- if (element instanceof UMLNavigatorItem) {
- UMLNavigatorItem navigatorItem = (UMLNavigatorItem) element;
- if (!isOwnView(navigatorItem.getView())) {
- return super.getImage(element);
- }
- return getImage(navigatorItem.getView());
- }
-
-
- return super.getImage(element);
- }
-
- /**
- * @generated
- */
- public Image getImage(View view) {
- return getImage("Navigator?UnknownElement", null); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- private Image getImage(String key, IElementType elementType) {
- ImageRegistry imageRegistry = UMLDiagramEditorPlugin.getInstance().getImageRegistry();
- Image image = imageRegistry.get(key);
- if (image == null && elementType != null && UMLElementTypes.isKnownElementType(elementType)) {
- image = UMLElementTypes.getImage(elementType);
- imageRegistry.put(key, image);
- }
-
- if (image == null) {
- image = imageRegistry.get("Navigator?ImageNotFound"); //$NON-NLS-1$
- imageRegistry.put(key, image);
- }
- return image;
- }
-
- /**
- * @generated
- */
- public String getText(Object element) {
- if (element instanceof UMLNavigatorGroup) {
- UMLNavigatorGroup group = (UMLNavigatorGroup) element;
- return group.getGroupName();
- }
-
- if (element instanceof UMLNavigatorItem) {
- UMLNavigatorItem navigatorItem = (UMLNavigatorItem) element;
- if (!isOwnView(navigatorItem.getView())) {
- return null;
- }
- return getText(navigatorItem.getView());
- }
-
-
- return super.getText(element);
- }
-
- /**
- * @generated
- */
- public String getText(View view) {
- if (view.getElement() != null && view.getElement().eIsProxy()) {
- return getUnresolvedDomainElementProxyText(view);
- }
- return getUnknownElementText(view);
- }
-
- /**
- * @generated
- */
- private String getUnknownElementText(View view) {
- return "<UnknownElement Visual_ID = " + view.getType() + ">"; //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * @generated
- */
- private String getUnresolvedDomainElementProxyText(View view) {
- return "<Unresolved domain element Visual_ID = " + view.getType() + ">"; //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * @generated
- */
- public void init(ICommonContentExtensionSite aConfig) {
- }
-
- /**
- * @generated
- */
- public void restoreState(IMemento aMemento) {
- }
-
- /**
- * @generated
- */
- public void saveState(IMemento aMemento) {
- }
-
- /**
- * @generated
- */
- public String getDescription(Object anElement) {
- return null;
- }
-
- /**
- * @generated
- */
- private boolean isOwnView(View view) {
- return ModelEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(view));
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.navigator; + +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.jface.resource.ImageRegistry; +import org.eclipse.jface.viewers.ITreePathLabelProvider; +import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.jface.viewers.TreePath; +import org.eclipse.jface.viewers.ViewerLabel; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ModelEditPart; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditorPlugin; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry; +import org.eclipse.papyrus.uml.diagram.communication.providers.UMLElementTypes; +import org.eclipse.swt.graphics.Image; +import org.eclipse.ui.IMemento; +import org.eclipse.ui.navigator.ICommonContentExtensionSite; +import org.eclipse.ui.navigator.ICommonLabelProvider; + +/** + * @generated + */ +public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonLabelProvider, ITreePathLabelProvider { + + /** + * @generated + */ + static { + UMLDiagramEditorPlugin.getInstance().getImageRegistry().put("Navigator?UnknownElement", ImageDescriptor.getMissingImageDescriptor()); //$NON-NLS-1$ + UMLDiagramEditorPlugin.getInstance().getImageRegistry().put("Navigator?ImageNotFound", ImageDescriptor.getMissingImageDescriptor()); //$NON-NLS-1$ + } + + /** + * @generated + */ + public void updateLabel(ViewerLabel label, TreePath elementPath) { + Object element = elementPath.getLastSegment(); + if (element instanceof UMLNavigatorItem && !isOwnView(((UMLNavigatorItem) element).getView())) { + return; + } + label.setText(getText(element)); + label.setImage(getImage(element)); + } + + /** + * @generated + */ + public Image getImage(Object element) { + if (element instanceof UMLNavigatorGroup) { + UMLNavigatorGroup group = (UMLNavigatorGroup) element; + return UMLDiagramEditorPlugin.getInstance().getBundledImage(group.getIcon()); + } + + if (element instanceof UMLNavigatorItem) { + UMLNavigatorItem navigatorItem = (UMLNavigatorItem) element; + if (!isOwnView(navigatorItem.getView())) { + return super.getImage(element); + } + return getImage(navigatorItem.getView()); + } + + + return super.getImage(element); + } + + /** + * @generated + */ + public Image getImage(View view) { + return getImage("Navigator?UnknownElement", null); //$NON-NLS-1$ + } + + /** + * @generated + */ + private Image getImage(String key, IElementType elementType) { + ImageRegistry imageRegistry = UMLDiagramEditorPlugin.getInstance().getImageRegistry(); + Image image = imageRegistry.get(key); + if (image == null && elementType != null && UMLElementTypes.isKnownElementType(elementType)) { + image = UMLElementTypes.getImage(elementType); + imageRegistry.put(key, image); + } + + if (image == null) { + image = imageRegistry.get("Navigator?ImageNotFound"); //$NON-NLS-1$ + imageRegistry.put(key, image); + } + return image; + } + + /** + * @generated + */ + public String getText(Object element) { + if (element instanceof UMLNavigatorGroup) { + UMLNavigatorGroup group = (UMLNavigatorGroup) element; + return group.getGroupName(); + } + + if (element instanceof UMLNavigatorItem) { + UMLNavigatorItem navigatorItem = (UMLNavigatorItem) element; + if (!isOwnView(navigatorItem.getView())) { + return null; + } + return getText(navigatorItem.getView()); + } + + + return super.getText(element); + } + + /** + * @generated + */ + public String getText(View view) { + if (view.getElement() != null && view.getElement().eIsProxy()) { + return getUnresolvedDomainElementProxyText(view); + } + return getUnknownElementText(view); + } + + /** + * @generated + */ + private String getUnknownElementText(View view) { + return "<UnknownElement Visual_ID = " + view.getType() + ">"; //$NON-NLS-1$ //$NON-NLS-2$ + } + + /** + * @generated + */ + private String getUnresolvedDomainElementProxyText(View view) { + return "<Unresolved domain element Visual_ID = " + view.getType() + ">"; //$NON-NLS-1$ //$NON-NLS-2$ + } + + /** + * @generated + */ + public void init(ICommonContentExtensionSite aConfig) { + } + + /** + * @generated + */ + public void restoreState(IMemento aMemento) { + } + + /** + * @generated + */ + public void saveState(IMemento aMemento) { + } + + /** + * @generated + */ + public String getDescription(Object anElement) { + return null; + } + + /** + * @generated + */ + private boolean isOwnView(View view) { + return ModelEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(view)); + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/navigator/UMLNavigatorLinkHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/navigator/UMLNavigatorLinkHelper.java index 4d0fbf340e9..4141ce65c06 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/navigator/UMLNavigatorLinkHelper.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/navigator/UMLNavigatorLinkHelper.java @@ -1,110 +1,110 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.navigator;
-
-import org.eclipse.emf.common.ui.URIEditorInput;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.navigator.ILinkHelper;
-import org.eclipse.ui.part.FileEditorInput;
-
-/**
- * @generated
- */
-public class UMLNavigatorLinkHelper implements ILinkHelper {
-
- /**
- * @generated
- */
- private static IEditorInput getEditorInput(Diagram diagram) {
- Resource diagramResource = diagram.eResource();
- for (EObject nextEObject : diagramResource.getContents()) {
- if (nextEObject == diagram) {
- return new FileEditorInput(WorkspaceSynchronizer.getFile(diagramResource));
- }
- if (nextEObject instanceof Diagram) {
- break;
- }
- }
- URI uri = EcoreUtil.getURI(diagram);
- String editorName = uri.lastSegment() + '#' + diagram.eResource().getContents().indexOf(diagram);
- IEditorInput editorInput = new URIEditorInput(uri, editorName);
- return editorInput;
- }
-
- /**
- * @generated
- */
- public IStructuredSelection findSelection(IEditorInput anInput) {
- return StructuredSelection.EMPTY;
- }
-
- /**
- * @generated
- */
- public void activateEditor(IWorkbenchPage aPage, IStructuredSelection aSelection) {
- if (aSelection == null || aSelection.isEmpty()) {
- return;
- }
- if (false == aSelection.getFirstElement() instanceof UMLAbstractNavigatorItem) {
- return;
- }
-
- UMLAbstractNavigatorItem abstractNavigatorItem = (UMLAbstractNavigatorItem) aSelection.getFirstElement();
- View navigatorView = null;
- if (abstractNavigatorItem instanceof UMLNavigatorItem) {
- navigatorView = ((UMLNavigatorItem) abstractNavigatorItem).getView();
- } else if (abstractNavigatorItem instanceof UMLNavigatorGroup) {
- UMLNavigatorGroup navigatorGroup = (UMLNavigatorGroup) abstractNavigatorItem;
- if (navigatorGroup.getParent() instanceof UMLNavigatorItem) {
- navigatorView = ((UMLNavigatorItem) navigatorGroup.getParent()).getView();
- }
- }
- if (navigatorView == null) {
- return;
- }
- IEditorInput editorInput = getEditorInput(navigatorView.getDiagram());
- IEditorPart editor = aPage.findEditor(editorInput);
- if (editor == null) {
- return;
- }
- aPage.bringToTop(editor);
- if (editor instanceof DiagramEditor) {
- DiagramEditor diagramEditor = (DiagramEditor) editor;
- ResourceSet diagramEditorResourceSet = diagramEditor.getEditingDomain().getResourceSet();
- EObject selectedView = diagramEditorResourceSet.getEObject(EcoreUtil.getURI(navigatorView), true);
- if (selectedView == null) {
- return;
- }
- GraphicalViewer graphicalViewer = (GraphicalViewer) diagramEditor.getAdapter(GraphicalViewer.class);
- EditPart selectedEditPart = (EditPart) graphicalViewer.getEditPartRegistry().get(selectedView);
- if (selectedEditPart != null) {
- graphicalViewer.select(selectedEditPart);
- }
- }
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.navigator; + +import org.eclipse.emf.common.ui.URIEditorInput; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.emf.workspace.util.WorkspaceSynchronizer; +import org.eclipse.gef.EditPart; +import org.eclipse.gef.GraphicalViewer; +import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor; +import org.eclipse.gmf.runtime.notation.Diagram; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.navigator.ILinkHelper; +import org.eclipse.ui.part.FileEditorInput; + +/** + * @generated + */ +public class UMLNavigatorLinkHelper implements ILinkHelper { + + /** + * @generated + */ + private static IEditorInput getEditorInput(Diagram diagram) { + Resource diagramResource = diagram.eResource(); + for (EObject nextEObject : diagramResource.getContents()) { + if (nextEObject == diagram) { + return new FileEditorInput(WorkspaceSynchronizer.getFile(diagramResource)); + } + if (nextEObject instanceof Diagram) { + break; + } + } + URI uri = EcoreUtil.getURI(diagram); + String editorName = uri.lastSegment() + '#' + diagram.eResource().getContents().indexOf(diagram); + IEditorInput editorInput = new URIEditorInput(uri, editorName); + return editorInput; + } + + /** + * @generated + */ + public IStructuredSelection findSelection(IEditorInput anInput) { + return StructuredSelection.EMPTY; + } + + /** + * @generated + */ + public void activateEditor(IWorkbenchPage aPage, IStructuredSelection aSelection) { + if (aSelection == null || aSelection.isEmpty()) { + return; + } + if (false == aSelection.getFirstElement() instanceof UMLAbstractNavigatorItem) { + return; + } + + UMLAbstractNavigatorItem abstractNavigatorItem = (UMLAbstractNavigatorItem) aSelection.getFirstElement(); + View navigatorView = null; + if (abstractNavigatorItem instanceof UMLNavigatorItem) { + navigatorView = ((UMLNavigatorItem) abstractNavigatorItem).getView(); + } else if (abstractNavigatorItem instanceof UMLNavigatorGroup) { + UMLNavigatorGroup navigatorGroup = (UMLNavigatorGroup) abstractNavigatorItem; + if (navigatorGroup.getParent() instanceof UMLNavigatorItem) { + navigatorView = ((UMLNavigatorItem) navigatorGroup.getParent()).getView(); + } + } + if (navigatorView == null) { + return; + } + IEditorInput editorInput = getEditorInput(navigatorView.getDiagram()); + IEditorPart editor = aPage.findEditor(editorInput); + if (editor == null) { + return; + } + aPage.bringToTop(editor); + if (editor instanceof DiagramEditor) { + DiagramEditor diagramEditor = (DiagramEditor) editor; + ResourceSet diagramEditorResourceSet = diagramEditor.getEditingDomain().getResourceSet(); + EObject selectedView = diagramEditorResourceSet.getEObject(EcoreUtil.getURI(navigatorView), true); + if (selectedView == null) { + return; + } + GraphicalViewer graphicalViewer = (GraphicalViewer) diagramEditor.getAdapter(GraphicalViewer.class); + EditPart selectedEditPart = (EditPart) graphicalViewer.getEditPartRegistry().get(selectedView); + if (selectedEditPart != null) { + graphicalViewer.select(selectedEditPart); + } + } + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/navigator/UMLNavigatorSorter.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/navigator/UMLNavigatorSorter.java index 30ae48161c5..acbeeae9a0a 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/navigator/UMLNavigatorSorter.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/navigator/UMLNavigatorSorter.java @@ -1,38 +1,38 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.navigator;
-
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry;
-
-/**
- * @generated
- */
-public class UMLNavigatorSorter extends ViewerSorter {
-
- /**
- * @generated
- */
- private static final int GROUP_CATEGORY = 8015;
-
- /**
- * @generated
- */
- public int category(Object element) {
- if (element instanceof UMLNavigatorItem) {
- UMLNavigatorItem item = (UMLNavigatorItem) element;
- return UMLVisualIDRegistry.getVisualID(item.getView()).hashCode();
- }
- return GROUP_CATEGORY;
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.navigator; + +import org.eclipse.jface.viewers.ViewerSorter; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry; + +/** + * @generated + */ +public class UMLNavigatorSorter extends ViewerSorter { + + /** + * @generated + */ + private static final int GROUP_CATEGORY = 8015; + + /** + * @generated + */ + public int category(Object element) { + if (element instanceof UMLNavigatorItem) { + UMLNavigatorItem item = (UMLNavigatorItem) element; + return UMLVisualIDRegistry.getVisualID(item.getView()).hashCode(); + } + return GROUP_CATEGORY; + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/parsers/AbstractParser.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/parsers/AbstractParser.java index 663b3700530..f5b29e4ea0d 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/parsers/AbstractParser.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/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.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/parsers/MessageFormatParser.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/parsers/MessageFormatParser.java index 57832e16a76..f1d40ff9964 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/parsers/MessageFormatParser.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/parsers/MessageFormatParser.java @@ -1,254 +1,254 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.parsers;
-
-import java.text.FieldPosition;
-import java.text.MessageFormat;
-import java.text.ParsePosition;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.papyrus.infra.core.resource.ModelSet;
-import org.eclipse.papyrus.infra.emf.gmf.command.EMFtoGMFCommandWrapper;
-import org.eclipse.papyrus.infra.gmfdiag.common.parsers.AbstractElementTypeBasedAttributeParser;
-import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.parsers.AbstractAttributeParser;
-import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.parsers.AbstractFeatureParser;
-import org.eclipse.papyrus.infra.internationalization.common.utils.InternationalizationPreferencesUtils;
-import org.eclipse.papyrus.uml.diagram.communication.part.Messages;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.uml.internationalization.utils.utils.UMLLabelInternationalization;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * @generated
- */
-public class MessageFormatParser extends AbstractElementTypeBasedAttributeParser {
-
- /**
- * @generated
- */
- private String defaultPattern;
- /**
- * @generated
- */
- private String defaultEditablePattern;
-
- /**
- * @generated
- */
- private MessageFormat viewProcessor;
-
- /**
- * @generated
- */
- private MessageFormat editorProcessor;
-
- /**
- * @generated
- */
- private MessageFormat editProcessor;
-
- /**
- * @generated
- */
- public MessageFormatParser(EAttribute[] features) {
- super(features);
- }
-
- /**
- * @generated
- */
- public MessageFormatParser(EAttribute[] features, EAttribute[] editableFeatures) {
- super(features, editableFeatures);
- }
-
- /**
- * @generated
- */
- protected String getDefaultPattern() {
- if (defaultPattern == null) {
- StringBuffer sb = new StringBuffer();
- for (int i = 0; i < features.length; i++) {
- if (i > 0) {
- sb.append(' ');
- }
- sb.append('{');
- sb.append(i);
- sb.append('}');
- }
- defaultPattern = sb.toString();
- }
- return defaultPattern;
- }
-
- /**
- * @generated
- */
- public void setViewPattern(String viewPattern) {
- super.setViewPattern(viewPattern);
- viewProcessor = null;
- }
-
- /**
- * @generated
- */
- public void setEditorPattern(String editorPattern) {
- super.setEditorPattern(editorPattern);
- editorProcessor = null;
- }
-
- /**
- * @generated
- */
- protected MessageFormat getViewProcessor() {
- if (viewProcessor == null) {
- viewProcessor = new MessageFormat(getViewPattern() == null ? getDefaultPattern() : getViewPattern());
- }
- return viewProcessor;
- }
-
- /**
- * @generated
- */
- protected MessageFormat getEditorProcessor() {
- if (editorProcessor == null) {
- editorProcessor = new MessageFormat(getEditorPattern() == null ? getDefaultEditablePattern() : getEditorPattern());
- }
- return editorProcessor;
- }
-
- /**
- * @generated
- */
- protected String getDefaultEditablePattern() {
- if (defaultEditablePattern == null) {
- StringBuffer sb = new StringBuffer();
- for (int i = 0; i < editableFeatures.length; i++) {
- if (i > 0) {
- sb.append(' ');
- }
- sb.append('{');
- sb.append(i);
- sb.append('}');
- }
- defaultEditablePattern = sb.toString();
- }
- return defaultEditablePattern;
- }
-
- /**
- * @generated
- */
- public void setEditPattern(String editPattern) {
- super.setEditPattern(editPattern);
- editProcessor = null;
- }
-
- /**
- * @generated
- */
- protected MessageFormat getEditProcessor() {
- if (editProcessor == null) {
- editProcessor = new MessageFormat(getEditPattern() == null ? getDefaultEditablePattern() : getEditPattern());
- }
- return editProcessor;
- }
-
- /**
- * @generated
- */
- public String getEditString(IAdaptable adapter, int flags) {
- EObject element = (EObject) adapter.getAdapter(EObject.class);
- return getEditorProcessor().format(getEditableValues(element), new StringBuffer(), new FieldPosition(0)).toString();
- }
-
- /**
- * @generated
- */
- public IParserEditStatus isValidEditString(IAdaptable adapter, String editString) {
- ParsePosition pos = new ParsePosition(0);
- Object[] values = getEditProcessor().parse(editString, pos);
- if (values == null) {
- return new ParserEditStatus(
- UMLDiagramEditorPlugin.ID,
- IParserEditStatus.UNEDITABLE,
- NLS.bind(
- Messages.MessageFormatParser_InvalidInputError,
- new Integer(pos.getErrorIndex())));
- }
- return validateNewValues(values);
- }
-
- /**
- * @generated
- */
- public ICommand getParseCommand(IAdaptable adapter, String newString, int flags) {
- Object[] values = getEditProcessor().parse(newString, new ParsePosition(0));
- return getParseCommand(adapter, values, flags);
- }
-
- /**
- * @generated
- */
- public String getPrintString(IAdaptable adapter, int flags) {
- EObject element = (EObject) adapter.getAdapter(EObject.class);
- return getViewProcessor().format(getValues(element), new StringBuffer(), new FieldPosition(0)).toString();
- }
-
- /**
- * @generated
- * {@inheritDoc}
- * @see AbstractFeatureParser#getModificationCommand(EObject, EStructuralFeature, java.lang.Object)
- */
- @Override
- protected ICommand getModificationCommand(final EObject element, final EStructuralFeature feature,
- final Object value) {
- ICommand result = null;
-
- // If the feature to edit is the name, check that this is not really the internationalization to edit and not the name
- if (feature.equals(UMLPackage.eINSTANCE.getNamedElement_Name())) {
- if (InternationalizationPreferencesUtils.getInternationalizationPreference(element) && null != UMLLabelInternationalization.getInstance().getLabelWithoutUML((NamedElement) element)) {
- final ModelSet modelSet = (ModelSet) element.eResource().getResourceSet();
- if (null != modelSet) {
- result = new EMFtoGMFCommandWrapper(UMLLabelInternationalization.getInstance().getSetLabelCommand(modelSet.getTransactionalEditingDomain(), (NamedElement) element, (String) value, null));
- }
- }
- }
-
- return null != result ? result : super.getModificationCommand(element, feature, value);
- }
-
- /**
- * @generated
- * {@inheritDoc}
- * @see AbstractAttributeParser#getValue(EObject, EStructuralFeature)
- */
- @Override
- protected Object getValue(final EObject element, final EStructuralFeature feature) {
- Object result = null;
-
- if (element instanceof NamedElement && feature.equals(UMLPackage.eINSTANCE.getNamedElement_Name())) {
- if (InternationalizationPreferencesUtils.getInternationalizationPreference(element) && null != UMLLabelInternationalization.getInstance().getLabelWithoutUML((NamedElement) element)) {
- result = UMLLabelInternationalization.getInstance().getLabelWithoutUML((NamedElement) element);
- }
- }
-
- return null != result ? result : super.getValue(element, feature);
- }
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.parsers; + +import java.text.FieldPosition; +import java.text.MessageFormat; +import java.text.ParsePosition; + +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.gmf.runtime.common.core.command.ICommand; +import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus; +import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus; +import org.eclipse.osgi.util.NLS; +import org.eclipse.papyrus.infra.core.resource.ModelSet; +import org.eclipse.papyrus.infra.emf.gmf.command.EMFtoGMFCommandWrapper; +import org.eclipse.papyrus.infra.gmfdiag.common.parsers.AbstractElementTypeBasedAttributeParser; +import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.parsers.AbstractAttributeParser; +import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.parsers.AbstractFeatureParser; +import org.eclipse.papyrus.infra.internationalization.common.utils.InternationalizationPreferencesUtils; +import org.eclipse.papyrus.uml.diagram.communication.part.Messages; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditorPlugin; +import org.eclipse.papyrus.uml.internationalization.utils.utils.UMLLabelInternationalization; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.UMLPackage; + +/** + * @generated + */ +public class MessageFormatParser extends AbstractElementTypeBasedAttributeParser { + + /** + * @generated + */ + private String defaultPattern; + /** + * @generated + */ + private String defaultEditablePattern; + + /** + * @generated + */ + private MessageFormat viewProcessor; + + /** + * @generated + */ + private MessageFormat editorProcessor; + + /** + * @generated + */ + private MessageFormat editProcessor; + + /** + * @generated + */ + public MessageFormatParser(EAttribute[] features) { + super(features); + } + + /** + * @generated + */ + public MessageFormatParser(EAttribute[] features, EAttribute[] editableFeatures) { + super(features, editableFeatures); + } + + /** + * @generated + */ + protected String getDefaultPattern() { + if (defaultPattern == null) { + StringBuffer sb = new StringBuffer(); + for (int i = 0; i < features.length; i++) { + if (i > 0) { + sb.append(' '); + } + sb.append('{'); + sb.append(i); + sb.append('}'); + } + defaultPattern = sb.toString(); + } + return defaultPattern; + } + + /** + * @generated + */ + public void setViewPattern(String viewPattern) { + super.setViewPattern(viewPattern); + viewProcessor = null; + } + + /** + * @generated + */ + public void setEditorPattern(String editorPattern) { + super.setEditorPattern(editorPattern); + editorProcessor = null; + } + + /** + * @generated + */ + protected MessageFormat getViewProcessor() { + if (viewProcessor == null) { + viewProcessor = new MessageFormat(getViewPattern() == null ? getDefaultPattern() : getViewPattern()); + } + return viewProcessor; + } + + /** + * @generated + */ + protected MessageFormat getEditorProcessor() { + if (editorProcessor == null) { + editorProcessor = new MessageFormat(getEditorPattern() == null ? getDefaultEditablePattern() : getEditorPattern()); + } + return editorProcessor; + } + + /** + * @generated + */ + protected String getDefaultEditablePattern() { + if (defaultEditablePattern == null) { + StringBuffer sb = new StringBuffer(); + for (int i = 0; i < editableFeatures.length; i++) { + if (i > 0) { + sb.append(' '); + } + sb.append('{'); + sb.append(i); + sb.append('}'); + } + defaultEditablePattern = sb.toString(); + } + return defaultEditablePattern; + } + + /** + * @generated + */ + public void setEditPattern(String editPattern) { + super.setEditPattern(editPattern); + editProcessor = null; + } + + /** + * @generated + */ + protected MessageFormat getEditProcessor() { + if (editProcessor == null) { + editProcessor = new MessageFormat(getEditPattern() == null ? getDefaultEditablePattern() : getEditPattern()); + } + return editProcessor; + } + + /** + * @generated + */ + public String getEditString(IAdaptable adapter, int flags) { + EObject element = (EObject) adapter.getAdapter(EObject.class); + return getEditorProcessor().format(getEditableValues(element), new StringBuffer(), new FieldPosition(0)).toString(); + } + + /** + * @generated + */ + public IParserEditStatus isValidEditString(IAdaptable adapter, String editString) { + ParsePosition pos = new ParsePosition(0); + Object[] values = getEditProcessor().parse(editString, pos); + if (values == null) { + return new ParserEditStatus( + UMLDiagramEditorPlugin.ID, + IParserEditStatus.UNEDITABLE, + NLS.bind( + Messages.MessageFormatParser_InvalidInputError, + new Integer(pos.getErrorIndex()))); + } + return validateNewValues(values); + } + + /** + * @generated + */ + public ICommand getParseCommand(IAdaptable adapter, String newString, int flags) { + Object[] values = getEditProcessor().parse(newString, new ParsePosition(0)); + return getParseCommand(adapter, values, flags); + } + + /** + * @generated + */ + public String getPrintString(IAdaptable adapter, int flags) { + EObject element = (EObject) adapter.getAdapter(EObject.class); + return getViewProcessor().format(getValues(element), new StringBuffer(), new FieldPosition(0)).toString(); + } + + /** + * @generated + * {@inheritDoc} + * @see AbstractFeatureParser#getModificationCommand(EObject, EStructuralFeature, java.lang.Object) + */ + @Override + protected ICommand getModificationCommand(final EObject element, final EStructuralFeature feature, + final Object value) { + ICommand result = null; + + // If the feature to edit is the name, check that this is not really the internationalization to edit and not the name + if (feature.equals(UMLPackage.eINSTANCE.getNamedElement_Name())) { + if (InternationalizationPreferencesUtils.getInternationalizationPreference(element) && null != UMLLabelInternationalization.getInstance().getLabelWithoutUML((NamedElement) element)) { + final ModelSet modelSet = (ModelSet) element.eResource().getResourceSet(); + if (null != modelSet) { + result = new EMFtoGMFCommandWrapper(UMLLabelInternationalization.getInstance().getSetLabelCommand(modelSet.getTransactionalEditingDomain(), (NamedElement) element, (String) value, null)); + } + } + } + + return null != result ? result : super.getModificationCommand(element, feature, value); + } + + /** + * @generated + * {@inheritDoc} + * @see AbstractAttributeParser#getValue(EObject, EStructuralFeature) + */ + @Override + protected Object getValue(final EObject element, final EStructuralFeature feature) { + Object result = null; + + if (element instanceof NamedElement && feature.equals(UMLPackage.eINSTANCE.getNamedElement_Name())) { + if (InternationalizationPreferencesUtils.getInternationalizationPreference(element) && null != UMLLabelInternationalization.getInstance().getLabelWithoutUML((NamedElement) element)) { + result = UMLLabelInternationalization.getInstance().getLabelWithoutUML((NamedElement) element); + } + } + + return null != result ? result : super.getValue(element, feature); + } +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/DiagramEditorContextMenuProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/DiagramEditorContextMenuProvider.java index 20cb0aa7ad9..3ad805ee3a8 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/DiagramEditorContextMenuProvider.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/DiagramEditorContextMenuProvider.java @@ -1,61 +1,61 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.part;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gmf.runtime.common.ui.services.action.contributionitem.ContributionItemService;
-import org.eclipse.gmf.runtime.diagram.ui.actions.ActionIds;
-import org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * @generated
- */
-public class DiagramEditorContextMenuProvider extends DiagramContextMenuProvider {
-
- /**
- * @generated
- */
- private IWorkbenchPart part;
-
- /**
- * @generated
- */
- public DiagramEditorContextMenuProvider(IWorkbenchPart part, EditPartViewer viewer) {
- super(part, viewer);
- this.part = part;
- }
-
- /**
- * @generated
- */
- public void buildContextMenu(final IMenuManager menu) {
- getViewer().flush();
- try {
- TransactionUtil.getEditingDomain(
- (EObject) getViewer().getContents().getModel()).runExclusive(new Runnable() {
-
- @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);
- }
- }
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.part; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.transaction.util.TransactionUtil; +import org.eclipse.gef.EditPartViewer; +import org.eclipse.gmf.runtime.common.ui.services.action.contributionitem.ContributionItemService; +import org.eclipse.gmf.runtime.diagram.ui.actions.ActionIds; +import org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider; +import org.eclipse.jface.action.IMenuManager; +import org.eclipse.ui.IWorkbenchPart; + +/** + * @generated + */ +public class DiagramEditorContextMenuProvider extends DiagramContextMenuProvider { + + /** + * @generated + */ + private IWorkbenchPart part; + + /** + * @generated + */ + public DiagramEditorContextMenuProvider(IWorkbenchPart part, EditPartViewer viewer) { + super(part, viewer); + this.part = part; + } + + /** + * @generated + */ + public void buildContextMenu(final IMenuManager menu) { + getViewer().flush(); + try { + TransactionUtil.getEditingDomain( + (EObject) getViewer().getContents().getModel()).runExclusive(new Runnable() { + + @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.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/Messages.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/Messages.java index e2e24c4590f..f977850147f 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/Messages.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/Messages.java @@ -1,375 +1,375 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.part;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * @generated
- */
-public class Messages extends NLS {
-
- /**
- * @generated
- */
- static {
- NLS.initializeMessages("messages", Messages.class); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- private Messages() {
- }
-
- /**
- * @generated
- */
- public static String UMLCreationWizardTitle;
-
- /**
- * @generated
- */
- public static String UMLCreationWizard_DiagramModelFilePageTitle;
-
- /**
- * @generated
- */
- public static String UMLCreationWizard_DiagramModelFilePageDescription;
-
- /**
- * @generated
- */
- public static String UMLCreationWizard_DomainModelFilePageTitle;
-
- /**
- * @generated
- */
- public static String UMLCreationWizard_DomainModelFilePageDescription;
-
- /**
- * @generated
- */
- public static String UMLCreationWizardOpenEditorError;
-
- /**
- * @generated
- */
- public static String UMLCreationWizardCreationError;
-
- /**
- * @generated
- */
- public static String UMLCreationWizardPageExtensionError;
-
- /**
- * @generated
- */
- public static String UMLDiagramEditorUtil_OpenModelResourceErrorDialogTitle;
-
- /**
- * @generated
- */
- public static String UMLDiagramEditorUtil_OpenModelResourceErrorDialogMessage;
-
- /**
- * @generated
- */
- public static String UMLDiagramEditorUtil_CreateDiagramProgressTask;
-
- /**
- * @generated
- */
- public static String UMLDiagramEditorUtil_CreateDiagramCommandLabel;
-
- /**
- * @generated
- */
- public static String UMLDocumentProvider_isModifiable;
-
- /**
- * @generated
- */
- public static String UMLDocumentProvider_handleElementContentChanged;
-
- /**
- * @generated
- */
- public static String UMLDocumentProvider_IncorrectInputError;
-
- /**
- * @generated
- */
- public static String UMLDocumentProvider_NoDiagramInResourceError;
-
- /**
- * @generated
- */
- public static String UMLDocumentProvider_DiagramLoadingError;
-
- /**
- * @generated
- */
- public static String UMLDocumentProvider_UnsynchronizedFileSaveError;
-
- /**
- * @generated
- */
- public static String UMLDocumentProvider_SaveDiagramTask;
-
- /**
- * @generated
- */
- public static String UMLDocumentProvider_SaveNextResourceTask;
-
- /**
- * @generated
- */
- public static String UMLDocumentProvider_SaveAsOperation;
-
- /**
- * @generated
- */
- public static String InitDiagramFile_ResourceErrorDialogTitle;
-
- /**
- * @generated
- */
- public static String InitDiagramFile_ResourceErrorDialogMessage;
-
- /**
- * @generated
- */
- public static String InitDiagramFile_WizardTitle;
-
- /**
- * @generated
- */
- public static String InitDiagramFile_OpenModelFileDialogTitle;
-
- /**
- * @generated
- */
- public static String UMLNewDiagramFileWizard_CreationPageName;
-
- /**
- * @generated
- */
- public static String UMLNewDiagramFileWizard_CreationPageTitle;
-
- /**
- * @generated
- */
- public static String UMLNewDiagramFileWizard_CreationPageDescription;
-
- /**
- * @generated
- */
- public static String UMLNewDiagramFileWizard_RootSelectionPageName;
-
- /**
- * @generated
- */
- public static String UMLNewDiagramFileWizard_RootSelectionPageTitle;
-
- /**
- * @generated
- */
- public static String UMLNewDiagramFileWizard_RootSelectionPageDescription;
-
- /**
- * @generated
- */
- public static String UMLNewDiagramFileWizard_RootSelectionPageSelectionTitle;
-
- /**
- * @generated
- */
- public static String UMLNewDiagramFileWizard_RootSelectionPageNoSelectionMessage;
-
- /**
- * @generated
- */
- public static String UMLNewDiagramFileWizard_RootSelectionPageInvalidSelectionMessage;
-
- /**
- * @generated
- */
- public static String UMLNewDiagramFileWizard_InitDiagramCommand;
-
- /**
- * @generated
- */
- public static String UMLNewDiagramFileWizard_IncorrectRootError;
-
- /**
- * @generated
- */
- public static String UMLDiagramEditor_SavingDeletedFile;
-
- /**
- * @generated
- */
- public static String UMLDiagramEditor_SaveAsErrorTitle;
-
- /**
- * @generated
- */
- public static String UMLDiagramEditor_SaveAsErrorMessage;
-
- /**
- * @generated
- */
- public static String UMLDiagramEditor_SaveErrorTitle;
-
- /**
- * @generated
- */
- public static String UMLDiagramEditor_SaveErrorMessage;
-
- /**
- * @generated
- */
- public static String UMLElementChooserDialog_SelectModelElementTitle;
-
- /**
- * @generated
- */
- public static String ModelElementSelectionPageMessage;
-
- /**
- * @generated
- */
- public static String ValidateActionMessage;
-
- /**
- * @generated
- */
- public static String Nodes1Group_title;
-
- /**
- * @generated
- */
- public static String Nodes1Group_desc;
-
- /**
- * @generated
- */
- public static String Edges2Group_title;
-
- /**
- * @generated
- */
- public static String Edges2Group_desc;
-
- /**
- * @generated
- */
- public static String LifelineComCreationTool_title;
-
- /**
- * @generated
- */
- public static String LifelineComCreationTool_desc;
-
- /**
- * @generated
- */
- public static String Comment7CreationTool_title;
-
- /**
- * @generated
- */
- public static String Comment7CreationTool_desc;
-
- /**
- * @generated
- */
- public static String Constraint5CreationTool_title;
-
- /**
- * @generated
- */
- public static String Constraint5CreationTool_desc;
-
- /**
- * @generated
- */
- public static String DurationObservation4CreationTool_title;
-
- /**
- * @generated
- */
- public static String DurationObservation4CreationTool_desc;
-
- /**
- * @generated
- */
- public static String TimeObservation6CreationTool_title;
-
- /**
- * @generated
- */
- public static String TimeObservation6CreationTool_desc;
-
- /**
- * @generated
- */
- public static String MessageCreateCreationTool_title;
-
- /**
- * @generated
- */
- public static String MessageCreateCreationTool_desc;
-
- /**
- * @generated
- */
- public static String Link13CreationTool_title;
-
- /**
- * @generated
- */
- public static String Link13CreationTool_desc;
-
- /**
- * @generated
- */
- public static String InteractionCompartmentEditPart_title;
-
- /**
- * @generated
- */
- public static String CommandName_OpenDiagram;
-
- /**
- * @generated
- */
- public static String NavigatorActionProvider_OpenDiagramActionName;
-
- /**
- * @generated
- */
- public static String MessageFormatParser_InvalidInputError;
-
- /**
- * @generated
- */
- public static String UMLModelingAssistantProviderTitle;
-
- /**
- * @generated
- */
- public static String UMLModelingAssistantProviderMessage;
-
- //TODO: put accessor fields manually
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.part; + +import org.eclipse.osgi.util.NLS; + +/** + * @generated + */ +public class Messages extends NLS { + + /** + * @generated + */ + static { + NLS.initializeMessages("messages", Messages.class); //$NON-NLS-1$ + } + + /** + * @generated + */ + private Messages() { + } + + /** + * @generated + */ + public static String UMLCreationWizardTitle; + + /** + * @generated + */ + public static String UMLCreationWizard_DiagramModelFilePageTitle; + + /** + * @generated + */ + public static String UMLCreationWizard_DiagramModelFilePageDescription; + + /** + * @generated + */ + public static String UMLCreationWizard_DomainModelFilePageTitle; + + /** + * @generated + */ + public static String UMLCreationWizard_DomainModelFilePageDescription; + + /** + * @generated + */ + public static String UMLCreationWizardOpenEditorError; + + /** + * @generated + */ + public static String UMLCreationWizardCreationError; + + /** + * @generated + */ + public static String UMLCreationWizardPageExtensionError; + + /** + * @generated + */ + public static String UMLDiagramEditorUtil_OpenModelResourceErrorDialogTitle; + + /** + * @generated + */ + public static String UMLDiagramEditorUtil_OpenModelResourceErrorDialogMessage; + + /** + * @generated + */ + public static String UMLDiagramEditorUtil_CreateDiagramProgressTask; + + /** + * @generated + */ + public static String UMLDiagramEditorUtil_CreateDiagramCommandLabel; + + /** + * @generated + */ + public static String UMLDocumentProvider_isModifiable; + + /** + * @generated + */ + public static String UMLDocumentProvider_handleElementContentChanged; + + /** + * @generated + */ + public static String UMLDocumentProvider_IncorrectInputError; + + /** + * @generated + */ + public static String UMLDocumentProvider_NoDiagramInResourceError; + + /** + * @generated + */ + public static String UMLDocumentProvider_DiagramLoadingError; + + /** + * @generated + */ + public static String UMLDocumentProvider_UnsynchronizedFileSaveError; + + /** + * @generated + */ + public static String UMLDocumentProvider_SaveDiagramTask; + + /** + * @generated + */ + public static String UMLDocumentProvider_SaveNextResourceTask; + + /** + * @generated + */ + public static String UMLDocumentProvider_SaveAsOperation; + + /** + * @generated + */ + public static String InitDiagramFile_ResourceErrorDialogTitle; + + /** + * @generated + */ + public static String InitDiagramFile_ResourceErrorDialogMessage; + + /** + * @generated + */ + public static String InitDiagramFile_WizardTitle; + + /** + * @generated + */ + public static String InitDiagramFile_OpenModelFileDialogTitle; + + /** + * @generated + */ + public static String UMLNewDiagramFileWizard_CreationPageName; + + /** + * @generated + */ + public static String UMLNewDiagramFileWizard_CreationPageTitle; + + /** + * @generated + */ + public static String UMLNewDiagramFileWizard_CreationPageDescription; + + /** + * @generated + */ + public static String UMLNewDiagramFileWizard_RootSelectionPageName; + + /** + * @generated + */ + public static String UMLNewDiagramFileWizard_RootSelectionPageTitle; + + /** + * @generated + */ + public static String UMLNewDiagramFileWizard_RootSelectionPageDescription; + + /** + * @generated + */ + public static String UMLNewDiagramFileWizard_RootSelectionPageSelectionTitle; + + /** + * @generated + */ + public static String UMLNewDiagramFileWizard_RootSelectionPageNoSelectionMessage; + + /** + * @generated + */ + public static String UMLNewDiagramFileWizard_RootSelectionPageInvalidSelectionMessage; + + /** + * @generated + */ + public static String UMLNewDiagramFileWizard_InitDiagramCommand; + + /** + * @generated + */ + public static String UMLNewDiagramFileWizard_IncorrectRootError; + + /** + * @generated + */ + public static String UMLDiagramEditor_SavingDeletedFile; + + /** + * @generated + */ + public static String UMLDiagramEditor_SaveAsErrorTitle; + + /** + * @generated + */ + public static String UMLDiagramEditor_SaveAsErrorMessage; + + /** + * @generated + */ + public static String UMLDiagramEditor_SaveErrorTitle; + + /** + * @generated + */ + public static String UMLDiagramEditor_SaveErrorMessage; + + /** + * @generated + */ + public static String UMLElementChooserDialog_SelectModelElementTitle; + + /** + * @generated + */ + public static String ModelElementSelectionPageMessage; + + /** + * @generated + */ + public static String ValidateActionMessage; + + /** + * @generated + */ + public static String Nodes1Group_title; + + /** + * @generated + */ + public static String Nodes1Group_desc; + + /** + * @generated + */ + public static String Edges2Group_title; + + /** + * @generated + */ + public static String Edges2Group_desc; + + /** + * @generated + */ + public static String LifelineComCreationTool_title; + + /** + * @generated + */ + public static String LifelineComCreationTool_desc; + + /** + * @generated + */ + public static String Comment7CreationTool_title; + + /** + * @generated + */ + public static String Comment7CreationTool_desc; + + /** + * @generated + */ + public static String Constraint5CreationTool_title; + + /** + * @generated + */ + public static String Constraint5CreationTool_desc; + + /** + * @generated + */ + public static String DurationObservation4CreationTool_title; + + /** + * @generated + */ + public static String DurationObservation4CreationTool_desc; + + /** + * @generated + */ + public static String TimeObservation6CreationTool_title; + + /** + * @generated + */ + public static String TimeObservation6CreationTool_desc; + + /** + * @generated + */ + public static String MessageCreateCreationTool_title; + + /** + * @generated + */ + public static String MessageCreateCreationTool_desc; + + /** + * @generated + */ + public static String Link13CreationTool_title; + + /** + * @generated + */ + public static String Link13CreationTool_desc; + + /** + * @generated + */ + public static String InteractionCompartmentEditPart_title; + + /** + * @generated + */ + public static String CommandName_OpenDiagram; + + /** + * @generated + */ + public static String NavigatorActionProvider_OpenDiagramActionName; + + /** + * @generated + */ + public static String MessageFormatParser_InvalidInputError; + + /** + * @generated + */ + public static String UMLModelingAssistantProviderTitle; + + /** + * @generated + */ + public static String UMLModelingAssistantProviderMessage; + + //TODO: put accessor fields manually +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/ModelElementSelectionPage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/ModelElementSelectionPage.java index 48c0d7bc67d..f81b88a2e50 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/ModelElementSelectionPage.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/ModelElementSelectionPage.java @@ -1,37 +1,37 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.part;
-
-import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.part.DefaultModelElementSelectionPage;
-
-/**
- * Wizard page that allows to select element from model.
- * @generated
- */
-public class ModelElementSelectionPage extends DefaultModelElementSelectionPage {
-
- /**
- * @generated
- */
- public ModelElementSelectionPage(String pageName) {
- super(UMLDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory(), pageName);
- }
-
- /**
- * Override to provide custom model element description.
- * @generated
- */
- protected String getSelectionTitle() {
- return Messages.ModelElementSelectionPageMessage;
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.part; + +import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.part.DefaultModelElementSelectionPage; + +/** + * Wizard page that allows to select element from model. + * @generated + */ +public class ModelElementSelectionPage extends DefaultModelElementSelectionPage { + + /** + * @generated + */ + public ModelElementSelectionPage(String pageName) { + super(UMLDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory(), pageName); + } + + /** + * Override to provide custom model element description. + * @generated + */ + protected String getSelectionTitle() { + return Messages.ModelElementSelectionPageMessage; + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLCreationWizard.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLCreationWizard.java index a20aeaaeb2b..0f4520ff238 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLCreationWizard.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLCreationWizard.java @@ -1,178 +1,178 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.part;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.actions.WorkspaceModifyOperation;
-
-/**
- * @generated
- */
-public class UMLCreationWizard extends Wizard implements INewWizard {
-
- /**
- * @generated
- */
- private IWorkbench workbench;
-
- /**
- * @generated
- */
- protected IStructuredSelection selection;
-
- /**
- * @generated
- */
- protected UMLCreationWizardPage diagramModelFilePage;
-
- /**
- * @generated
- */
- protected UMLCreationWizardPage domainModelFilePage;
-
- /**
- * @generated
- */
- protected Resource diagram;
-
- /**
- * @generated
- */
- private boolean openNewlyCreatedDiagramEditor = true;
-
- /**
- * @generated
- */
- public IWorkbench getWorkbench() {
- return workbench;
- }
-
- /**
- * @generated
- */
- public IStructuredSelection getSelection() {
- return selection;
- }
-
- /**
- * @generated
- */
- public final Resource getDiagram() {
- return diagram;
- }
-
- /**
- * @generated
- */
- public final boolean isOpenNewlyCreatedDiagramEditor() {
- return openNewlyCreatedDiagramEditor;
- }
-
- /**
- * @generated
- */
- public void setOpenNewlyCreatedDiagramEditor(boolean openNewlyCreatedDiagramEditor) {
- this.openNewlyCreatedDiagramEditor = openNewlyCreatedDiagramEditor;
- }
-
- /**
- * @generated
- */
- public void init(IWorkbench workbench, IStructuredSelection selection) {
- this.workbench = workbench;
- this.selection = selection;
- setWindowTitle(Messages.UMLCreationWizardTitle);
- setDefaultPageImageDescriptor(UMLDiagramEditorPlugin.getBundledImageDescriptor(
- "icons/wizban/NewUMLWizard.gif")); //$NON-NLS-1$
- setNeedsProgressMonitor(true);
- }
-
- /**
- * @generated
- */
- public void addPages() {
- diagramModelFilePage = new UMLCreationWizardPage(
- "DiagramModelFile", getSelection(), "PapyrusUMLCommunication_diagram"); //$NON-NLS-1$ //$NON-NLS-2$
- diagramModelFilePage.setTitle(Messages.UMLCreationWizard_DiagramModelFilePageTitle);
- diagramModelFilePage.setDescription(Messages.UMLCreationWizard_DiagramModelFilePageDescription);
- addPage(diagramModelFilePage);
-
- domainModelFilePage = new UMLCreationWizardPage(
- "DomainModelFile", getSelection(), "PapyrusUMLCommunication") { //$NON-NLS-1$ //$NON-NLS-2$
-
- @Override
- public void setVisible(boolean visible) {
- if (visible) {
- String fileName = diagramModelFilePage.getFileName();
- fileName = fileName.substring(0, fileName.length() - ".PapyrusUMLCommunication_diagram".length()); //$NON-NLS-1$
- setFileName(UMLDiagramEditorUtil.getUniqueFileName(
- getContainerFullPath(), fileName, "PapyrusUMLCommunication")); //$NON-NLS-1$
- }
- super.setVisible(visible);
- }
- };
- domainModelFilePage.setTitle(Messages.UMLCreationWizard_DomainModelFilePageTitle);
- domainModelFilePage.setDescription(Messages.UMLCreationWizard_DomainModelFilePageDescription);
- addPage(domainModelFilePage);
- }
-
- /**
- * @generated
- */
- public boolean performFinish() {
- 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) {
- try {
- UMLDiagramEditorUtil.openDiagram(diagram);
- } catch (PartInitException e) {
- ErrorDialog.openError(getContainer().getShell(),
- Messages.UMLCreationWizardOpenEditorError, null, e.getStatus());
- }
- }
- }
- };
- try {
- getContainer().run(false, true, op);
- } catch (InterruptedException e) {
- return false;
- } catch (InvocationTargetException e) {
- if (e.getTargetException() instanceof CoreException) {
- ErrorDialog.openError(getContainer().getShell(),
- Messages.UMLCreationWizardCreationError, null,
- ((CoreException) e.getTargetException()).getStatus());
- } else {
- UMLDiagramEditorPlugin.getInstance().logError(
- "Error creating diagram", e.getTargetException()); //$NON-NLS-1$
- }
- return false;
- }
- return diagram != null;
- }
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.part; + +import java.lang.reflect.InvocationTargetException; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.jface.dialogs.ErrorDialog; +import org.eclipse.jface.operation.IRunnableWithProgress; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.wizard.Wizard; +import org.eclipse.ui.INewWizard; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.actions.WorkspaceModifyOperation; + +/** + * @generated + */ +public class UMLCreationWizard extends Wizard implements INewWizard { + + /** + * @generated + */ + private IWorkbench workbench; + + /** + * @generated + */ + protected IStructuredSelection selection; + + /** + * @generated + */ + protected UMLCreationWizardPage diagramModelFilePage; + + /** + * @generated + */ + protected UMLCreationWizardPage domainModelFilePage; + + /** + * @generated + */ + protected Resource diagram; + + /** + * @generated + */ + private boolean openNewlyCreatedDiagramEditor = true; + + /** + * @generated + */ + public IWorkbench getWorkbench() { + return workbench; + } + + /** + * @generated + */ + public IStructuredSelection getSelection() { + return selection; + } + + /** + * @generated + */ + public final Resource getDiagram() { + return diagram; + } + + /** + * @generated + */ + public final boolean isOpenNewlyCreatedDiagramEditor() { + return openNewlyCreatedDiagramEditor; + } + + /** + * @generated + */ + public void setOpenNewlyCreatedDiagramEditor(boolean openNewlyCreatedDiagramEditor) { + this.openNewlyCreatedDiagramEditor = openNewlyCreatedDiagramEditor; + } + + /** + * @generated + */ + public void init(IWorkbench workbench, IStructuredSelection selection) { + this.workbench = workbench; + this.selection = selection; + setWindowTitle(Messages.UMLCreationWizardTitle); + setDefaultPageImageDescriptor(UMLDiagramEditorPlugin.getBundledImageDescriptor( + "icons/wizban/NewUMLWizard.gif")); //$NON-NLS-1$ + setNeedsProgressMonitor(true); + } + + /** + * @generated + */ + public void addPages() { + diagramModelFilePage = new UMLCreationWizardPage( + "DiagramModelFile", getSelection(), "PapyrusUMLCommunication_diagram"); //$NON-NLS-1$ //$NON-NLS-2$ + diagramModelFilePage.setTitle(Messages.UMLCreationWizard_DiagramModelFilePageTitle); + diagramModelFilePage.setDescription(Messages.UMLCreationWizard_DiagramModelFilePageDescription); + addPage(diagramModelFilePage); + + domainModelFilePage = new UMLCreationWizardPage( + "DomainModelFile", getSelection(), "PapyrusUMLCommunication") { //$NON-NLS-1$ //$NON-NLS-2$ + + @Override + public void setVisible(boolean visible) { + if (visible) { + String fileName = diagramModelFilePage.getFileName(); + fileName = fileName.substring(0, fileName.length() - ".PapyrusUMLCommunication_diagram".length()); //$NON-NLS-1$ + setFileName(UMLDiagramEditorUtil.getUniqueFileName( + getContainerFullPath(), fileName, "PapyrusUMLCommunication")); //$NON-NLS-1$ + } + super.setVisible(visible); + } + }; + domainModelFilePage.setTitle(Messages.UMLCreationWizard_DomainModelFilePageTitle); + domainModelFilePage.setDescription(Messages.UMLCreationWizard_DomainModelFilePageDescription); + addPage(domainModelFilePage); + } + + /** + * @generated + */ + public boolean performFinish() { + 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) { + try { + UMLDiagramEditorUtil.openDiagram(diagram); + } catch (PartInitException e) { + ErrorDialog.openError(getContainer().getShell(), + Messages.UMLCreationWizardOpenEditorError, null, e.getStatus()); + } + } + } + }; + try { + getContainer().run(false, true, op); + } catch (InterruptedException e) { + return false; + } catch (InvocationTargetException e) { + if (e.getTargetException() instanceof CoreException) { + ErrorDialog.openError(getContainer().getShell(), + Messages.UMLCreationWizardCreationError, null, + ((CoreException) e.getTargetException()).getStatus()); + } else { + UMLDiagramEditorPlugin.getInstance().logError( + "Error creating diagram", e.getTargetException()); //$NON-NLS-1$ + } + return false; + } + return diagram != null; + } +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLCreationWizardPage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLCreationWizardPage.java index b3aceff7b9e..029d364659b 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLCreationWizardPage.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLCreationWizardPage.java @@ -1,96 +1,96 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.part;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
-
-/**
- * @generated
- */
-public class UMLCreationWizardPage extends WizardNewFileCreationPage {
-
- /**
- * @generated
- */
- private final String fileExtension;
-
- /**
- * @generated
- */
- public UMLCreationWizardPage(String pageName, IStructuredSelection selection, String fileExtension) {
- super(pageName, selection);
- this.fileExtension = fileExtension;
- }
-
- /**
- * Override to create files with this extension.
- *
- * @generated
- */
- protected String getExtension() {
- return fileExtension;
- }
-
- /**
- * @generated
- */
- public URI getURI() {
- return URI.createPlatformResourceURI(getFilePath().toString(), false);
- }
-
- /**
- * @generated
- */
- protected IPath getFilePath() {
- IPath path = getContainerFullPath();
- if (path == null) {
- path = new Path(""); //$NON-NLS-1$
- }
- String fileName = getFileName();
- if (fileName != null) {
- path = path.append(fileName);
- }
- return path;
- }
-
- /**
- * @generated
- */
- public void createControl(Composite parent) {
- super.createControl(parent);
- setFileName(UMLDiagramEditorUtil.getUniqueFileName(
- getContainerFullPath(), getFileName(), getExtension()));
- setPageComplete(validatePage());
- }
-
- /**
- * @generated
- */
- protected boolean validatePage() {
- if (!super.validatePage()) {
- return false;
- }
- String extension = getExtension();
- if (extension != null && !getFilePath().toString().endsWith("." + extension)) {
- setErrorMessage(NLS.bind(
- Messages.UMLCreationWizardPageExtensionError, extension));
- return false;
- }
- return true;
- }
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.part; + +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.Path; +import org.eclipse.emf.common.util.URI; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.osgi.util.NLS; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.ui.dialogs.WizardNewFileCreationPage; + +/** + * @generated + */ +public class UMLCreationWizardPage extends WizardNewFileCreationPage { + + /** + * @generated + */ + private final String fileExtension; + + /** + * @generated + */ + public UMLCreationWizardPage(String pageName, IStructuredSelection selection, String fileExtension) { + super(pageName, selection); + this.fileExtension = fileExtension; + } + + /** + * Override to create files with this extension. + * + * @generated + */ + protected String getExtension() { + return fileExtension; + } + + /** + * @generated + */ + public URI getURI() { + return URI.createPlatformResourceURI(getFilePath().toString(), false); + } + + /** + * @generated + */ + protected IPath getFilePath() { + IPath path = getContainerFullPath(); + if (path == null) { + path = new Path(""); //$NON-NLS-1$ + } + String fileName = getFileName(); + if (fileName != null) { + path = path.append(fileName); + } + return path; + } + + /** + * @generated + */ + public void createControl(Composite parent) { + super.createControl(parent); + setFileName(UMLDiagramEditorUtil.getUniqueFileName( + getContainerFullPath(), getFileName(), getExtension())); + setPageComplete(validatePage()); + } + + /** + * @generated + */ + protected boolean validatePage() { + if (!super.validatePage()) { + return false; + } + String extension = getExtension(); + if (extension != null && !getFilePath().toString().endsWith("." + extension)) { + setErrorMessage(NLS.bind( + Messages.UMLCreationWizardPageExtensionError, extension)); + return false; + } + return true; + } +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLDiagramActionBarContributor.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLDiagramActionBarContributor.java index e6817915d55..8b65031a79c 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLDiagramActionBarContributor.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLDiagramActionBarContributor.java @@ -1,59 +1,59 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.part;
-
-import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramActionBarContributor;
-import org.eclipse.jface.action.GroupMarker;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.IWorkbenchPage;
-
-/**
- * @generated
- */
-public class UMLDiagramActionBarContributor extends DiagramActionBarContributor {
-
- /**
- * @generated
- */
-
- protected Class<UMLDiagramEditor> getEditorClass() {
- return UMLDiagramEditor.class;
- }
-
- /**
- * @generated
- */
- protected String getEditorId() {
- return UMLDiagramEditor.ID;
- }
-
- /**
- * @generated
- */
- public void init(IActionBars bars, IWorkbenchPage page) {
- super.init(bars, page);
- // print preview
- IMenuManager fileMenu = bars.getMenuManager().findMenuUsingPath(IWorkbenchActionConstants.M_FILE);
- assert fileMenu != null;
- fileMenu.remove("pageSetupAction"); //$NON-NLS-1$
- IMenuManager editMenu = bars.getMenuManager().findMenuUsingPath(IWorkbenchActionConstants.M_EDIT);
- assert editMenu != null;
- if (editMenu.find("validationGroup") == null) { //$NON-NLS-1$
- editMenu.add(new GroupMarker("validationGroup")); //$NON-NLS-1$
- }
- IAction validateAction = new ValidateAction(page);
- editMenu.appendToGroup("validationGroup", validateAction); //$NON-NLS-1$
- }
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.part; + +import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramActionBarContributor; +import org.eclipse.jface.action.GroupMarker; +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.action.IMenuManager; +import org.eclipse.ui.IActionBars; +import org.eclipse.ui.IWorkbenchActionConstants; +import org.eclipse.ui.IWorkbenchPage; + +/** + * @generated + */ +public class UMLDiagramActionBarContributor extends DiagramActionBarContributor { + + /** + * @generated + */ + + protected Class<UMLDiagramEditor> getEditorClass() { + return UMLDiagramEditor.class; + } + + /** + * @generated + */ + protected String getEditorId() { + return UMLDiagramEditor.ID; + } + + /** + * @generated + */ + public void init(IActionBars bars, IWorkbenchPage page) { + super.init(bars, page); + // print preview + IMenuManager fileMenu = bars.getMenuManager().findMenuUsingPath(IWorkbenchActionConstants.M_FILE); + assert fileMenu != null; + fileMenu.remove("pageSetupAction"); //$NON-NLS-1$ + IMenuManager editMenu = bars.getMenuManager().findMenuUsingPath(IWorkbenchActionConstants.M_EDIT); + assert editMenu != null; + if (editMenu.find("validationGroup") == null) { //$NON-NLS-1$ + editMenu.add(new GroupMarker("validationGroup")); //$NON-NLS-1$ + } + IAction validateAction = new ValidateAction(page); + editMenu.appendToGroup("validationGroup", validateAction); //$NON-NLS-1$ + } +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLDiagramEditor.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLDiagramEditor.java index 8176848c18a..44b481e963e 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLDiagramEditor.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLDiagramEditor.java @@ -1,569 +1,569 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.part;
-
-import java.util.EventObject;
-
-import org.eclipse.core.commands.operations.IUndoContext;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.gef.KeyHandler;
-import org.eclipse.gef.Tool;
-import org.eclipse.gef.commands.CommandStackListener;
-import org.eclipse.gef.palette.PaletteRoot;
-import org.eclipse.gef.ui.palette.PaletteViewer;
-import org.eclipse.gef.ui.palette.PaletteViewerProvider;
-import org.eclipse.gmf.runtime.common.core.service.IProviderChangeListener;
-import org.eclipse.gmf.runtime.common.core.service.ProviderChangeEvent;
-import org.eclipse.gmf.runtime.common.ui.services.marker.MarkerNavigationService;
-import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
-import org.eclipse.gmf.runtime.diagram.ui.actions.ActionIds;
-import org.eclipse.gmf.runtime.diagram.ui.internal.parts.PaletteToolTransferDragSourceListener;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDocumentProvider;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.jface.util.LocalSelectionTransfer;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.papyrus.commands.util.OperationHistoryDirtyState;
-import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
-import org.eclipse.papyrus.infra.gmfdiag.common.GmfMultiDiagramDocumentProvider;
-import org.eclipse.papyrus.infra.gmfdiag.common.service.palette.PapyrusPaletteContextMenuProvider;
-import org.eclipse.papyrus.infra.gmfdiag.common.service.palette.PapyrusPaletteService;
-import org.eclipse.papyrus.infra.gmfdiag.common.service.palette.PapyrusPaletteViewer;
-import org.eclipse.papyrus.infra.ui.editor.IMultiDiagramEditor;
-import org.eclipse.papyrus.uml.diagram.common.listeners.DropTargetListener;
-import org.eclipse.papyrus.uml.diagram.common.part.UmlGmfDiagramEditor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.dnd.TransferData;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.ide.IGotoMarker;
-import org.eclipse.ui.navigator.resources.ProjectExplorer;
-import org.eclipse.ui.part.IShowInTargetList;
-import org.eclipse.ui.part.ShowInContext;
-import org.eclipse.ui.views.properties.IPropertySheetPage;
-
-/**
- * @generated
- */
-public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderChangeListener, IGotoMarker {
-
- /**
- * @generated
- */
- public static final String ID = "org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditorID"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final String CONTEXT_ID = "org.eclipse.papyrus.uml.diagram.communication.ui.diagramContext"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- private KeyHandler paletteKeyHandler = null;
-
- /**
- * @generated
- */
- private MouseListener paletteMouseListener = null;
-
- /**
- * @generated
- */
- private OperationHistoryDirtyState dirtyState;
-
- /**
- * @generated
- */
- private TransactionalEditingDomain editingDomain;
-
- /**
- * @generated
- */
- private IDocumentProvider documentProvider;
-
- /**
- * @generated
- */
- 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);
-
- }
-
- /**
- * @generated
- */
- protected String getContextID() {
- return CONTEXT_ID;
- }
-
- /**
- * @generated
- */
- protected PaletteRoot createPaletteRoot(PaletteRoot existingPaletteRoot) {
- PaletteRoot paletteRoot;
- if (existingPaletteRoot == null) {
- paletteRoot = PapyrusPaletteService.getInstance().createPalette(this, getDefaultPaletteContent());
- } else {
- PapyrusPaletteService.getInstance().updatePalette(existingPaletteRoot, this, getDefaultPaletteContent());
- paletteRoot = existingPaletteRoot;
- }
- applyCustomizationsToPalette(paletteRoot);
- return paletteRoot;
- }
-
- /**
- * @generated
- */
- protected PreferencesHint getPreferencesHint() {
- return UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT;
- }
-
- /**
- * @generated
- */
- public String getContributorId() {
- return UMLDiagramEditorPlugin.ID;
- }
-
- /**
- * @generated
- */
- @SuppressWarnings("rawtypes")
- public Object getAdapter(Class type) {
- if (type == IPropertySheetPage.class) {
- return null;
- }
- if (type == IShowInTargetList.class) {
- return new IShowInTargetList() {
-
- @Override
- public String[] getShowInTargetIds() {
- return new String[] { ProjectExplorer.VIEW_ID };
- }
- };
- }
- return super.getAdapter(type);
- }
-
- /**
- * @generated
- */
- protected final IDocumentProvider getDocumentProvider(IEditorInput input) {
- return documentProvider;
- }
-
- /**
- * @generated
- */
- public TransactionalEditingDomain getEditingDomain() {
- return editingDomain;
- }
-
- /**
- * @generated
- */
- protected final void setDocumentProvider(IEditorInput input) {
- // Already set in the constructor
- }
-
- /**
- * @generated
- */
- public void gotoMarker(IMarker marker) {
- MarkerNavigationService.getInstance().gotoMarker(this, marker);
- }
-
- /**
- * @generated
- */
- public boolean isSaveAsAllowed() {
- return true;
- }
-
- /**
- * @generated
- */
- public void doSaveAs() {
- performSaveAs(new NullProgressMonitor());
- }
-
- /**
- * @generated
- */
- protected void performSaveAs(IProgressMonitor progressMonitor) {
- // Nothing
- }
-
- /**
- * @generated
- */
- public ShowInContext getShowInContext() {
- return new ShowInContext(getEditorInput(), getNavigatorSelection());
- }
-
- /**
- * @generated
- */
- private ISelection getNavigatorSelection() {
- return StructuredSelection.EMPTY;
- }
-
- /**
- * @generated
- */
- protected void configureGraphicalViewer() {
- super.configureGraphicalViewer();
- DiagramEditorContextMenuProvider provider = new DiagramEditorContextMenuProvider(this, getDiagramGraphicalViewer());
- getDiagramGraphicalViewer().setContextMenu(provider);
- getSite().registerContextMenu(ActionIds.DIAGRAM_EDITOR_CONTEXT_MENU, provider, getDiagramGraphicalViewer());
- }
-
- /**
- * @generated
- */
- protected TransactionalEditingDomain createEditingDomain() {
- // Already configured
- return editingDomain;
- }
-
- /**
- * @generated
- */
- protected void configureDiagramEditDomain() {
- super.configureDiagramEditDomain();
- getDiagramEditDomain().getDiagramCommandStack().addCommandStackListener(new CommandStackListener() {
-
- @Override
- public void commandStackChanged(EventObject event) {
- if (Display.getCurrent() == null) {
- Display.getDefault().asyncExec(new Runnable() {
-
- @Override
- public void run() {
- firePropertyChange(IEditorPart.PROP_DIRTY);
- }
- });
- } else {
- firePropertyChange(IEditorPart.PROP_DIRTY);
- }
- }
- });
- }
-
- /**
- * @generated
- */
- public void doSave(IProgressMonitor progressMonitor) {
- // The saving of the resource is done by the CoreMultiDiagramEditor
- getDirtyState().saved();
- }
-
- /**
- * @generated
- */
- protected OperationHistoryDirtyState getDirtyState() {
- if (dirtyState == null) {
- dirtyState = OperationHistoryDirtyState.newInstance(getUndoContext(), getOperationHistory());
- }
- return dirtyState;
- }
-
- /**
- * @generated
- */
- protected void setUndoContext(IUndoContext context) {
- if (dirtyState != null) {
- dirtyState.dispose();
- dirtyState = null;
- }
-
- super.setUndoContext(context);
- }
-
- /**
- * @generated
- */
- public boolean isDirty() {
- return getDirtyState().isDirty();
- }
-
- /**
- * @generated
- */
- public void providerChanged(ProviderChangeEvent event) {
- // update the palette if the palette service has changed
- if (PapyrusPaletteService.getInstance().equals(event.getSource())) {
- PapyrusPaletteService.getInstance().updatePalette(getPaletteViewer().getPaletteRoot(), this,
- getDefaultPaletteContent());
- }
- }
-
- /**
- * @generated
- */
- public void dispose() {
- // remove palette service listener
- // remove preference listener
- PapyrusPaletteService.getInstance().removeProviderChangeListener(this);
-
- if (dirtyState != null) {
- dirtyState.dispose();
- dirtyState = null;
- }
-
- super.dispose();
- }
-
- /**
- * @generated
- */
- protected PaletteViewer getPaletteViewer() {
- return getEditDomain().getPaletteViewer();
- }
-
- /**
- * @generated
- */
- protected PaletteViewer constructPaletteViewer() {
- return new PapyrusPaletteViewer();
- }
-
- /**
- * @generated
- */
- protected PaletteViewerProvider createPaletteViewerProvider() {
- getEditDomain().setPaletteRoot(createPaletteRoot(null));
- return new PaletteViewerProvider(getEditDomain()) {
-
- /**
- * Override to provide the additional behavior for the tools. Will intialize with a
- * PaletteEditPartFactory that has a TrackDragger that understand how to handle the
- * mouseDoubleClick event for shape creation tools. Also will initialize the palette
- * with a defaultTool that is the SelectToolEx that undestands how to handle the enter
- * key which will result in the creation of the shape also.
- */
- @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
- // tools.
- viewer.addDragSourceListener(new PaletteToolTransferDragSourceListener(viewer));
- viewer.setCustomizer(createPaletteCustomizer());
- }
-
- @Override
- public PaletteViewer createPaletteViewer(Composite parent) {
- PaletteViewer pViewer = constructPaletteViewer();
- pViewer.createControl(parent);
- configurePaletteViewer(pViewer);
- hookPaletteViewer(pViewer);
- return pViewer;
- }
-
- /**
- * @return Palette Key Handler for the palette
- */
- private KeyHandler getPaletteKeyHandler() {
-
- if (paletteKeyHandler == null) {
-
- paletteKeyHandler = new KeyHandler() {
-
- /**
- * Processes a <i>key released </i> event. This method is called by the Tool
- * whenever a key is released, and the Tool is in the proper state. Override
- * to support pressing the enter key to create a shape or connection
- * (between two selected shapes)
- *
- * @param event
- * the KeyEvent
- * @return <code>true</code> if KeyEvent was handled in some way
- */
- @Override
- public boolean keyReleased(KeyEvent event) {
-
- if (event.keyCode == SWT.Selection) {
-
- Tool tool = getPaletteViewer().getActiveTool().createTool();
-
- if (toolSupportsAccessibility(tool)) {
-
- tool.keyUp(event, getDiagramGraphicalViewer());
-
- // deactivate current selection
- getPaletteViewer().setActiveTool(null);
-
- return true;
- }
-
- }
- return super.keyReleased(event);
- }
-
- };
-
- }
- return paletteKeyHandler;
- }
-
- /**
- * @return Palette Mouse listener for the palette
- */
- private MouseListener getPaletteMouseListener() {
-
- if (paletteMouseListener == null) {
-
- paletteMouseListener = new MouseListener() {
-
- /**
- * Flag to indicate that the current active tool should be cleared after a
- * mouse double-click event.
- */
- private boolean clearActiveTool = false;
-
- /**
- * Override to support double-clicking a palette tool entry to create a
- * shape or connection (between two selected shapes).
- *
- * @see MouseListener#mouseDoubleClick(MouseEvent)
- */
- @Override
- public void mouseDoubleClick(MouseEvent e) {
- Tool tool = getPaletteViewer().getActiveTool().createTool();
-
- if (toolSupportsAccessibility(tool)) {
-
- tool.setViewer(getDiagramGraphicalViewer());
- tool.setEditDomain(getDiagramGraphicalViewer().getEditDomain());
- tool.mouseDoubleClick(e, getDiagramGraphicalViewer());
-
- // Current active tool should be deactivated,
- // but if it is down here it will get
- // reactivated deep in GEF palette code after
- // receiving mouse up events.
- clearActiveTool = true;
- }
- }
-
- @Override
- public void mouseDown(MouseEvent e) {
- // do nothing
- }
-
- @Override
- public void mouseUp(MouseEvent e) {
- // Deactivate current active tool here if a
- // double-click was handled.
- if (clearActiveTool) {
- getPaletteViewer().setActiveTool(null);
- clearActiveTool = false;
- }
-
- }
- };
-
- }
- return paletteMouseListener;
- }
-
- };
- }
-
- /**
- * @generated
- */
- @Override
- public GraphicalViewer getGraphicalViewer() {
- return super.getGraphicalViewer();
- }
-
- /**
- * @generated
- */
- @Override
- protected void initializeGraphicalViewer() {
- super.initializeGraphicalViewer();
-
- // Enable Drop
- getDiagramGraphicalViewer().addDropTargetListener(
- new DropTargetListener(getDiagramGraphicalViewer(), LocalSelectionTransfer.getTransfer()) {
-
- @Override
- protected Object getJavaObject(TransferData data) {
- // 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();
- }
- });
-
- }
-
- /**
- * @generated
- */
- @Override
- public void selectionChanged(IWorkbenchPart part, ISelection selection) {
- if (getSite().getPage().getActiveEditor() instanceof IMultiDiagramEditor) {
- IMultiDiagramEditor editor = (IMultiDiagramEditor) getSite().getPage().getActiveEditor();
- // If not the active editor, ignore selection changed.
- if (this.equals(editor.getActiveEditor())) {
- updateActions(getSelectionActions());
- super.selectionChanged(part, selection);
- } else {
- super.selectionChanged(part, selection);
- }
- } else {
- super.selectionChanged(part, selection);
- }
- // from
- // org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor.selectionChanged(IWorkbenchPart,
- // ISelection)
- if (part == this) {
- rebuildStatusLine();
- }
- }
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.part; + +import java.util.EventObject; + +import org.eclipse.core.commands.operations.IUndoContext; +import org.eclipse.core.resources.IMarker; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.gef.GraphicalViewer; +import org.eclipse.gef.KeyHandler; +import org.eclipse.gef.Tool; +import org.eclipse.gef.commands.CommandStackListener; +import org.eclipse.gef.palette.PaletteRoot; +import org.eclipse.gef.ui.palette.PaletteViewer; +import org.eclipse.gef.ui.palette.PaletteViewerProvider; +import org.eclipse.gmf.runtime.common.core.service.IProviderChangeListener; +import org.eclipse.gmf.runtime.common.core.service.ProviderChangeEvent; +import org.eclipse.gmf.runtime.common.ui.services.marker.MarkerNavigationService; +import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint; +import org.eclipse.gmf.runtime.diagram.ui.actions.ActionIds; +import org.eclipse.gmf.runtime.diagram.ui.internal.parts.PaletteToolTransferDragSourceListener; +import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDocumentProvider; +import org.eclipse.gmf.runtime.notation.Diagram; +import org.eclipse.jface.util.LocalSelectionTransfer; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.papyrus.commands.util.OperationHistoryDirtyState; +import org.eclipse.papyrus.infra.core.services.ServiceException; +import org.eclipse.papyrus.infra.core.services.ServicesRegistry; +import org.eclipse.papyrus.infra.gmfdiag.common.GmfMultiDiagramDocumentProvider; +import org.eclipse.papyrus.infra.gmfdiag.common.service.palette.PapyrusPaletteContextMenuProvider; +import org.eclipse.papyrus.infra.gmfdiag.common.service.palette.PapyrusPaletteService; +import org.eclipse.papyrus.infra.gmfdiag.common.service.palette.PapyrusPaletteViewer; +import org.eclipse.papyrus.infra.ui.editor.IMultiDiagramEditor; +import org.eclipse.papyrus.uml.diagram.common.listeners.DropTargetListener; +import org.eclipse.papyrus.uml.diagram.common.part.UmlGmfDiagramEditor; +import org.eclipse.swt.SWT; +import org.eclipse.swt.dnd.TransferData; +import org.eclipse.swt.events.KeyEvent; +import org.eclipse.swt.events.MouseEvent; +import org.eclipse.swt.events.MouseListener; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Display; +import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.ide.IGotoMarker; +import org.eclipse.ui.navigator.resources.ProjectExplorer; +import org.eclipse.ui.part.IShowInTargetList; +import org.eclipse.ui.part.ShowInContext; +import org.eclipse.ui.views.properties.IPropertySheetPage; + +/** + * @generated + */ +public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderChangeListener, IGotoMarker { + + /** + * @generated + */ + public static final String ID = "org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditorID"; //$NON-NLS-1$ + + /** + * @generated + */ + public static final String CONTEXT_ID = "org.eclipse.papyrus.uml.diagram.communication.ui.diagramContext"; //$NON-NLS-1$ + + /** + * @generated + */ + private KeyHandler paletteKeyHandler = null; + + /** + * @generated + */ + private MouseListener paletteMouseListener = null; + + /** + * @generated + */ + private OperationHistoryDirtyState dirtyState; + + /** + * @generated + */ + private TransactionalEditingDomain editingDomain; + + /** + * @generated + */ + private IDocumentProvider documentProvider; + + /** + * @generated + */ + 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); + + } + + /** + * @generated + */ + protected String getContextID() { + return CONTEXT_ID; + } + + /** + * @generated + */ + protected PaletteRoot createPaletteRoot(PaletteRoot existingPaletteRoot) { + PaletteRoot paletteRoot; + if (existingPaletteRoot == null) { + paletteRoot = PapyrusPaletteService.getInstance().createPalette(this, getDefaultPaletteContent()); + } else { + PapyrusPaletteService.getInstance().updatePalette(existingPaletteRoot, this, getDefaultPaletteContent()); + paletteRoot = existingPaletteRoot; + } + applyCustomizationsToPalette(paletteRoot); + return paletteRoot; + } + + /** + * @generated + */ + protected PreferencesHint getPreferencesHint() { + return UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT; + } + + /** + * @generated + */ + public String getContributorId() { + return UMLDiagramEditorPlugin.ID; + } + + /** + * @generated + */ + @SuppressWarnings("rawtypes") + public Object getAdapter(Class type) { + if (type == IPropertySheetPage.class) { + return null; + } + if (type == IShowInTargetList.class) { + return new IShowInTargetList() { + + @Override + public String[] getShowInTargetIds() { + return new String[] { ProjectExplorer.VIEW_ID }; + } + }; + } + return super.getAdapter(type); + } + + /** + * @generated + */ + protected final IDocumentProvider getDocumentProvider(IEditorInput input) { + return documentProvider; + } + + /** + * @generated + */ + public TransactionalEditingDomain getEditingDomain() { + return editingDomain; + } + + /** + * @generated + */ + protected final void setDocumentProvider(IEditorInput input) { + // Already set in the constructor + } + + /** + * @generated + */ + public void gotoMarker(IMarker marker) { + MarkerNavigationService.getInstance().gotoMarker(this, marker); + } + + /** + * @generated + */ + public boolean isSaveAsAllowed() { + return true; + } + + /** + * @generated + */ + public void doSaveAs() { + performSaveAs(new NullProgressMonitor()); + } + + /** + * @generated + */ + protected void performSaveAs(IProgressMonitor progressMonitor) { + // Nothing + } + + /** + * @generated + */ + public ShowInContext getShowInContext() { + return new ShowInContext(getEditorInput(), getNavigatorSelection()); + } + + /** + * @generated + */ + private ISelection getNavigatorSelection() { + return StructuredSelection.EMPTY; + } + + /** + * @generated + */ + protected void configureGraphicalViewer() { + super.configureGraphicalViewer(); + DiagramEditorContextMenuProvider provider = new DiagramEditorContextMenuProvider(this, getDiagramGraphicalViewer()); + getDiagramGraphicalViewer().setContextMenu(provider); + getSite().registerContextMenu(ActionIds.DIAGRAM_EDITOR_CONTEXT_MENU, provider, getDiagramGraphicalViewer()); + } + + /** + * @generated + */ + protected TransactionalEditingDomain createEditingDomain() { + // Already configured + return editingDomain; + } + + /** + * @generated + */ + protected void configureDiagramEditDomain() { + super.configureDiagramEditDomain(); + getDiagramEditDomain().getDiagramCommandStack().addCommandStackListener(new CommandStackListener() { + + @Override + public void commandStackChanged(EventObject event) { + if (Display.getCurrent() == null) { + Display.getDefault().asyncExec(new Runnable() { + + @Override + public void run() { + firePropertyChange(IEditorPart.PROP_DIRTY); + } + }); + } else { + firePropertyChange(IEditorPart.PROP_DIRTY); + } + } + }); + } + + /** + * @generated + */ + public void doSave(IProgressMonitor progressMonitor) { + // The saving of the resource is done by the CoreMultiDiagramEditor + getDirtyState().saved(); + } + + /** + * @generated + */ + protected OperationHistoryDirtyState getDirtyState() { + if (dirtyState == null) { + dirtyState = OperationHistoryDirtyState.newInstance(getUndoContext(), getOperationHistory()); + } + return dirtyState; + } + + /** + * @generated + */ + protected void setUndoContext(IUndoContext context) { + if (dirtyState != null) { + dirtyState.dispose(); + dirtyState = null; + } + + super.setUndoContext(context); + } + + /** + * @generated + */ + public boolean isDirty() { + return getDirtyState().isDirty(); + } + + /** + * @generated + */ + public void providerChanged(ProviderChangeEvent event) { + // update the palette if the palette service has changed + if (PapyrusPaletteService.getInstance().equals(event.getSource())) { + PapyrusPaletteService.getInstance().updatePalette(getPaletteViewer().getPaletteRoot(), this, + getDefaultPaletteContent()); + } + } + + /** + * @generated + */ + public void dispose() { + // remove palette service listener + // remove preference listener + PapyrusPaletteService.getInstance().removeProviderChangeListener(this); + + if (dirtyState != null) { + dirtyState.dispose(); + dirtyState = null; + } + + super.dispose(); + } + + /** + * @generated + */ + protected PaletteViewer getPaletteViewer() { + return getEditDomain().getPaletteViewer(); + } + + /** + * @generated + */ + protected PaletteViewer constructPaletteViewer() { + return new PapyrusPaletteViewer(); + } + + /** + * @generated + */ + protected PaletteViewerProvider createPaletteViewerProvider() { + getEditDomain().setPaletteRoot(createPaletteRoot(null)); + return new PaletteViewerProvider(getEditDomain()) { + + /** + * Override to provide the additional behavior for the tools. Will intialize with a + * PaletteEditPartFactory that has a TrackDragger that understand how to handle the + * mouseDoubleClick event for shape creation tools. Also will initialize the palette + * with a defaultTool that is the SelectToolEx that undestands how to handle the enter + * key which will result in the creation of the shape also. + */ + @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 + // tools. + viewer.addDragSourceListener(new PaletteToolTransferDragSourceListener(viewer)); + viewer.setCustomizer(createPaletteCustomizer()); + } + + @Override + public PaletteViewer createPaletteViewer(Composite parent) { + PaletteViewer pViewer = constructPaletteViewer(); + pViewer.createControl(parent); + configurePaletteViewer(pViewer); + hookPaletteViewer(pViewer); + return pViewer; + } + + /** + * @return Palette Key Handler for the palette + */ + private KeyHandler getPaletteKeyHandler() { + + if (paletteKeyHandler == null) { + + paletteKeyHandler = new KeyHandler() { + + /** + * Processes a <i>key released </i> event. This method is called by the Tool + * whenever a key is released, and the Tool is in the proper state. Override + * to support pressing the enter key to create a shape or connection + * (between two selected shapes) + * + * @param event + * the KeyEvent + * @return <code>true</code> if KeyEvent was handled in some way + */ + @Override + public boolean keyReleased(KeyEvent event) { + + if (event.keyCode == SWT.Selection) { + + Tool tool = getPaletteViewer().getActiveTool().createTool(); + + if (toolSupportsAccessibility(tool)) { + + tool.keyUp(event, getDiagramGraphicalViewer()); + + // deactivate current selection + getPaletteViewer().setActiveTool(null); + + return true; + } + + } + return super.keyReleased(event); + } + + }; + + } + return paletteKeyHandler; + } + + /** + * @return Palette Mouse listener for the palette + */ + private MouseListener getPaletteMouseListener() { + + if (paletteMouseListener == null) { + + paletteMouseListener = new MouseListener() { + + /** + * Flag to indicate that the current active tool should be cleared after a + * mouse double-click event. + */ + private boolean clearActiveTool = false; + + /** + * Override to support double-clicking a palette tool entry to create a + * shape or connection (between two selected shapes). + * + * @see MouseListener#mouseDoubleClick(MouseEvent) + */ + @Override + public void mouseDoubleClick(MouseEvent e) { + Tool tool = getPaletteViewer().getActiveTool().createTool(); + + if (toolSupportsAccessibility(tool)) { + + tool.setViewer(getDiagramGraphicalViewer()); + tool.setEditDomain(getDiagramGraphicalViewer().getEditDomain()); + tool.mouseDoubleClick(e, getDiagramGraphicalViewer()); + + // Current active tool should be deactivated, + // but if it is down here it will get + // reactivated deep in GEF palette code after + // receiving mouse up events. + clearActiveTool = true; + } + } + + @Override + public void mouseDown(MouseEvent e) { + // do nothing + } + + @Override + public void mouseUp(MouseEvent e) { + // Deactivate current active tool here if a + // double-click was handled. + if (clearActiveTool) { + getPaletteViewer().setActiveTool(null); + clearActiveTool = false; + } + + } + }; + + } + return paletteMouseListener; + } + + }; + } + + /** + * @generated + */ + @Override + public GraphicalViewer getGraphicalViewer() { + return super.getGraphicalViewer(); + } + + /** + * @generated + */ + @Override + protected void initializeGraphicalViewer() { + super.initializeGraphicalViewer(); + + // Enable Drop + getDiagramGraphicalViewer().addDropTargetListener( + new DropTargetListener(getDiagramGraphicalViewer(), LocalSelectionTransfer.getTransfer()) { + + @Override + protected Object getJavaObject(TransferData data) { + // 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(); + } + }); + + } + + /** + * @generated + */ + @Override + public void selectionChanged(IWorkbenchPart part, ISelection selection) { + if (getSite().getPage().getActiveEditor() instanceof IMultiDiagramEditor) { + IMultiDiagramEditor editor = (IMultiDiagramEditor) getSite().getPage().getActiveEditor(); + // If not the active editor, ignore selection changed. + if (this.equals(editor.getActiveEditor())) { + updateActions(getSelectionActions()); + super.selectionChanged(part, selection); + } else { + super.selectionChanged(part, selection); + } + } else { + super.selectionChanged(part, selection); + } + // from + // org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor.selectionChanged(IWorkbenchPart, + // ISelection) + if (part == this) { + rebuildStatusLine(); + } + } +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLDiagramEditorPlugin.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLDiagramEditorPlugin.java index 4ca1203194c..744ebc3abf6 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLDiagramEditorPlugin.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLDiagramEditorPlugin.java @@ -1,294 +1,294 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.part;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.edit.provider.IItemLabelProvider;
-import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
-import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.papyrus.infra.core.log.LogHelper;
-import org.eclipse.papyrus.infra.gmfdiag.common.Activator;
-import org.eclipse.papyrus.uml.diagram.communication.edit.policies.UMLBaseItemSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.communication.expressions.UMLOCLFactory;
-import org.eclipse.papyrus.uml.diagram.communication.preferences.DiagramPreferenceInitializer;
-import org.eclipse.papyrus.uml.diagram.communication.providers.ElementInitializers;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * @generated
- */
-public class UMLDiagramEditorPlugin extends AbstractUIPlugin {
-
- /**
- * @generated
- */
- public static final String ID = "org.eclipse.papyrus.uml.diagram.communication"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- private LogHelper myLogHelper;
-
- /**
- * @generated
- */
- public static final PreferencesHint DIAGRAM_PREFERENCES_HINT = new PreferencesHint(ID);
-
- /**
- * @generated
- */
- private static UMLDiagramEditorPlugin instance;
-
- /**
- * @generated
- */
- private AdapterFactory adapterFactory;
-
- /**
- * @generated
- */
- private UMLDocumentProvider documentProvider;
-
- /**
- * @generated
- */
- private UMLBaseItemSemanticEditPolicy.LinkConstraints linkConstraints;
-
- /**
- * @generated
- */
- private ElementInitializers initializers;
-
- /**
- * @generated
- */
- private UMLOCLFactory oclFactory;
-
- /**
- * @generated
- */
- public UMLDiagramEditorPlugin() {
- }
-
- /**
- * @generated
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- instance = this;
- myLogHelper = new LogHelper(this);
- PreferencesHint.registerPreferenceStore(DIAGRAM_PREFERENCES_HINT, getPreferenceStore());
- adapterFactory = Activator.getInstance().getItemProvidersAdapterFactory();
- DiagramPreferenceInitializer diagramPreferenceInitializer = new DiagramPreferenceInitializer();
- diagramPreferenceInitializer.initializeDefaultPreferences();
-
- }
-
- /**
- * @generated
- */
- public void stop(BundleContext context) throws Exception {
- adapterFactory = null;
- linkConstraints = null;
- initializers = null;
- oclFactory = null;
- instance = null;
- super.stop(context);
- }
-
- /**
- * @generated
- */
- public static UMLDiagramEditorPlugin getInstance() {
- return instance;
- }
-
- /**
- * @generated
- */
- public IPreferenceStore getPreferenceStore() {
- IPreferenceStore store = org.eclipse.papyrus.infra.gmfdiag.preferences.Activator.getDefault().getPreferenceStore();
- return store;
- }
-
- /**
- * @generated
- */
- public AdapterFactory getItemProvidersAdapterFactory() {
- return adapterFactory;
- }
-
- /**
- * @generated
- */
- public ImageDescriptor getItemImageDescriptor(Object item) {
- IItemLabelProvider labelProvider = (IItemLabelProvider) adapterFactory.adapt(
- item, IItemLabelProvider.class);
- if (labelProvider != null) {
- return ExtendedImageRegistry.getInstance().getImageDescriptor(
- labelProvider.getImage(item));
- }
- return null;
- }
-
- /**
- * Returns an image descriptor for the image file at the given
- * plug-in relative path.
- *
- * @generated
- * @param path the path
- * @return the image descriptor
- */
- public static ImageDescriptor getBundledImageDescriptor(String path) {
- return AbstractUIPlugin.imageDescriptorFromPlugin(ID, path);
- }
-
- /**
- * Respects images residing in any plug-in. If path is relative,
- * then this bundle is looked up for the image, otherwise, for absolute
- * path, first segment is taken as id of plug-in with image
- *
- * @generated
- * @param path the path to image, either absolute (with plug-in id as first segment), or relative for bundled images
- * @return the image descriptor
- */
- public static ImageDescriptor findImageDescriptor(String path) {
- final IPath p = new Path(path);
- if (p.isAbsolute() && p.segmentCount() > 1) {
- return AbstractUIPlugin.imageDescriptorFromPlugin(
- p.segment(0), p.removeFirstSegments(1).makeAbsolute().toString());
- } else {
- return getBundledImageDescriptor(p.makeAbsolute().toString());
- }
- }
-
- /**
- * Returns an image for the image file at the given plugin relative path.
- * Client do not need to dispose this image. Images will be disposed automatically.
- *
- * @generated
- * @param path the path
- * @return image instance
- */
- public Image getBundledImage(String path) {
- Image image = getImageRegistry().get(path);
- if (image == null) {
- getImageRegistry().put(path, getBundledImageDescriptor(path));
- image = getImageRegistry().get(path);
- }
- return image;
- }
-
- /**
- * Returns string from plug-in's resource bundle
- *
- * @generated
- */
- public static String getString(String key) {
- return Platform.getResourceString(
- getInstance().getBundle(), "%" + key); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- public UMLDocumentProvider getDocumentProvider() {
- if (documentProvider == null) {
- documentProvider = new UMLDocumentProvider();
- }
- return documentProvider;
- }
-
- /**
- * @generated
- */
- public UMLBaseItemSemanticEditPolicy.LinkConstraints getLinkConstraints() {
- return linkConstraints;
- }
-
- /**
- * @generated
- */
- public void setLinkConstraints(UMLBaseItemSemanticEditPolicy.LinkConstraints lc) {
- this.linkConstraints = lc;
- }
-
- /**
- * @generated
- */
- public ElementInitializers getElementInitializers() {
- return initializers;
- }
-
- /**
- * @generated
- */
- public void setElementInitializers(ElementInitializers i) {
- this.initializers = i;
- }
-
- /**
- * @generated
- */
- public UMLOCLFactory getUMLOCLFactory() {
- return oclFactory;
- }
-
- /**
- * @generated
- */
- public void setUMLOCLFactory(UMLOCLFactory f) {
- this.oclFactory = f;
- }
-
- /**
- * @generated
- */
- public void logError(String error) {
- getLogHelper().warn(error);
- }
-
- /**
- * @generated
- */
- public void logError(String error, Throwable throwable) {
- getLogHelper().error(error, throwable);
- }
-
- /**
- * @generated
- */
- public void logInfo(String message) {
- getLogHelper().info(message);
- }
-
- /**
- * @generated
- */
- public void logInfo(String message, Throwable throwable) {
- getLogHelper().error(message, throwable);
- }
-
- /**
- * @generated
- */
- public LogHelper getLogHelper() {
- return myLogHelper;
- }
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.part; + +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.Path; +import org.eclipse.core.runtime.Platform; +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry; +import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint; +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.papyrus.infra.core.log.LogHelper; +import org.eclipse.papyrus.infra.gmfdiag.common.Activator; +import org.eclipse.papyrus.uml.diagram.communication.edit.policies.UMLBaseItemSemanticEditPolicy; +import org.eclipse.papyrus.uml.diagram.communication.expressions.UMLOCLFactory; +import org.eclipse.papyrus.uml.diagram.communication.preferences.DiagramPreferenceInitializer; +import org.eclipse.papyrus.uml.diagram.communication.providers.ElementInitializers; +import org.eclipse.swt.graphics.Image; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * @generated + */ +public class UMLDiagramEditorPlugin extends AbstractUIPlugin { + + /** + * @generated + */ + public static final String ID = "org.eclipse.papyrus.uml.diagram.communication"; //$NON-NLS-1$ + + /** + * @generated + */ + private LogHelper myLogHelper; + + /** + * @generated + */ + public static final PreferencesHint DIAGRAM_PREFERENCES_HINT = new PreferencesHint(ID); + + /** + * @generated + */ + private static UMLDiagramEditorPlugin instance; + + /** + * @generated + */ + private AdapterFactory adapterFactory; + + /** + * @generated + */ + private UMLDocumentProvider documentProvider; + + /** + * @generated + */ + private UMLBaseItemSemanticEditPolicy.LinkConstraints linkConstraints; + + /** + * @generated + */ + private ElementInitializers initializers; + + /** + * @generated + */ + private UMLOCLFactory oclFactory; + + /** + * @generated + */ + public UMLDiagramEditorPlugin() { + } + + /** + * @generated + */ + public void start(BundleContext context) throws Exception { + super.start(context); + instance = this; + myLogHelper = new LogHelper(this); + PreferencesHint.registerPreferenceStore(DIAGRAM_PREFERENCES_HINT, getPreferenceStore()); + adapterFactory = Activator.getInstance().getItemProvidersAdapterFactory(); + DiagramPreferenceInitializer diagramPreferenceInitializer = new DiagramPreferenceInitializer(); + diagramPreferenceInitializer.initializeDefaultPreferences(); + + } + + /** + * @generated + */ + public void stop(BundleContext context) throws Exception { + adapterFactory = null; + linkConstraints = null; + initializers = null; + oclFactory = null; + instance = null; + super.stop(context); + } + + /** + * @generated + */ + public static UMLDiagramEditorPlugin getInstance() { + return instance; + } + + /** + * @generated + */ + public IPreferenceStore getPreferenceStore() { + IPreferenceStore store = org.eclipse.papyrus.infra.gmfdiag.preferences.Activator.getDefault().getPreferenceStore(); + return store; + } + + /** + * @generated + */ + public AdapterFactory getItemProvidersAdapterFactory() { + return adapterFactory; + } + + /** + * @generated + */ + public ImageDescriptor getItemImageDescriptor(Object item) { + IItemLabelProvider labelProvider = (IItemLabelProvider) adapterFactory.adapt( + item, IItemLabelProvider.class); + if (labelProvider != null) { + return ExtendedImageRegistry.getInstance().getImageDescriptor( + labelProvider.getImage(item)); + } + return null; + } + + /** + * Returns an image descriptor for the image file at the given + * plug-in relative path. + * + * @generated + * @param path the path + * @return the image descriptor + */ + public static ImageDescriptor getBundledImageDescriptor(String path) { + return AbstractUIPlugin.imageDescriptorFromPlugin(ID, path); + } + + /** + * Respects images residing in any plug-in. If path is relative, + * then this bundle is looked up for the image, otherwise, for absolute + * path, first segment is taken as id of plug-in with image + * + * @generated + * @param path the path to image, either absolute (with plug-in id as first segment), or relative for bundled images + * @return the image descriptor + */ + public static ImageDescriptor findImageDescriptor(String path) { + final IPath p = new Path(path); + if (p.isAbsolute() && p.segmentCount() > 1) { + return AbstractUIPlugin.imageDescriptorFromPlugin( + p.segment(0), p.removeFirstSegments(1).makeAbsolute().toString()); + } else { + return getBundledImageDescriptor(p.makeAbsolute().toString()); + } + } + + /** + * Returns an image for the image file at the given plugin relative path. + * Client do not need to dispose this image. Images will be disposed automatically. + * + * @generated + * @param path the path + * @return image instance + */ + public Image getBundledImage(String path) { + Image image = getImageRegistry().get(path); + if (image == null) { + getImageRegistry().put(path, getBundledImageDescriptor(path)); + image = getImageRegistry().get(path); + } + return image; + } + + /** + * Returns string from plug-in's resource bundle + * + * @generated + */ + public static String getString(String key) { + return Platform.getResourceString( + getInstance().getBundle(), "%" + key); //$NON-NLS-1$ + } + + /** + * @generated + */ + public UMLDocumentProvider getDocumentProvider() { + if (documentProvider == null) { + documentProvider = new UMLDocumentProvider(); + } + return documentProvider; + } + + /** + * @generated + */ + public UMLBaseItemSemanticEditPolicy.LinkConstraints getLinkConstraints() { + return linkConstraints; + } + + /** + * @generated + */ + public void setLinkConstraints(UMLBaseItemSemanticEditPolicy.LinkConstraints lc) { + this.linkConstraints = lc; + } + + /** + * @generated + */ + public ElementInitializers getElementInitializers() { + return initializers; + } + + /** + * @generated + */ + public void setElementInitializers(ElementInitializers i) { + this.initializers = i; + } + + /** + * @generated + */ + public UMLOCLFactory getUMLOCLFactory() { + return oclFactory; + } + + /** + * @generated + */ + public void setUMLOCLFactory(UMLOCLFactory f) { + this.oclFactory = f; + } + + /** + * @generated + */ + public void logError(String error) { + getLogHelper().warn(error); + } + + /** + * @generated + */ + public void logError(String error, Throwable throwable) { + getLogHelper().error(error, throwable); + } + + /** + * @generated + */ + public void logInfo(String message) { + getLogHelper().info(message); + } + + /** + * @generated + */ + public void logInfo(String message, Throwable throwable) { + getLogHelper().error(message, throwable); + } + + /** + * @generated + */ + public LogHelper getLogHelper() { + return myLogHelper; + } +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLDiagramEditorUtil.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLDiagramEditorUtil.java index 0d6f1d8232f..6953458eff7 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLDiagramEditorUtil.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLDiagramEditorUtil.java @@ -1,361 +1,361 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.part;
-
-import java.io.IOException;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.operations.OperationHistoryFactory;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.xmi.XMLResource;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.workspace.WorkspaceEditingDomainFactory;
-import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.diagram.core.services.ViewService;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IPrimaryEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramGraphicalViewer;
-import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.core.util.EMFCoreUtil;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.part.DefaultDiagramEditorUtil;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ModelEditPart;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * @generated
- */
-public class UMLDiagramEditorUtil {
-
- /**
- * @generated
- */
- public static Map<?, ?> getSaveOptions() {
- HashMap<String, Object> saveOptions = new HashMap<String, Object>();
- saveOptions.put(XMLResource.OPTION_ENCODING, "UTF-8"); //$NON-NLS-1$
- saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER);
- return saveOptions;
- }
-
- /**
- * @generated
- */
- public static boolean openDiagram(Resource diagram) throws PartInitException {
- String path = diagram.getURI().toPlatformString(true);
- IResource workspaceResource = ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(path));
- if (workspaceResource instanceof IFile) {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- return null != page.openEditor(new FileEditorInput((IFile) workspaceResource), UMLDiagramEditor.ID);
- }
- return false;
- }
-
- /**
- * @generated
- */
- public static void setCharset(IFile file) {
- if (file == null) {
- return;
- }
- try {
- file.setCharset("UTF-8", new NullProgressMonitor()); //$NON-NLS-1$
- } catch (CoreException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Unable to set charset for file " + file.getFullPath(), e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public static String getUniqueFileName(IPath containerFullPath, String fileName, String extension) {
- return DefaultDiagramEditorUtil.getUniqueFileName(containerFullPath, fileName, extension,
- DefaultDiagramEditorUtil.EXISTS_IN_WORKSPACE);
- }
-
- /**
- * Runs the wizard in a dialog.
- *
- * @generated
- */
- public static void runWizard(Shell shell, Wizard wizard, String settingsKey) {
- IDialogSettings pluginDialogSettings = UMLDiagramEditorPlugin.getInstance().getDialogSettings();
- IDialogSettings wizardDialogSettings = pluginDialogSettings.getSection(settingsKey);
- if (wizardDialogSettings == null) {
- wizardDialogSettings = pluginDialogSettings.addNewSection(settingsKey);
- }
- wizard.setDialogSettings(wizardDialogSettings);
- WizardDialog dialog = new WizardDialog(shell, wizard);
- dialog.create();
- dialog.getShell().setSize(Math.max(500, dialog.getShell().getSize().x), 500);
- dialog.open();
- }
-
- /**
- * This method should be called within a workspace modify operation since it creates resources.
- * @generated
- */
- public static Resource createDiagram(URI diagramURI, URI modelURI, IProgressMonitor progressMonitor) {
- TransactionalEditingDomain editingDomain = WorkspaceEditingDomainFactory.INSTANCE.createEditingDomain();
- progressMonitor.beginTask(Messages.UMLDiagramEditorUtil_CreateDiagramProgressTask, 3);
- final Resource diagramResource = editingDomain.getResourceSet().createResource(diagramURI);
- final Resource modelResource = editingDomain.getResourceSet().createResource(modelURI);
- final String diagramName = diagramURI.lastSegment();
- AbstractTransactionalCommand command = new AbstractTransactionalCommand(editingDomain, Messages.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,
- ModelEditPart.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.communication.part.UMLDiagramEditorUtil.getSaveOptions());
- diagramResource.save(org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditorUtil.getSaveOptions());
- } catch (IOException e) {
-
- UMLDiagramEditorPlugin.getInstance().logError("Unable to store model and diagram resources", e); //$NON-NLS-1$
- }
- return CommandResult.newOKCommandResult();
- }
- };
- try {
- OperationHistoryFactory.getOperationHistory().execute(command, new SubProgressMonitor(progressMonitor, 1), null);
- } catch (ExecutionException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Unable to create model and diagram", e); //$NON-NLS-1$
- }
- setCharset(WorkspaceSynchronizer.getFile(modelResource));
- setCharset(WorkspaceSynchronizer.getFile(diagramResource));
- return diagramResource;
- }
-
- /**
- * Create a new instance of domain element associated with canvas.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static Package createInitialModel() {
- return UMLFactory.eINSTANCE.createPackage();
- }
-
- /**
- * Store model element in the resource.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static void attachModelToResource(Package model, Resource resource) {
- resource.getContents().add(model);
- }
-
- /**
- * @generated
- */
- public static void selectElementsInDiagram(IDiagramWorkbenchPart diagramPart, List<EditPart> editParts) {
- diagramPart.getDiagramGraphicalViewer().deselectAll();
-
- EditPart firstPrimary = null;
- for (EditPart nextPart : editParts) {
- diagramPart.getDiagramGraphicalViewer().appendSelection(nextPart);
- if (firstPrimary == null && nextPart instanceof IPrimaryEditPart) {
- firstPrimary = nextPart;
- }
- }
-
- if (!editParts.isEmpty()) {
- diagramPart.getDiagramGraphicalViewer().reveal(firstPrimary != null ? firstPrimary : (EditPart) editParts.get(0));
- }
- }
-
- /**
- * @generated
- */
- private static int findElementsInDiagramByID(DiagramEditPart diagramPart, EObject element,
- List<EditPart> editPartCollector) {
- IDiagramGraphicalViewer viewer = (IDiagramGraphicalViewer) diagramPart.getViewer();
- final int intialNumOfEditParts = editPartCollector.size();
-
- if (element instanceof View) { // support notation element lookup
- EditPart editPart = (EditPart) viewer.getEditPartRegistry().get(element);
- if (editPart != null) {
- editPartCollector.add(editPart);
- return 1;
- }
- }
-
- String elementID = EMFCoreUtil.getProxyID(element);
- @SuppressWarnings("unchecked")
- List<EditPart> associatedParts = viewer.findEditPartsForElement(elementID, IGraphicalEditPart.class);
- // perform the possible hierarchy disjoint -> take the top-most parts only
- for (EditPart nextPart : associatedParts) {
- EditPart parentPart = nextPart.getParent();
- while (parentPart != null && !associatedParts.contains(parentPart)) {
- parentPart = parentPart.getParent();
- }
- if (parentPart == null) {
- editPartCollector.add(nextPart);
- }
- }
-
- if (intialNumOfEditParts == editPartCollector.size()) {
- if (!associatedParts.isEmpty()) {
- editPartCollector.add(associatedParts.get(0));
- } else {
- if (element.eContainer() != null) {
- return findElementsInDiagramByID(diagramPart, element.eContainer(), editPartCollector);
- }
- }
- }
- return editPartCollector.size() - intialNumOfEditParts;
- }
-
- /**
- * @generated
- */
- public static View findView(DiagramEditPart diagramEditPart, EObject targetElement,
- LazyElement2ViewMap lazyElement2ViewMap) {
- boolean hasStructuralURI = false;
- if (targetElement.eResource() instanceof XMLResource) {
- hasStructuralURI = ((XMLResource) targetElement.eResource()).getID(targetElement) == null;
- }
-
- View view = null;
- LinkedList<EditPart> editPartHolder = new LinkedList<EditPart>();
- if (hasStructuralURI && !lazyElement2ViewMap.getElement2ViewMap().isEmpty()) {
- view = lazyElement2ViewMap.getElement2ViewMap().get(targetElement);
- } else if (findElementsInDiagramByID(diagramEditPart, targetElement, editPartHolder) > 0) {
- EditPart editPart = editPartHolder.get(0);
- view = editPart.getModel() instanceof View ? (View) editPart.getModel() : null;
- }
-
- return (view == null) ? diagramEditPart.getDiagramView() : view;
- }
-
- /**
- * XXX This is quite suspicious code (especially editPartTmpHolder) and likely to be removed soon
- * @generated
- */
- public static class LazyElement2ViewMap {
- /**
- * @generated
- */
- private Map<EObject, View> element2ViewMap;
-
- /**
- * @generated
- */
- private View scope;
-
- /**
- * @generated
- */
- private Set<? extends EObject> elementSet;
-
- /**
- * @generated
- */
- public LazyElement2ViewMap(View scope, Set<? extends EObject> elements) {
- this.scope = scope;
- this.elementSet = elements;
- }
-
- /**
- * @generated
- */
- public final Map<EObject, View> getElement2ViewMap() {
- if (element2ViewMap == null) {
- element2ViewMap = new HashMap<EObject, View>();
- // map possible notation elements to itself as these can't be found by view.getElement()
- for (EObject element : elementSet) {
- if (element instanceof View) {
- View view = (View) element;
- if (view.getDiagram() == scope.getDiagram()) {
- element2ViewMap.put(element, view); // take only those that part of our diagram
- }
- }
- }
-
- buildElement2ViewMap(scope, element2ViewMap, elementSet);
- }
- return element2ViewMap;
- }
-
- /**
- * @generated
- */
- private static boolean buildElement2ViewMap(View parentView, Map<EObject, View> element2ViewMap,
- Set<? extends EObject> elements) {
- if (elements.size() == element2ViewMap.size()) {
- return true;
- }
-
- if (parentView.isSetElement() && !element2ViewMap.containsKey(parentView.getElement()) && elements.contains(parentView.getElement())) {
- element2ViewMap.put(parentView.getElement(), parentView);
- if (elements.size() == element2ViewMap.size()) {
- return true;
- }
- }
- boolean complete = false;
- for (Iterator<?> it = parentView.getChildren().iterator(); it.hasNext() && !complete;) {
- complete = buildElement2ViewMap((View) it.next(), element2ViewMap, elements);
- }
- for (Iterator<?> it = parentView.getSourceEdges().iterator(); it.hasNext() && !complete;) {
- complete = buildElement2ViewMap((View) it.next(), element2ViewMap, elements);
- }
- for (Iterator<?> it = parentView.getTargetEdges().iterator(); it.hasNext() && !complete;) {
- complete = buildElement2ViewMap((View) it.next(), element2ViewMap, elements);
- }
- return complete;
- }
- } //LazyElement2ViewMap
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.part; + +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.commands.operations.OperationHistoryFactory; +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.core.runtime.Path; +import org.eclipse.core.runtime.SubProgressMonitor; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.xmi.XMLResource; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.emf.workspace.WorkspaceEditingDomainFactory; +import org.eclipse.emf.workspace.util.WorkspaceSynchronizer; +import org.eclipse.gef.EditPart; +import org.eclipse.gmf.runtime.common.core.command.CommandResult; +import org.eclipse.gmf.runtime.diagram.core.services.ViewService; +import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editparts.IPrimaryEditPart; +import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramGraphicalViewer; +import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart; +import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand; +import org.eclipse.gmf.runtime.emf.core.util.EMFCoreUtil; +import org.eclipse.gmf.runtime.notation.Diagram; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.jface.dialogs.IDialogSettings; +import org.eclipse.jface.wizard.Wizard; +import org.eclipse.jface.wizard.WizardDialog; +import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.part.DefaultDiagramEditorUtil; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ModelEditPart; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.part.FileEditorInput; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.UMLFactory; + +/** + * @generated + */ +public class UMLDiagramEditorUtil { + + /** + * @generated + */ + public static Map<?, ?> getSaveOptions() { + HashMap<String, Object> saveOptions = new HashMap<String, Object>(); + saveOptions.put(XMLResource.OPTION_ENCODING, "UTF-8"); //$NON-NLS-1$ + saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER); + return saveOptions; + } + + /** + * @generated + */ + public static boolean openDiagram(Resource diagram) throws PartInitException { + String path = diagram.getURI().toPlatformString(true); + IResource workspaceResource = ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(path)); + if (workspaceResource instanceof IFile) { + IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); + return null != page.openEditor(new FileEditorInput((IFile) workspaceResource), UMLDiagramEditor.ID); + } + return false; + } + + /** + * @generated + */ + public static void setCharset(IFile file) { + if (file == null) { + return; + } + try { + file.setCharset("UTF-8", new NullProgressMonitor()); //$NON-NLS-1$ + } catch (CoreException e) { + UMLDiagramEditorPlugin.getInstance().logError("Unable to set charset for file " + file.getFullPath(), e); //$NON-NLS-1$ + } + } + + /** + * @generated + */ + public static String getUniqueFileName(IPath containerFullPath, String fileName, String extension) { + return DefaultDiagramEditorUtil.getUniqueFileName(containerFullPath, fileName, extension, + DefaultDiagramEditorUtil.EXISTS_IN_WORKSPACE); + } + + /** + * Runs the wizard in a dialog. + * + * @generated + */ + public static void runWizard(Shell shell, Wizard wizard, String settingsKey) { + IDialogSettings pluginDialogSettings = UMLDiagramEditorPlugin.getInstance().getDialogSettings(); + IDialogSettings wizardDialogSettings = pluginDialogSettings.getSection(settingsKey); + if (wizardDialogSettings == null) { + wizardDialogSettings = pluginDialogSettings.addNewSection(settingsKey); + } + wizard.setDialogSettings(wizardDialogSettings); + WizardDialog dialog = new WizardDialog(shell, wizard); + dialog.create(); + dialog.getShell().setSize(Math.max(500, dialog.getShell().getSize().x), 500); + dialog.open(); + } + + /** + * This method should be called within a workspace modify operation since it creates resources. + * @generated + */ + public static Resource createDiagram(URI diagramURI, URI modelURI, IProgressMonitor progressMonitor) { + TransactionalEditingDomain editingDomain = WorkspaceEditingDomainFactory.INSTANCE.createEditingDomain(); + progressMonitor.beginTask(Messages.UMLDiagramEditorUtil_CreateDiagramProgressTask, 3); + final Resource diagramResource = editingDomain.getResourceSet().createResource(diagramURI); + final Resource modelResource = editingDomain.getResourceSet().createResource(modelURI); + final String diagramName = diagramURI.lastSegment(); + AbstractTransactionalCommand command = new AbstractTransactionalCommand(editingDomain, Messages.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, + ModelEditPart.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.communication.part.UMLDiagramEditorUtil.getSaveOptions()); + diagramResource.save(org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditorUtil.getSaveOptions()); + } catch (IOException e) { + + UMLDiagramEditorPlugin.getInstance().logError("Unable to store model and diagram resources", e); //$NON-NLS-1$ + } + return CommandResult.newOKCommandResult(); + } + }; + try { + OperationHistoryFactory.getOperationHistory().execute(command, new SubProgressMonitor(progressMonitor, 1), null); + } catch (ExecutionException e) { + UMLDiagramEditorPlugin.getInstance().logError("Unable to create model and diagram", e); //$NON-NLS-1$ + } + setCharset(WorkspaceSynchronizer.getFile(modelResource)); + setCharset(WorkspaceSynchronizer.getFile(diagramResource)); + return diagramResource; + } + + /** + * Create a new instance of domain element associated with canvas. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private static Package createInitialModel() { + return UMLFactory.eINSTANCE.createPackage(); + } + + /** + * Store model element in the resource. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private static void attachModelToResource(Package model, Resource resource) { + resource.getContents().add(model); + } + + /** + * @generated + */ + public static void selectElementsInDiagram(IDiagramWorkbenchPart diagramPart, List<EditPart> editParts) { + diagramPart.getDiagramGraphicalViewer().deselectAll(); + + EditPart firstPrimary = null; + for (EditPart nextPart : editParts) { + diagramPart.getDiagramGraphicalViewer().appendSelection(nextPart); + if (firstPrimary == null && nextPart instanceof IPrimaryEditPart) { + firstPrimary = nextPart; + } + } + + if (!editParts.isEmpty()) { + diagramPart.getDiagramGraphicalViewer().reveal(firstPrimary != null ? firstPrimary : (EditPart) editParts.get(0)); + } + } + + /** + * @generated + */ + private static int findElementsInDiagramByID(DiagramEditPart diagramPart, EObject element, + List<EditPart> editPartCollector) { + IDiagramGraphicalViewer viewer = (IDiagramGraphicalViewer) diagramPart.getViewer(); + final int intialNumOfEditParts = editPartCollector.size(); + + if (element instanceof View) { // support notation element lookup + EditPart editPart = (EditPart) viewer.getEditPartRegistry().get(element); + if (editPart != null) { + editPartCollector.add(editPart); + return 1; + } + } + + String elementID = EMFCoreUtil.getProxyID(element); + @SuppressWarnings("unchecked") + List<EditPart> associatedParts = viewer.findEditPartsForElement(elementID, IGraphicalEditPart.class); + // perform the possible hierarchy disjoint -> take the top-most parts only + for (EditPart nextPart : associatedParts) { + EditPart parentPart = nextPart.getParent(); + while (parentPart != null && !associatedParts.contains(parentPart)) { + parentPart = parentPart.getParent(); + } + if (parentPart == null) { + editPartCollector.add(nextPart); + } + } + + if (intialNumOfEditParts == editPartCollector.size()) { + if (!associatedParts.isEmpty()) { + editPartCollector.add(associatedParts.get(0)); + } else { + if (element.eContainer() != null) { + return findElementsInDiagramByID(diagramPart, element.eContainer(), editPartCollector); + } + } + } + return editPartCollector.size() - intialNumOfEditParts; + } + + /** + * @generated + */ + public static View findView(DiagramEditPart diagramEditPart, EObject targetElement, + LazyElement2ViewMap lazyElement2ViewMap) { + boolean hasStructuralURI = false; + if (targetElement.eResource() instanceof XMLResource) { + hasStructuralURI = ((XMLResource) targetElement.eResource()).getID(targetElement) == null; + } + + View view = null; + LinkedList<EditPart> editPartHolder = new LinkedList<EditPart>(); + if (hasStructuralURI && !lazyElement2ViewMap.getElement2ViewMap().isEmpty()) { + view = lazyElement2ViewMap.getElement2ViewMap().get(targetElement); + } else if (findElementsInDiagramByID(diagramEditPart, targetElement, editPartHolder) > 0) { + EditPart editPart = editPartHolder.get(0); + view = editPart.getModel() instanceof View ? (View) editPart.getModel() : null; + } + + return (view == null) ? diagramEditPart.getDiagramView() : view; + } + + /** + * XXX This is quite suspicious code (especially editPartTmpHolder) and likely to be removed soon + * @generated + */ + public static class LazyElement2ViewMap { + /** + * @generated + */ + private Map<EObject, View> element2ViewMap; + + /** + * @generated + */ + private View scope; + + /** + * @generated + */ + private Set<? extends EObject> elementSet; + + /** + * @generated + */ + public LazyElement2ViewMap(View scope, Set<? extends EObject> elements) { + this.scope = scope; + this.elementSet = elements; + } + + /** + * @generated + */ + public final Map<EObject, View> getElement2ViewMap() { + if (element2ViewMap == null) { + element2ViewMap = new HashMap<EObject, View>(); + // map possible notation elements to itself as these can't be found by view.getElement() + for (EObject element : elementSet) { + if (element instanceof View) { + View view = (View) element; + if (view.getDiagram() == scope.getDiagram()) { + element2ViewMap.put(element, view); // take only those that part of our diagram + } + } + } + + buildElement2ViewMap(scope, element2ViewMap, elementSet); + } + return element2ViewMap; + } + + /** + * @generated + */ + private static boolean buildElement2ViewMap(View parentView, Map<EObject, View> element2ViewMap, + Set<? extends EObject> elements) { + if (elements.size() == element2ViewMap.size()) { + return true; + } + + if (parentView.isSetElement() && !element2ViewMap.containsKey(parentView.getElement()) && elements.contains(parentView.getElement())) { + element2ViewMap.put(parentView.getElement(), parentView); + if (elements.size() == element2ViewMap.size()) { + return true; + } + } + boolean complete = false; + for (Iterator<?> it = parentView.getChildren().iterator(); it.hasNext() && !complete;) { + complete = buildElement2ViewMap((View) it.next(), element2ViewMap, elements); + } + for (Iterator<?> it = parentView.getSourceEdges().iterator(); it.hasNext() && !complete;) { + complete = buildElement2ViewMap((View) it.next(), element2ViewMap, elements); + } + for (Iterator<?> it = parentView.getTargetEdges().iterator(); it.hasNext() && !complete;) { + complete = buildElement2ViewMap((View) it.next(), element2ViewMap, elements); + } + return complete; + } + } //LazyElement2ViewMap + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLDiagramUpdater.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLDiagramUpdater.java index 7e84e804c1b..893bd8ad49e 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLDiagramUpdater.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLDiagramUpdater.java @@ -1,649 +1,649 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.part;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gmf.runtime.emf.core.util.CrossReferenceAdapter;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.common.updater.DiagramUpdater;
-import org.eclipse.papyrus.uml.diagram.common.part.ICustomDiagramUpdater;
-import org.eclipse.papyrus.uml.diagram.communication.custom.parts.InteractionCompartmentDiagramUpdater;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.CommentEditPartCN;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ConnectorDurationObservationEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ConnectorTimeObservationEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ConstraintEditPartCN;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.DurationObservationEditPartCN;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.InteractionCompartmentEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.InteractionEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.LifelineEditPartCN;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.MessageEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ModelEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.TimeObservationEditPartCN;
-import org.eclipse.papyrus.uml.diagram.communication.providers.UMLElementTypes;
-import org.eclipse.uml2.uml.Comment;
-import org.eclipse.uml2.uml.Constraint;
-import org.eclipse.uml2.uml.DurationObservation;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Interaction;
-import org.eclipse.uml2.uml.Lifeline;
-import org.eclipse.uml2.uml.Message;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.PackageableElement;
-import org.eclipse.uml2.uml.TimeObservation;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * @generated
- */
-public class UMLDiagramUpdater implements DiagramUpdater {
- /**
- * @generated
- */
- public static final org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramUpdater INSTANCE = new UMLDiagramUpdater();
-
- /**
- * @generated
- */
- protected UMLDiagramUpdater() {
- //to prevent instantiation allowing the override
- }
-
- /**
- * @generated
- */
- public List<UMLNodeDescriptor> getSemanticChildren(View view) {
- String vid = UMLVisualIDRegistry.getVisualID(view);
- if (vid != null) {
- switch (vid) {
- case ModelEditPart.VISUAL_ID:
- return getPackage_CommunicationDiagram_SemanticChildren(view);
- case InteractionCompartmentEditPart.VISUAL_ID:
- return getInteraction_SubfragmentCompartment_SemanticChildren(view);
- }
- }
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public List<UMLNodeDescriptor> getPackage_CommunicationDiagram_SemanticChildren(View view) {
- if (!view.isSetElement()) {
- return Collections.emptyList();
- }
- Package modelElement = (Package) view.getElement();
- LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for (Iterator<?> it = modelElement.getPackagedElements()
- .iterator(); it.hasNext();) {
- PackageableElement childElement = (PackageableElement) it.next();
- String visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
- if (InteractionEditPart.VISUAL_ID.equals(visualID)) {
- result.add(new UMLNodeDescriptor(childElement, visualID));
- continue;
- }
- }
- return result;
- }
-
- /**
- * @generated
- */
- public List<UMLNodeDescriptor> getInteraction_SubfragmentCompartment_SemanticChildren(View view) {
- ICustomDiagramUpdater<UMLNodeDescriptor> customUpdater = new InteractionCompartmentDiagramUpdater();
- return customUpdater.getSemanticChildren(view);
- }
-
- /**
- * @generated
- */
- public List<UMLLinkDescriptor> getContainedLinks(View view) {
- String vid = UMLVisualIDRegistry.getVisualID(view);
- if (vid != null) {
- switch (vid) {
- case ModelEditPart.VISUAL_ID:
- return getPackage_CommunicationDiagram_ContainedLinks(view);
- case InteractionEditPart.VISUAL_ID:
- return getInteraction_Shape_ContainedLinks(view);
- case LifelineEditPartCN.VISUAL_ID:
- return getLifeline_Shape_ContainedLinks(view);
- case ConstraintEditPartCN.VISUAL_ID:
- return getConstraint_Shape_ContainedLinks(view);
- case CommentEditPartCN.VISUAL_ID:
- return getComment_Shape_ContainedLinks(view);
- case TimeObservationEditPartCN.VISUAL_ID:
- return getTimeObservation_Shape_ContainedLinks(view);
- case DurationObservationEditPartCN.VISUAL_ID:
- return getDurationObservation_Shape_ContainedLinks(view);
- case MessageEditPart.VISUAL_ID:
- return getPath_Edge_ContainedLinks(view);
- }
- }
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public List<UMLLinkDescriptor> getIncomingLinks(View view) {
- String vid = UMLVisualIDRegistry.getVisualID(view);
- if (vid != null) {
- switch (vid) {
- case InteractionEditPart.VISUAL_ID:
- return getInteraction_Shape_IncomingLinks(view);
- case LifelineEditPartCN.VISUAL_ID:
- return getLifeline_Shape_IncomingLinks(view);
- case ConstraintEditPartCN.VISUAL_ID:
- return getConstraint_Shape_IncomingLinks(view);
- case CommentEditPartCN.VISUAL_ID:
- return getComment_Shape_IncomingLinks(view);
- case TimeObservationEditPartCN.VISUAL_ID:
- return getTimeObservation_Shape_IncomingLinks(view);
- case DurationObservationEditPartCN.VISUAL_ID:
- return getDurationObservation_Shape_IncomingLinks(view);
- case MessageEditPart.VISUAL_ID:
- return getPath_Edge_IncomingLinks(view);
- }
- }
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public List<UMLLinkDescriptor> getOutgoingLinks(View view) {
- String vid = UMLVisualIDRegistry.getVisualID(view);
- if (vid != null) {
- switch (vid) {
- case InteractionEditPart.VISUAL_ID:
- return getInteraction_Shape_OutgoingLinks(view);
- case LifelineEditPartCN.VISUAL_ID:
- return getLifeline_Shape_OutgoingLinks(view);
- case ConstraintEditPartCN.VISUAL_ID:
- return getConstraint_Shape_OutgoingLinks(view);
- case CommentEditPartCN.VISUAL_ID:
- return getComment_Shape_OutgoingLinks(view);
- case TimeObservationEditPartCN.VISUAL_ID:
- return getTimeObservation_Shape_OutgoingLinks(view);
- case DurationObservationEditPartCN.VISUAL_ID:
- return getDurationObservation_Shape_OutgoingLinks(view);
- case MessageEditPart.VISUAL_ID:
- return getPath_Edge_OutgoingLinks(view);
- }
- }
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public List<UMLLinkDescriptor> getPackage_CommunicationDiagram_ContainedLinks(View view) {
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public List<UMLLinkDescriptor> getInteraction_Shape_ContainedLinks(View view) {
- Interaction modelElement = (Interaction) view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getContainedTypeModelFacetLinks_Path_Edge(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public List<UMLLinkDescriptor> getLifeline_Shape_ContainedLinks(View view) {
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public List<UMLLinkDescriptor> getConstraint_Shape_ContainedLinks(View view) {
- Constraint modelElement = (Constraint) view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElementEdge(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public List<UMLLinkDescriptor> getComment_Shape_ContainedLinks(View view) {
- Comment modelElement = (Comment) view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingFeatureModelFacetLinks_Comment_AnnotatedElementEdge(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public List<UMLLinkDescriptor> getTimeObservation_Shape_ContainedLinks(View view) {
- TimeObservation modelElement = (TimeObservation) view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingFeatureModelFacetLinks_TimeObservation_EventEdge(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public List<UMLLinkDescriptor> getDurationObservation_Shape_ContainedLinks(View view) {
- DurationObservation modelElement = (DurationObservation) view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingFeatureModelFacetLinks_DurationObservation_EventEdge(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public List<UMLLinkDescriptor> getPath_Edge_ContainedLinks(View view) {
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public List<UMLLinkDescriptor> getInteraction_Shape_IncomingLinks(View view) {
- Interaction modelElement = (Interaction) view.getElement();
- CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getIncomingTypeModelFacetLinks_Path_Edge(modelElement, crossReferencer));
- result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElementEdge(modelElement, crossReferencer));
- result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElementEdge(modelElement, crossReferencer));
- result.addAll(getIncomingFeatureModelFacetLinks_DurationObservation_EventEdge(modelElement, crossReferencer));
- result.addAll(getIncomingFeatureModelFacetLinks_TimeObservation_EventEdge(modelElement, crossReferencer));
- return result;
- }
-
- /**
- * @generated
- */
- public List<UMLLinkDescriptor> getLifeline_Shape_IncomingLinks(View view) {
- Lifeline modelElement = (Lifeline) view.getElement();
- CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getIncomingTypeModelFacetLinks_Path_Edge(modelElement, crossReferencer));
- result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElementEdge(modelElement, crossReferencer));
- result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElementEdge(modelElement, crossReferencer));
- result.addAll(getIncomingFeatureModelFacetLinks_DurationObservation_EventEdge(modelElement, crossReferencer));
- result.addAll(getIncomingFeatureModelFacetLinks_TimeObservation_EventEdge(modelElement, crossReferencer));
- return result;
- }
-
- /**
- * @generated
- */
- public List<UMLLinkDescriptor> getConstraint_Shape_IncomingLinks(View view) {
- Constraint modelElement = (Constraint) view.getElement();
- CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getIncomingTypeModelFacetLinks_Path_Edge(modelElement, crossReferencer));
- result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElementEdge(modelElement, crossReferencer));
- result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElementEdge(modelElement, crossReferencer));
- result.addAll(getIncomingFeatureModelFacetLinks_DurationObservation_EventEdge(modelElement, crossReferencer));
- result.addAll(getIncomingFeatureModelFacetLinks_TimeObservation_EventEdge(modelElement, crossReferencer));
- return result;
- }
-
- /**
- * @generated
- */
- public List<UMLLinkDescriptor> getComment_Shape_IncomingLinks(View view) {
- Comment modelElement = (Comment) view.getElement();
- CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getIncomingTypeModelFacetLinks_Path_Edge(modelElement, crossReferencer));
- result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElementEdge(modelElement, crossReferencer));
- result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElementEdge(modelElement, crossReferencer));
- return result;
- }
-
- /**
- * @generated
- */
- public List<UMLLinkDescriptor> getTimeObservation_Shape_IncomingLinks(View view) {
- TimeObservation modelElement = (TimeObservation) view.getElement();
- CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getIncomingTypeModelFacetLinks_Path_Edge(modelElement, crossReferencer));
- result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElementEdge(modelElement, crossReferencer));
- result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElementEdge(modelElement, crossReferencer));
- result.addAll(getIncomingFeatureModelFacetLinks_DurationObservation_EventEdge(modelElement, crossReferencer));
- result.addAll(getIncomingFeatureModelFacetLinks_TimeObservation_EventEdge(modelElement, crossReferencer));
- return result;
- }
-
- /**
- * @generated
- */
- public List<UMLLinkDescriptor> getDurationObservation_Shape_IncomingLinks(View view) {
- DurationObservation modelElement = (DurationObservation) view.getElement();
- CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getIncomingTypeModelFacetLinks_Path_Edge(modelElement, crossReferencer));
- result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElementEdge(modelElement, crossReferencer));
- result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElementEdge(modelElement, crossReferencer));
- result.addAll(getIncomingFeatureModelFacetLinks_DurationObservation_EventEdge(modelElement, crossReferencer));
- result.addAll(getIncomingFeatureModelFacetLinks_TimeObservation_EventEdge(modelElement, crossReferencer));
- return result;
- }
-
- /**
- * @generated
- */
- public List<UMLLinkDescriptor> getPath_Edge_IncomingLinks(View view) {
- Message modelElement = (Message) view.getElement();
- CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getIncomingTypeModelFacetLinks_Path_Edge(modelElement, crossReferencer));
- result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElementEdge(modelElement, crossReferencer));
- result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElementEdge(modelElement, crossReferencer));
- result.addAll(getIncomingFeatureModelFacetLinks_DurationObservation_EventEdge(modelElement, crossReferencer));
- result.addAll(getIncomingFeatureModelFacetLinks_TimeObservation_EventEdge(modelElement, crossReferencer));
- return result;
- }
-
- /**
- * @generated
- */
- public List<UMLLinkDescriptor> getInteraction_Shape_OutgoingLinks(View view) {
- Interaction modelElement = (Interaction) view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingTypeModelFacetLinks_Path_Edge(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public List<UMLLinkDescriptor> getLifeline_Shape_OutgoingLinks(View view) {
- Lifeline modelElement = (Lifeline) view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingTypeModelFacetLinks_Path_Edge(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public List<UMLLinkDescriptor> getConstraint_Shape_OutgoingLinks(View view) {
- Constraint modelElement = (Constraint) view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingTypeModelFacetLinks_Path_Edge(modelElement));
- result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElementEdge(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public List<UMLLinkDescriptor> getComment_Shape_OutgoingLinks(View view) {
- Comment modelElement = (Comment) view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingTypeModelFacetLinks_Path_Edge(modelElement));
- result.addAll(getOutgoingFeatureModelFacetLinks_Comment_AnnotatedElementEdge(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public List<UMLLinkDescriptor> getTimeObservation_Shape_OutgoingLinks(View view) {
- TimeObservation modelElement = (TimeObservation) view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingTypeModelFacetLinks_Path_Edge(modelElement));
- result.addAll(getOutgoingFeatureModelFacetLinks_TimeObservation_EventEdge(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public List<UMLLinkDescriptor> getDurationObservation_Shape_OutgoingLinks(View view) {
- DurationObservation modelElement = (DurationObservation) view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingTypeModelFacetLinks_Path_Edge(modelElement));
- result.addAll(getOutgoingFeatureModelFacetLinks_DurationObservation_EventEdge(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public List<UMLLinkDescriptor> getPath_Edge_OutgoingLinks(View view) {
- Message modelElement = (Message) view.getElement();
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- result.addAll(getOutgoingTypeModelFacetLinks_Path_Edge(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- protected Collection<UMLLinkDescriptor> getContainedTypeModelFacetLinks_Path_Edge(Interaction container) {
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- for (Iterator<?> links = container.getMessages()
- .iterator(); links.hasNext();) {
- EObject linkObject = (EObject) links.next();
- if (false == linkObject instanceof Message) {
- continue;
- }
- Message link = (Message) linkObject;
- if (!MessageEditPart.VISUAL_ID.equals(UMLVisualIDRegistry.getLinkWithClassVisualID(link))) {
- continue;
- }
- List<?> targets = link.getOwnedElements();
- Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if (false == theTarget instanceof Element) {
- continue;
- }
- Element dst = (Element) theTarget;
- Element src = link.getOwner();
- result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Path_Edge, MessageEditPart.VISUAL_ID));
- }
- return result;
- }
-
- /**
- * @generated
- */
- protected Collection<UMLLinkDescriptor> getIncomingTypeModelFacetLinks_Path_Edge(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.getElement_OwnedElement() || false == setting.getEObject() instanceof Message) {
- continue;
- }
- Message link = (Message) setting.getEObject();
- if (!MessageEditPart.VISUAL_ID.equals(UMLVisualIDRegistry.getLinkWithClassVisualID(link))) {
- continue;
- }
- Element src = link.getOwner();
- result.add(new UMLLinkDescriptor(src, target, link, UMLElementTypes.Path_Edge, MessageEditPart.VISUAL_ID));
- }
- return result;
- }
-
- /**
- * @generated
- */
- protected Collection<UMLLinkDescriptor> getIncomingFeatureModelFacetLinks_Comment_AnnotatedElementEdge(
- 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()) {
- result.add(new UMLLinkDescriptor(setting.getEObject(), target, UMLElementTypes.Comment_AnnotatedElementEdge, CommentAnnotatedElementEditPart.VISUAL_ID));
- }
- }
- return result;
- }
-
- /**
- * @generated
- */
- protected Collection<UMLLinkDescriptor> getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElementEdge(
- 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()) {
- result.add(new UMLLinkDescriptor(setting.getEObject(), target, UMLElementTypes.Constraint_ConstrainedElementEdge, ConstraintConstrainedElementEditPart.VISUAL_ID));
- }
- }
- return result;
- }
-
- /**
- * @generated
- */
- protected Collection<UMLLinkDescriptor> getIncomingFeatureModelFacetLinks_DurationObservation_EventEdge(
- 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()) {
- result.add(new UMLLinkDescriptor(setting.getEObject(), target, UMLElementTypes.DurationObservation_EventEdge, ConnectorDurationObservationEditPart.VISUAL_ID));
- }
- }
- return result;
- }
-
- /**
- * @generated
- */
- protected Collection<UMLLinkDescriptor> getIncomingFeatureModelFacetLinks_TimeObservation_EventEdge(
- 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()) {
- result.add(new UMLLinkDescriptor(setting.getEObject(), target, UMLElementTypes.TimeObservation_EventEdge, ConnectorTimeObservationEditPart.VISUAL_ID));
- }
- }
- return result;
- }
-
- /**
- * @generated
- */
- protected Collection<UMLLinkDescriptor> getOutgoingTypeModelFacetLinks_Path_Edge(Element source) {
- Interaction container = null;
- // Find container element for the link.
- // Climb up by containment hierarchy starting from the source
- // and return the first element that is instance of the container class.
- for (EObject element = source; element != null && container == null; element = element.eContainer()) {
- if (element instanceof Interaction) {
- container = (Interaction) element;
- }
- }
- if (container == null) {
- return Collections.emptyList();
- }
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- for (Iterator<?> links = container.getMessages()
- .iterator(); links.hasNext();) {
- EObject linkObject = (EObject) links.next();
- if (false == linkObject instanceof Message) {
- continue;
- }
- Message link = (Message) linkObject;
- if (!MessageEditPart.VISUAL_ID.equals(UMLVisualIDRegistry.getLinkWithClassVisualID(link))) {
- continue;
- }
- List<?> targets = link.getOwnedElements();
- Object theTarget = targets.size() == 1 ? targets.get(0) : null;
- if (false == theTarget instanceof Element) {
- continue;
- }
- Element dst = (Element) theTarget;
- Element src = link.getOwner();
- if (src != source) {
- continue;
- }
- result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Path_Edge, MessageEditPart.VISUAL_ID));
- }
- return result;
- }
-
- /**
- * @generated
- */
- protected Collection<UMLLinkDescriptor> getOutgoingFeatureModelFacetLinks_Comment_AnnotatedElementEdge(
- Comment source) {
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- for (Iterator<?> destinations = source.getAnnotatedElements()
- .iterator(); destinations.hasNext();) {
- Element destination = (Element) destinations.next();
- result.add(new UMLLinkDescriptor(source, destination, UMLElementTypes.Comment_AnnotatedElementEdge, CommentAnnotatedElementEditPart.VISUAL_ID));
- }
- return result;
- }
-
- /**
- * @generated
- */
- protected Collection<UMLLinkDescriptor> getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElementEdge(
- Constraint source) {
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- for (Iterator<?> destinations = source.getConstrainedElements()
- .iterator(); destinations.hasNext();) {
- Element destination = (Element) destinations.next();
- result.add(new UMLLinkDescriptor(source, destination, UMLElementTypes.Constraint_ConstrainedElementEdge, ConstraintConstrainedElementEditPart.VISUAL_ID));
- }
- return result;
- }
-
- /**
- * @generated
- */
- protected Collection<UMLLinkDescriptor> getOutgoingFeatureModelFacetLinks_DurationObservation_EventEdge(
- DurationObservation source) {
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- for (Iterator<?> destinations = source.getEvents()
- .iterator(); destinations.hasNext();) {
- NamedElement destination = (NamedElement) destinations.next();
- result.add(new UMLLinkDescriptor(source, destination, UMLElementTypes.DurationObservation_EventEdge, ConnectorDurationObservationEditPart.VISUAL_ID));
- }
- return result;
- }
-
- /**
- * @generated
- */
- protected Collection<UMLLinkDescriptor> getOutgoingFeatureModelFacetLinks_TimeObservation_EventEdge(
- TimeObservation source) {
- LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>();
- NamedElement destination = source.getEvent();
- if (destination == null) {
- return result;
- }
- result.add(new UMLLinkDescriptor(source, destination, UMLElementTypes.TimeObservation_EventEdge, ConnectorTimeObservationEditPart.VISUAL_ID));
- return result;
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.part; + +import java.util.Collection; +import java.util.Collections; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.gmf.runtime.emf.core.util.CrossReferenceAdapter; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.papyrus.infra.gmfdiag.common.updater.DiagramUpdater; +import org.eclipse.papyrus.uml.diagram.common.part.ICustomDiagramUpdater; +import org.eclipse.papyrus.uml.diagram.communication.custom.parts.InteractionCompartmentDiagramUpdater; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.CommentAnnotatedElementEditPart; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.CommentEditPartCN; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ConnectorDurationObservationEditPart; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ConnectorTimeObservationEditPart; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ConstraintConstrainedElementEditPart; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ConstraintEditPartCN; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.DurationObservationEditPartCN; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.InteractionCompartmentEditPart; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.InteractionEditPart; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.LifelineEditPartCN; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.MessageEditPart; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ModelEditPart; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.TimeObservationEditPartCN; +import org.eclipse.papyrus.uml.diagram.communication.providers.UMLElementTypes; +import org.eclipse.uml2.uml.Comment; +import org.eclipse.uml2.uml.Constraint; +import org.eclipse.uml2.uml.DurationObservation; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.Interaction; +import org.eclipse.uml2.uml.Lifeline; +import org.eclipse.uml2.uml.Message; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.PackageableElement; +import org.eclipse.uml2.uml.TimeObservation; +import org.eclipse.uml2.uml.UMLPackage; + +/** + * @generated + */ +public class UMLDiagramUpdater implements DiagramUpdater { + /** + * @generated + */ + public static final org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramUpdater INSTANCE = new UMLDiagramUpdater(); + + /** + * @generated + */ + protected UMLDiagramUpdater() { + //to prevent instantiation allowing the override + } + + /** + * @generated + */ + public List<UMLNodeDescriptor> getSemanticChildren(View view) { + String vid = UMLVisualIDRegistry.getVisualID(view); + if (vid != null) { + switch (vid) { + case ModelEditPart.VISUAL_ID: + return getPackage_CommunicationDiagram_SemanticChildren(view); + case InteractionCompartmentEditPart.VISUAL_ID: + return getInteraction_SubfragmentCompartment_SemanticChildren(view); + } + } + return Collections.emptyList(); + } + + /** + * @generated + */ + public List<UMLNodeDescriptor> getPackage_CommunicationDiagram_SemanticChildren(View view) { + if (!view.isSetElement()) { + return Collections.emptyList(); + } + Package modelElement = (Package) view.getElement(); + LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>(); + for (Iterator<?> it = modelElement.getPackagedElements() + .iterator(); it.hasNext();) { + PackageableElement childElement = (PackageableElement) it.next(); + String visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement); + if (InteractionEditPart.VISUAL_ID.equals(visualID)) { + result.add(new UMLNodeDescriptor(childElement, visualID)); + continue; + } + } + return result; + } + + /** + * @generated + */ + public List<UMLNodeDescriptor> getInteraction_SubfragmentCompartment_SemanticChildren(View view) { + ICustomDiagramUpdater<UMLNodeDescriptor> customUpdater = new InteractionCompartmentDiagramUpdater(); + return customUpdater.getSemanticChildren(view); + } + + /** + * @generated + */ + public List<UMLLinkDescriptor> getContainedLinks(View view) { + String vid = UMLVisualIDRegistry.getVisualID(view); + if (vid != null) { + switch (vid) { + case ModelEditPart.VISUAL_ID: + return getPackage_CommunicationDiagram_ContainedLinks(view); + case InteractionEditPart.VISUAL_ID: + return getInteraction_Shape_ContainedLinks(view); + case LifelineEditPartCN.VISUAL_ID: + return getLifeline_Shape_ContainedLinks(view); + case ConstraintEditPartCN.VISUAL_ID: + return getConstraint_Shape_ContainedLinks(view); + case CommentEditPartCN.VISUAL_ID: + return getComment_Shape_ContainedLinks(view); + case TimeObservationEditPartCN.VISUAL_ID: + return getTimeObservation_Shape_ContainedLinks(view); + case DurationObservationEditPartCN.VISUAL_ID: + return getDurationObservation_Shape_ContainedLinks(view); + case MessageEditPart.VISUAL_ID: + return getPath_Edge_ContainedLinks(view); + } + } + return Collections.emptyList(); + } + + /** + * @generated + */ + public List<UMLLinkDescriptor> getIncomingLinks(View view) { + String vid = UMLVisualIDRegistry.getVisualID(view); + if (vid != null) { + switch (vid) { + case InteractionEditPart.VISUAL_ID: + return getInteraction_Shape_IncomingLinks(view); + case LifelineEditPartCN.VISUAL_ID: + return getLifeline_Shape_IncomingLinks(view); + case ConstraintEditPartCN.VISUAL_ID: + return getConstraint_Shape_IncomingLinks(view); + case CommentEditPartCN.VISUAL_ID: + return getComment_Shape_IncomingLinks(view); + case TimeObservationEditPartCN.VISUAL_ID: + return getTimeObservation_Shape_IncomingLinks(view); + case DurationObservationEditPartCN.VISUAL_ID: + return getDurationObservation_Shape_IncomingLinks(view); + case MessageEditPart.VISUAL_ID: + return getPath_Edge_IncomingLinks(view); + } + } + return Collections.emptyList(); + } + + /** + * @generated + */ + public List<UMLLinkDescriptor> getOutgoingLinks(View view) { + String vid = UMLVisualIDRegistry.getVisualID(view); + if (vid != null) { + switch (vid) { + case InteractionEditPart.VISUAL_ID: + return getInteraction_Shape_OutgoingLinks(view); + case LifelineEditPartCN.VISUAL_ID: + return getLifeline_Shape_OutgoingLinks(view); + case ConstraintEditPartCN.VISUAL_ID: + return getConstraint_Shape_OutgoingLinks(view); + case CommentEditPartCN.VISUAL_ID: + return getComment_Shape_OutgoingLinks(view); + case TimeObservationEditPartCN.VISUAL_ID: + return getTimeObservation_Shape_OutgoingLinks(view); + case DurationObservationEditPartCN.VISUAL_ID: + return getDurationObservation_Shape_OutgoingLinks(view); + case MessageEditPart.VISUAL_ID: + return getPath_Edge_OutgoingLinks(view); + } + } + return Collections.emptyList(); + } + + /** + * @generated + */ + public List<UMLLinkDescriptor> getPackage_CommunicationDiagram_ContainedLinks(View view) { + return Collections.emptyList(); + } + + /** + * @generated + */ + public List<UMLLinkDescriptor> getInteraction_Shape_ContainedLinks(View view) { + Interaction modelElement = (Interaction) view.getElement(); + LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>(); + result.addAll(getContainedTypeModelFacetLinks_Path_Edge(modelElement)); + return result; + } + + /** + * @generated + */ + public List<UMLLinkDescriptor> getLifeline_Shape_ContainedLinks(View view) { + return Collections.emptyList(); + } + + /** + * @generated + */ + public List<UMLLinkDescriptor> getConstraint_Shape_ContainedLinks(View view) { + Constraint modelElement = (Constraint) view.getElement(); + LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>(); + result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElementEdge(modelElement)); + return result; + } + + /** + * @generated + */ + public List<UMLLinkDescriptor> getComment_Shape_ContainedLinks(View view) { + Comment modelElement = (Comment) view.getElement(); + LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>(); + result.addAll(getOutgoingFeatureModelFacetLinks_Comment_AnnotatedElementEdge(modelElement)); + return result; + } + + /** + * @generated + */ + public List<UMLLinkDescriptor> getTimeObservation_Shape_ContainedLinks(View view) { + TimeObservation modelElement = (TimeObservation) view.getElement(); + LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>(); + result.addAll(getOutgoingFeatureModelFacetLinks_TimeObservation_EventEdge(modelElement)); + return result; + } + + /** + * @generated + */ + public List<UMLLinkDescriptor> getDurationObservation_Shape_ContainedLinks(View view) { + DurationObservation modelElement = (DurationObservation) view.getElement(); + LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>(); + result.addAll(getOutgoingFeatureModelFacetLinks_DurationObservation_EventEdge(modelElement)); + return result; + } + + /** + * @generated + */ + public List<UMLLinkDescriptor> getPath_Edge_ContainedLinks(View view) { + return Collections.emptyList(); + } + + /** + * @generated + */ + public List<UMLLinkDescriptor> getInteraction_Shape_IncomingLinks(View view) { + Interaction modelElement = (Interaction) view.getElement(); + CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet()); + LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>(); + result.addAll(getIncomingTypeModelFacetLinks_Path_Edge(modelElement, crossReferencer)); + result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElementEdge(modelElement, crossReferencer)); + result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElementEdge(modelElement, crossReferencer)); + result.addAll(getIncomingFeatureModelFacetLinks_DurationObservation_EventEdge(modelElement, crossReferencer)); + result.addAll(getIncomingFeatureModelFacetLinks_TimeObservation_EventEdge(modelElement, crossReferencer)); + return result; + } + + /** + * @generated + */ + public List<UMLLinkDescriptor> getLifeline_Shape_IncomingLinks(View view) { + Lifeline modelElement = (Lifeline) view.getElement(); + CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet()); + LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>(); + result.addAll(getIncomingTypeModelFacetLinks_Path_Edge(modelElement, crossReferencer)); + result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElementEdge(modelElement, crossReferencer)); + result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElementEdge(modelElement, crossReferencer)); + result.addAll(getIncomingFeatureModelFacetLinks_DurationObservation_EventEdge(modelElement, crossReferencer)); + result.addAll(getIncomingFeatureModelFacetLinks_TimeObservation_EventEdge(modelElement, crossReferencer)); + return result; + } + + /** + * @generated + */ + public List<UMLLinkDescriptor> getConstraint_Shape_IncomingLinks(View view) { + Constraint modelElement = (Constraint) view.getElement(); + CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet()); + LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>(); + result.addAll(getIncomingTypeModelFacetLinks_Path_Edge(modelElement, crossReferencer)); + result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElementEdge(modelElement, crossReferencer)); + result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElementEdge(modelElement, crossReferencer)); + result.addAll(getIncomingFeatureModelFacetLinks_DurationObservation_EventEdge(modelElement, crossReferencer)); + result.addAll(getIncomingFeatureModelFacetLinks_TimeObservation_EventEdge(modelElement, crossReferencer)); + return result; + } + + /** + * @generated + */ + public List<UMLLinkDescriptor> getComment_Shape_IncomingLinks(View view) { + Comment modelElement = (Comment) view.getElement(); + CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet()); + LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>(); + result.addAll(getIncomingTypeModelFacetLinks_Path_Edge(modelElement, crossReferencer)); + result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElementEdge(modelElement, crossReferencer)); + result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElementEdge(modelElement, crossReferencer)); + return result; + } + + /** + * @generated + */ + public List<UMLLinkDescriptor> getTimeObservation_Shape_IncomingLinks(View view) { + TimeObservation modelElement = (TimeObservation) view.getElement(); + CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet()); + LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>(); + result.addAll(getIncomingTypeModelFacetLinks_Path_Edge(modelElement, crossReferencer)); + result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElementEdge(modelElement, crossReferencer)); + result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElementEdge(modelElement, crossReferencer)); + result.addAll(getIncomingFeatureModelFacetLinks_DurationObservation_EventEdge(modelElement, crossReferencer)); + result.addAll(getIncomingFeatureModelFacetLinks_TimeObservation_EventEdge(modelElement, crossReferencer)); + return result; + } + + /** + * @generated + */ + public List<UMLLinkDescriptor> getDurationObservation_Shape_IncomingLinks(View view) { + DurationObservation modelElement = (DurationObservation) view.getElement(); + CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet()); + LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>(); + result.addAll(getIncomingTypeModelFacetLinks_Path_Edge(modelElement, crossReferencer)); + result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElementEdge(modelElement, crossReferencer)); + result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElementEdge(modelElement, crossReferencer)); + result.addAll(getIncomingFeatureModelFacetLinks_DurationObservation_EventEdge(modelElement, crossReferencer)); + result.addAll(getIncomingFeatureModelFacetLinks_TimeObservation_EventEdge(modelElement, crossReferencer)); + return result; + } + + /** + * @generated + */ + public List<UMLLinkDescriptor> getPath_Edge_IncomingLinks(View view) { + Message modelElement = (Message) view.getElement(); + CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet()); + LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>(); + result.addAll(getIncomingTypeModelFacetLinks_Path_Edge(modelElement, crossReferencer)); + result.addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElementEdge(modelElement, crossReferencer)); + result.addAll(getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElementEdge(modelElement, crossReferencer)); + result.addAll(getIncomingFeatureModelFacetLinks_DurationObservation_EventEdge(modelElement, crossReferencer)); + result.addAll(getIncomingFeatureModelFacetLinks_TimeObservation_EventEdge(modelElement, crossReferencer)); + return result; + } + + /** + * @generated + */ + public List<UMLLinkDescriptor> getInteraction_Shape_OutgoingLinks(View view) { + Interaction modelElement = (Interaction) view.getElement(); + LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>(); + result.addAll(getOutgoingTypeModelFacetLinks_Path_Edge(modelElement)); + return result; + } + + /** + * @generated + */ + public List<UMLLinkDescriptor> getLifeline_Shape_OutgoingLinks(View view) { + Lifeline modelElement = (Lifeline) view.getElement(); + LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>(); + result.addAll(getOutgoingTypeModelFacetLinks_Path_Edge(modelElement)); + return result; + } + + /** + * @generated + */ + public List<UMLLinkDescriptor> getConstraint_Shape_OutgoingLinks(View view) { + Constraint modelElement = (Constraint) view.getElement(); + LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>(); + result.addAll(getOutgoingTypeModelFacetLinks_Path_Edge(modelElement)); + result.addAll(getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElementEdge(modelElement)); + return result; + } + + /** + * @generated + */ + public List<UMLLinkDescriptor> getComment_Shape_OutgoingLinks(View view) { + Comment modelElement = (Comment) view.getElement(); + LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>(); + result.addAll(getOutgoingTypeModelFacetLinks_Path_Edge(modelElement)); + result.addAll(getOutgoingFeatureModelFacetLinks_Comment_AnnotatedElementEdge(modelElement)); + return result; + } + + /** + * @generated + */ + public List<UMLLinkDescriptor> getTimeObservation_Shape_OutgoingLinks(View view) { + TimeObservation modelElement = (TimeObservation) view.getElement(); + LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>(); + result.addAll(getOutgoingTypeModelFacetLinks_Path_Edge(modelElement)); + result.addAll(getOutgoingFeatureModelFacetLinks_TimeObservation_EventEdge(modelElement)); + return result; + } + + /** + * @generated + */ + public List<UMLLinkDescriptor> getDurationObservation_Shape_OutgoingLinks(View view) { + DurationObservation modelElement = (DurationObservation) view.getElement(); + LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>(); + result.addAll(getOutgoingTypeModelFacetLinks_Path_Edge(modelElement)); + result.addAll(getOutgoingFeatureModelFacetLinks_DurationObservation_EventEdge(modelElement)); + return result; + } + + /** + * @generated + */ + public List<UMLLinkDescriptor> getPath_Edge_OutgoingLinks(View view) { + Message modelElement = (Message) view.getElement(); + LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>(); + result.addAll(getOutgoingTypeModelFacetLinks_Path_Edge(modelElement)); + return result; + } + + /** + * @generated + */ + protected Collection<UMLLinkDescriptor> getContainedTypeModelFacetLinks_Path_Edge(Interaction container) { + LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>(); + for (Iterator<?> links = container.getMessages() + .iterator(); links.hasNext();) { + EObject linkObject = (EObject) links.next(); + if (false == linkObject instanceof Message) { + continue; + } + Message link = (Message) linkObject; + if (!MessageEditPart.VISUAL_ID.equals(UMLVisualIDRegistry.getLinkWithClassVisualID(link))) { + continue; + } + List<?> targets = link.getOwnedElements(); + Object theTarget = targets.size() == 1 ? targets.get(0) : null; + if (false == theTarget instanceof Element) { + continue; + } + Element dst = (Element) theTarget; + Element src = link.getOwner(); + result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Path_Edge, MessageEditPart.VISUAL_ID)); + } + return result; + } + + /** + * @generated + */ + protected Collection<UMLLinkDescriptor> getIncomingTypeModelFacetLinks_Path_Edge(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.getElement_OwnedElement() || false == setting.getEObject() instanceof Message) { + continue; + } + Message link = (Message) setting.getEObject(); + if (!MessageEditPart.VISUAL_ID.equals(UMLVisualIDRegistry.getLinkWithClassVisualID(link))) { + continue; + } + Element src = link.getOwner(); + result.add(new UMLLinkDescriptor(src, target, link, UMLElementTypes.Path_Edge, MessageEditPart.VISUAL_ID)); + } + return result; + } + + /** + * @generated + */ + protected Collection<UMLLinkDescriptor> getIncomingFeatureModelFacetLinks_Comment_AnnotatedElementEdge( + 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()) { + result.add(new UMLLinkDescriptor(setting.getEObject(), target, UMLElementTypes.Comment_AnnotatedElementEdge, CommentAnnotatedElementEditPart.VISUAL_ID)); + } + } + return result; + } + + /** + * @generated + */ + protected Collection<UMLLinkDescriptor> getIncomingFeatureModelFacetLinks_Constraint_ConstrainedElementEdge( + 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()) { + result.add(new UMLLinkDescriptor(setting.getEObject(), target, UMLElementTypes.Constraint_ConstrainedElementEdge, ConstraintConstrainedElementEditPart.VISUAL_ID)); + } + } + return result; + } + + /** + * @generated + */ + protected Collection<UMLLinkDescriptor> getIncomingFeatureModelFacetLinks_DurationObservation_EventEdge( + 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()) { + result.add(new UMLLinkDescriptor(setting.getEObject(), target, UMLElementTypes.DurationObservation_EventEdge, ConnectorDurationObservationEditPart.VISUAL_ID)); + } + } + return result; + } + + /** + * @generated + */ + protected Collection<UMLLinkDescriptor> getIncomingFeatureModelFacetLinks_TimeObservation_EventEdge( + 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()) { + result.add(new UMLLinkDescriptor(setting.getEObject(), target, UMLElementTypes.TimeObservation_EventEdge, ConnectorTimeObservationEditPart.VISUAL_ID)); + } + } + return result; + } + + /** + * @generated + */ + protected Collection<UMLLinkDescriptor> getOutgoingTypeModelFacetLinks_Path_Edge(Element source) { + Interaction container = null; + // Find container element for the link. + // Climb up by containment hierarchy starting from the source + // and return the first element that is instance of the container class. + for (EObject element = source; element != null && container == null; element = element.eContainer()) { + if (element instanceof Interaction) { + container = (Interaction) element; + } + } + if (container == null) { + return Collections.emptyList(); + } + LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>(); + for (Iterator<?> links = container.getMessages() + .iterator(); links.hasNext();) { + EObject linkObject = (EObject) links.next(); + if (false == linkObject instanceof Message) { + continue; + } + Message link = (Message) linkObject; + if (!MessageEditPart.VISUAL_ID.equals(UMLVisualIDRegistry.getLinkWithClassVisualID(link))) { + continue; + } + List<?> targets = link.getOwnedElements(); + Object theTarget = targets.size() == 1 ? targets.get(0) : null; + if (false == theTarget instanceof Element) { + continue; + } + Element dst = (Element) theTarget; + Element src = link.getOwner(); + if (src != source) { + continue; + } + result.add(new UMLLinkDescriptor(src, dst, link, UMLElementTypes.Path_Edge, MessageEditPart.VISUAL_ID)); + } + return result; + } + + /** + * @generated + */ + protected Collection<UMLLinkDescriptor> getOutgoingFeatureModelFacetLinks_Comment_AnnotatedElementEdge( + Comment source) { + LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>(); + for (Iterator<?> destinations = source.getAnnotatedElements() + .iterator(); destinations.hasNext();) { + Element destination = (Element) destinations.next(); + result.add(new UMLLinkDescriptor(source, destination, UMLElementTypes.Comment_AnnotatedElementEdge, CommentAnnotatedElementEditPart.VISUAL_ID)); + } + return result; + } + + /** + * @generated + */ + protected Collection<UMLLinkDescriptor> getOutgoingFeatureModelFacetLinks_Constraint_ConstrainedElementEdge( + Constraint source) { + LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>(); + for (Iterator<?> destinations = source.getConstrainedElements() + .iterator(); destinations.hasNext();) { + Element destination = (Element) destinations.next(); + result.add(new UMLLinkDescriptor(source, destination, UMLElementTypes.Constraint_ConstrainedElementEdge, ConstraintConstrainedElementEditPart.VISUAL_ID)); + } + return result; + } + + /** + * @generated + */ + protected Collection<UMLLinkDescriptor> getOutgoingFeatureModelFacetLinks_DurationObservation_EventEdge( + DurationObservation source) { + LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>(); + for (Iterator<?> destinations = source.getEvents() + .iterator(); destinations.hasNext();) { + NamedElement destination = (NamedElement) destinations.next(); + result.add(new UMLLinkDescriptor(source, destination, UMLElementTypes.DurationObservation_EventEdge, ConnectorDurationObservationEditPart.VISUAL_ID)); + } + return result; + } + + /** + * @generated + */ + protected Collection<UMLLinkDescriptor> getOutgoingFeatureModelFacetLinks_TimeObservation_EventEdge( + TimeObservation source) { + LinkedList<UMLLinkDescriptor> result = new LinkedList<UMLLinkDescriptor>(); + NamedElement destination = source.getEvent(); + if (destination == null) { + return result; + } + result.add(new UMLLinkDescriptor(source, destination, UMLElementTypes.TimeObservation_EventEdge, ConnectorTimeObservationEditPart.VISUAL_ID)); + return result; + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLDocumentProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLDocumentProvider.java index f7a69b967dc..b893e4f5a76 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLDocumentProvider.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLDocumentProvider.java @@ -1,1011 +1,1011 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.part;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceStatus;
-import org.eclipse.core.resources.IStorage;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.core.runtime.jobs.MultiRule;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.ui.URIEditorInput;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.util.EContentAdapter;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.transaction.NotificationFilter;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.diagram.core.DiagramEditingDomainFactory;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.AbstractDocumentProvider;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.DiagramDocument;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocument;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocumentProvider;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDocument;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.internal.EditorStatusCodes;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.internal.util.DiagramIOUtil;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.core.resources.GMFResourceFactory;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.part.FileEditorInput;
-
-/**
- * @generated
- */
-public class UMLDocumentProvider extends AbstractDocumentProvider implements IDiagramDocumentProvider {
-
- /**
- * @generated
- */
- protected ElementInfo createElementInfo(Object element) throws CoreException {
- if (false == element instanceof FileEditorInput && false == element instanceof URIEditorInput) {
- throw new CoreException(new Status(IStatus.ERROR, 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);
-
- ResourceSetInfo info = new ResourceSetInfo(document, editorInput);
- info.setModificationStamp(computeModificationStamp(info));
- info.fStatus = null;
- return info;
- }
-
- /**
- * @generated
- */
- protected IDocument createDocument(Object element) throws CoreException {
- if (false == element instanceof FileEditorInput && false == element instanceof URIEditorInput) {
- throw new CoreException(new Status(IStatus.ERROR, 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);
- setupDocument(element, document);
- return document;
- }
-
- /**
- * Sets up the given document as it would be provided for the given element. The
- * content of the document is not changed. This default implementation is empty.
- * Subclasses may reimplement.
- *
- * @param element the blue-print element
- * @param document the document to set up
- * @generated
- */
- protected void setupDocument(Object element, IDocument document) {
- // for subclasses
- }
-
- /**
- * @generated
- */
- private long computeModificationStamp(ResourceSetInfo info) {
- int result = 0;
- for (Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
- Resource nextResource = it.next();
- IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if (file != null) {
- if (file.getLocation() != null) {
- result += file.getLocation().toFile().lastModified();
- } else {
- result += file.getModificationStamp();
- }
- }
- }
- return result;
- }
-
- /**
- * @generated
- */
- protected IDocument createEmptyDocument() {
- DiagramDocument document = new DiagramDocument();
- document.setEditingDomain(createEditingDomain());
- return document;
- }
-
- /**
- * @generated
- */
- private TransactionalEditingDomain createEditingDomain() {
- TransactionalEditingDomain editingDomain = DiagramEditingDomainFactory.getInstance().createEditingDomain();
- editingDomain.setID("org.eclipse.papyrus.uml.diagram.communication.EditingDomain"); //$NON-NLS-1$
- final NotificationFilter diagramResourceModifiedFilter = NotificationFilter.createNotifierFilter(editingDomain.getResourceSet()).and(NotificationFilter.createEventTypeFilter(Notification.ADD))
- .and(NotificationFilter.createFeatureFilter(ResourceSet.class, ResourceSet.RESOURCE_SET__RESOURCES));
- editingDomain.getResourceSet().eAdapters().add(new Adapter() {
-
- private Notifier myTarger;
-
- @Override
- public Notifier getTarget() {
- return myTarger;
- }
-
- @Override
- public boolean isAdapterForType(Object type) {
- return false;
- }
-
- @Override
- public void notifyChanged(Notification notification) {
- if (diagramResourceModifiedFilter.matches(notification)) {
- Object value = notification.getNewValue();
- if (value instanceof Resource) {
- ((Resource) value).setTrackingModification(true);
- }
- }
- }
-
- @Override
- public void setTarget(Notifier newTarget) {
- myTarger = newTarget;
- }
-
- });
-
- return editingDomain;
- }
-
- /**
- * @generated
- */
- protected void setDocumentContent(IDocument document, IEditorInput element) throws CoreException {
- IDiagramDocument diagramDocument = (IDiagramDocument) document;
- TransactionalEditingDomain domain = diagramDocument.getEditingDomain();
- if (element instanceof FileEditorInput) {
- IStorage storage = ((FileEditorInput) element).getStorage();
- Diagram diagram = DiagramIOUtil.load(domain, storage, true, getProgressMonitor());
- document.setContent(diagram);
- } else if (element instanceof URIEditorInput) {
- URI uri = ((URIEditorInput) element).getURI();
- Resource resource = null;
- try {
- resource = domain.getResourceSet().getResource(uri.trimFragment(), false);
- if (resource == null) {
- resource = domain.getResourceSet().createResource(uri.trimFragment());
- }
- if (!resource.isLoaded()) {
- try {
- @SuppressWarnings({ "rawtypes", "unchecked" })
- Map<?, ?> options = new HashMap(GMFResourceFactory.getDefaultLoadOptions());
- // @see 171060
- // options.put(org.eclipse.emf.ecore.xmi.XMLResource.OPTION_RECORD_UNKNOWN_FEATURE, Boolean.TRUE);
- resource.load(options);
- } catch (IOException e) {
- resource.unload();
- throw e;
- }
- }
- if (uri.fragment() != null) {
- EObject rootElement = resource.getEObject(uri.fragment());
- if (rootElement instanceof Diagram) {
- document.setContent(rootElement);
- return;
- }
- } else {
- for (Iterator<EObject> it = resource.getContents().iterator(); it.hasNext();) {
- Object rootElement = it.next();
- if (rootElement instanceof Diagram) {
- document.setContent(rootElement);
- return;
- }
- }
- }
- throw new RuntimeException(Messages.UMLDocumentProvider_NoDiagramInResourceError);
- } catch (Exception e) {
- CoreException thrownExcp = null;
- if (e instanceof CoreException) {
- thrownExcp = (CoreException) e;
- } else {
- String msg = e.getLocalizedMessage();
- thrownExcp = new CoreException(new Status(IStatus.ERROR, 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));
- }
- }
-
- /**
- * @generated
- */
- public long getModificationStamp(Object element) {
- ResourceSetInfo info = getResourceSetInfo(element);
- if (info != null) {
- return computeModificationStamp(info);
- }
- return super.getModificationStamp(element);
- }
-
- /**
- * @generated
- */
- public boolean isDeleted(Object element) {
- IDiagramDocument document = getDiagramDocument(element);
- if (document != null) {
- Resource diagramResource = document.getDiagram().eResource();
- if (diagramResource != null) {
- IFile file = WorkspaceSynchronizer.getFile(diagramResource);
- return file == null || file.getLocation() == null || !file.getLocation().toFile().exists();
- }
- }
- return super.isDeleted(element);
- }
-
- /**
- * @generated
- */
- public ResourceSetInfo getResourceSetInfo(Object editorInput) {
- return (ResourceSetInfo) super.getElementInfo(editorInput);
- }
-
- /**
- * @generated
- */
- protected void disposeElementInfo(Object element, ElementInfo info) {
- if (info instanceof ResourceSetInfo) {
- ResourceSetInfo resourceSetInfo = (ResourceSetInfo) info;
- resourceSetInfo.dispose();
- }
- super.disposeElementInfo(element, info);
- }
-
- /**
- * @generated
- */
- protected void doValidateState(Object element, Object computationContext) throws CoreException {
- ResourceSetInfo info = getResourceSetInfo(element);
- if (info != null) {
- LinkedList<IFile> files2Validate = new LinkedList<IFile>();
- for (Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
- Resource nextResource = it.next();
- IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if (file != null && file.isReadOnly()) {
- files2Validate.add(file);
- }
- }
- ResourcesPlugin.getWorkspace().validateEdit(files2Validate.toArray(new IFile[files2Validate.size()]), computationContext);
- }
-
- super.doValidateState(element, computationContext);
- }
-
- /**
- * @generated
- */
- public boolean isReadOnly(Object element) {
- ResourceSetInfo info = getResourceSetInfo(element);
- if (info != null) {
- if (info.isUpdateCache()) {
- try {
- updateCache(element);
- } catch (CoreException ex) {
- UMLDiagramEditorPlugin.getInstance().logError(Messages.UMLDocumentProvider_isModifiable, ex);
- // Error message to log was initially taken from org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.internal.l10n.EditorMessages.StorageDocumentProvider_isModifiable
- }
- }
- return info.isReadOnly();
- }
- return super.isReadOnly(element);
- }
-
- /**
- * @generated
- */
- public boolean isModifiable(Object element) {
- if (!isStateValidated(element)) {
- if (element instanceof FileEditorInput || element instanceof URIEditorInput) {
- return true;
- }
- }
- ResourceSetInfo info = getResourceSetInfo(element);
- if (info != null) {
- if (info.isUpdateCache()) {
- try {
- updateCache(element);
- } catch (CoreException ex) {
- UMLDiagramEditorPlugin.getInstance().logError(Messages.UMLDocumentProvider_isModifiable, ex);
- // Error message to log was initially taken from org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.internal.l10n.EditorMessages.StorageDocumentProvider_isModifiable
- }
- }
- return info.isModifiable();
- }
- return super.isModifiable(element);
- }
-
- /**
- * @generated
- */
- protected void updateCache(Object element) throws CoreException {
- ResourceSetInfo info = getResourceSetInfo(element);
- if (info != null) {
- for (Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
- Resource nextResource = it.next();
- IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if (file != null && file.isReadOnly()) {
- info.setReadOnly(true);
- info.setModifiable(false);
- return;
- }
- }
- info.setReadOnly(false);
- info.setModifiable(true);
- return;
- }
- }
-
- /**
- * @generated
- */
- protected void doUpdateStateCache(Object element) throws CoreException {
- ResourceSetInfo info = getResourceSetInfo(element);
- if (info != null) {
- info.setUpdateCache(true);
- }
- super.doUpdateStateCache(element);
- }
-
- /**
- * @generated
- */
- public boolean isSynchronized(Object element) {
- ResourceSetInfo info = getResourceSetInfo(element);
- if (info != null) {
- return info.isSynchronized();
- }
- return super.isSynchronized(element);
- }
-
- /**
- * @generated
- */
- protected ISchedulingRule getResetRule(Object element) {
- ResourceSetInfo info = getResourceSetInfo(element);
- if (info != null) {
- LinkedList<ISchedulingRule> rules = new LinkedList<ISchedulingRule>();
- for (Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
- Resource nextResource = it.next();
- IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if (file != null) {
- rules.add(ResourcesPlugin.getWorkspace().getRuleFactory().modifyRule(file));
- }
- }
- return new MultiRule(rules.toArray(new ISchedulingRule[rules.size()]));
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected ISchedulingRule getSaveRule(Object element) {
- ResourceSetInfo info = getResourceSetInfo(element);
- if (info != null) {
- LinkedList<ISchedulingRule> rules = new LinkedList<ISchedulingRule>();
- for (Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
- Resource nextResource = it.next();
- IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if (file != null) {
- rules.add(computeSchedulingRule(file));
- }
- }
- return new MultiRule(rules.toArray(new ISchedulingRule[rules.size()]));
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected ISchedulingRule getSynchronizeRule(Object element) {
- ResourceSetInfo info = getResourceSetInfo(element);
- if (info != null) {
- LinkedList<ISchedulingRule> rules = new LinkedList<ISchedulingRule>();
- for (Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
- Resource nextResource = it.next();
- IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if (file != null) {
- rules.add(ResourcesPlugin.getWorkspace().getRuleFactory().refreshRule(file));
- }
- }
- return new MultiRule(rules.toArray(new ISchedulingRule[rules.size()]));
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected ISchedulingRule getValidateStateRule(Object element) {
- ResourceSetInfo info = getResourceSetInfo(element);
- if (info != null) {
- LinkedList<ISchedulingRule> files = new LinkedList<ISchedulingRule>();
- for (Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
- Resource nextResource = it.next();
- IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if (file != null) {
- files.add(file);
- }
- }
- return ResourcesPlugin.getWorkspace().getRuleFactory().validateEditRule(files.toArray(new IFile[files.size()]));
- }
- return null;
- }
-
- /**
- * @generated
- */
- private ISchedulingRule computeSchedulingRule(IResource toCreateOrModify) {
- if (toCreateOrModify.exists()) {
- return ResourcesPlugin.getWorkspace().getRuleFactory().modifyRule(toCreateOrModify);
- }
- IResource parent = toCreateOrModify;
- do {
- /*
- * XXX This is a workaround for
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=67601
- * IResourceRuleFactory.createRule should iterate the hierarchy
- * itself.
- */
- toCreateOrModify = parent;
- parent = toCreateOrModify.getParent();
- } while (parent != null && !parent.exists());
-
- return ResourcesPlugin.getWorkspace().getRuleFactory().createRule(toCreateOrModify);
- }
-
- /**
- * @generated
- */
- protected void doSynchronize(Object element, IProgressMonitor monitor) throws CoreException {
- ResourceSetInfo info = getResourceSetInfo(element);
- if (info != null) {
- for (Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
- Resource nextResource = it.next();
- handleElementChanged(info, nextResource, monitor);
- }
- return;
- }
- super.doSynchronize(element, monitor);
- }
-
- /**
- * @generated
- */
- protected void doSaveDocument(IProgressMonitor monitor, Object element, IDocument document, boolean overwrite)
- throws CoreException {
- ResourceSetInfo info = getResourceSetInfo(element);
- if (info != null) {
- if (!overwrite && !info.isSynchronized()) {
- throw new CoreException(new Status(IStatus.ERROR, 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();) {
- Resource nextResource = it.next();
- monitor.setTaskName(NLS.bind(
- Messages.UMLDocumentProvider_SaveNextResourceTask,
- nextResource.getURI()));
- if (nextResource.isLoaded() && !info.getEditingDomain().isReadOnly(nextResource)) {
- try {
- nextResource.save(UMLDiagramEditorUtil.getSaveOptions());
- } catch (IOException e) {
- fireElementStateChangeFailed(element);
- throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, EditorStatusCodes.RESOURCE_FAILURE, e.getLocalizedMessage(), null));
- }
- }
- monitor.worked(1);
- }
- monitor.done();
- info.setModificationStamp(computeModificationStamp(info));
- } catch (RuntimeException x) {
- fireElementStateChangeFailed(element);
- throw x;
- } finally {
- info.startResourceListening();
- }
- } else {
- URI newResoruceURI;
- List<IFile> affectedFiles = null;
- if (element instanceof FileEditorInput) {
- IFile newFile = ((FileEditorInput) element).getFile();
- affectedFiles = Collections.singletonList(newFile);
- newResoruceURI = URI.createPlatformResourceURI(newFile.getFullPath().toString(), true);
- } else if (element instanceof URIEditorInput) {
- newResoruceURI = ((URIEditorInput) element).getURI();
- } else {
- fireElementStateChangeFailed(element);
- throw new CoreException(new Status(IStatus.ERROR, 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) {
- 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$
- }
- 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);
- return CommandResult.newOKCommandResult();
- }
- }.execute(monitor, null);
- newResource.save(UMLDiagramEditorUtil.getSaveOptions());
- } catch (ExecutionException e) {
- fireElementStateChangeFailed(element);
- throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, 0, e.getLocalizedMessage(), null));
- } catch (IOException e) {
- fireElementStateChangeFailed(element);
- throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, 0, e.getLocalizedMessage(), null));
- }
- newResource.unload();
- }
- }
-
- /**
- * @generated
- */
- protected void handleElementChanged(ResourceSetInfo info, Resource changedResource, IProgressMonitor monitor) {
- IFile file = WorkspaceSynchronizer.getFile(changedResource);
- if (file != null) {
- try {
- file.refreshLocal(IResource.DEPTH_INFINITE, monitor);
- } catch (CoreException ex) {
- UMLDiagramEditorPlugin.getInstance().logError(Messages.UMLDocumentProvider_handleElementContentChanged, ex);
- // Error message to log was initially taken from org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.internal.l10n.EditorMessages.FileDocumentProvider_handleElementContentChanged
- }
- }
- changedResource.unload();
-
- fireElementContentAboutToBeReplaced(info.getEditorInput());
- removeUnchangedElementListeners(info.getEditorInput(), info);
- info.fStatus = null;
- try {
- setDocumentContent(info.fDocument, info.getEditorInput());
- } catch (CoreException e) {
- info.fStatus = e.getStatus();
- }
- if (!info.fCanBeSaved) {
- info.setModificationStamp(computeModificationStamp(info));
- }
- addUnchangedElementListeners(info.getEditorInput(), info);
- fireElementContentReplaced(info.getEditorInput());
- }
-
- /**
- * @generated
- */
- protected void handleElementMoved(IEditorInput input, URI uri) {
- if (input instanceof FileEditorInput) {
- IFile newFile = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(URI.decode(uri.path())).removeFirstSegments(1));
- fireElementMoved(input, newFile == null ? null : new FileEditorInput(newFile));
- return;
- }
- // TODO: append suffix to the URI! (use diagram as a parameter)
- fireElementMoved(input, new URIEditorInput(uri));
- }
-
- /**
- * @generated
- */
- public IEditorInput createInputWithEditingDomain(IEditorInput editorInput, TransactionalEditingDomain domain) {
- return editorInput;
- }
-
- /**
- * @generated
- */
- public IDiagramDocument getDiagramDocument(Object element) {
- IDocument doc = getDocument(element);
- if (doc instanceof IDiagramDocument) {
- return (IDiagramDocument) doc;
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected IRunnableContext getOperationRunner(IProgressMonitor monitor) {
- return null;
- }
-
- /**
- * @generated
- */
- protected class ResourceSetInfo extends ElementInfo {
-
- /**
- * @generated
- */
- private long myModificationStamp = IResource.NULL_STAMP;
-
- /**
- * @generated
- */
- private WorkspaceSynchronizer mySynchronizer;
-
- /**
- * @generated
- */
- private LinkedList<Resource> myUnSynchronizedResources = new LinkedList<Resource>();
-
- /**
- * @generated
- */
- private IDiagramDocument myDocument;
-
- /**
- * @generated
- */
- private IEditorInput myEditorInput;
-
- /**
- * @generated
- */
- private boolean myUpdateCache = true;
-
- /**
- * @generated
- */
- private boolean myModifiable = false;
-
- /**
- * @generated
- */
- private boolean myReadOnly = true;
-
- /**
- * @generated
- */
- private ResourceSetModificationListener myResourceSetListener;
-
- /**
- * @generated
- */
- public ResourceSetInfo(IDiagramDocument document, IEditorInput editorInput) {
- super(document);
- myDocument = document;
- myEditorInput = editorInput;
- startResourceListening();
- myResourceSetListener = new ResourceSetModificationListener(this);
- getResourceSet().eAdapters().add(myResourceSetListener);
- }
-
- /**
- * @generated
- */
- public long getModificationStamp() {
- return myModificationStamp;
- }
-
- /**
- * @generated
- */
- public void setModificationStamp(long modificationStamp) {
- myModificationStamp = modificationStamp;
- }
-
- /**
- * @generated
- */
- public TransactionalEditingDomain getEditingDomain() {
- return myDocument.getEditingDomain();
- }
-
- /**
- * @generated
- */
- public ResourceSet getResourceSet() {
- return getEditingDomain().getResourceSet();
- }
-
- /**
- * @generated
- */
- public Iterator<Resource> getLoadedResourcesIterator() {
- return new ArrayList<Resource>(getResourceSet().getResources()).iterator();
- }
-
- /**
- * @generated
- */
- public IEditorInput getEditorInput() {
- return myEditorInput;
- }
-
- /**
- * @generated
- */
- public void dispose() {
- stopResourceListening();
- getResourceSet().eAdapters().remove(myResourceSetListener);
- for (Iterator<Resource> it = getLoadedResourcesIterator(); it.hasNext();) {
- Resource resource = it.next();
- resource.unload();
- }
- getEditingDomain().dispose();
- }
-
- /**
- * @generated
- */
- public boolean isSynchronized() {
- return myUnSynchronizedResources.size() == 0;
- }
-
- /**
- * @generated
- */
- public void setUnSynchronized(Resource resource) {
- myUnSynchronizedResources.add(resource);
- }
-
- /**
- * @generated
- */
- public void setSynchronized(Resource resource) {
- myUnSynchronizedResources.remove(resource);
- }
-
- /**
- * @generated
- */
- public final void stopResourceListening() {
- mySynchronizer.dispose();
- mySynchronizer = null;
- }
-
- /**
- * @generated
- */
- public final void startResourceListening() {
- mySynchronizer = new WorkspaceSynchronizer(getEditingDomain(), new SynchronizerDelegate());
- }
-
- /**
- * @generated
- */
- public boolean isUpdateCache() {
- return myUpdateCache;
- }
-
- /**
- * @generated
- */
- public void setUpdateCache(boolean update) {
- myUpdateCache = update;
- }
-
- /**
- * @generated
- */
- public boolean isModifiable() {
- return myModifiable;
- }
-
- /**
- * @generated
- */
- public void setModifiable(boolean modifiable) {
- myModifiable = modifiable;
- }
-
- /**
- * @generated
- */
- public boolean isReadOnly() {
- return myReadOnly;
- }
-
- /**
- * @generated
- */
- public void setReadOnly(boolean readOnly) {
- myReadOnly = readOnly;
- }
-
- /**
- * @generated
- */
- private class SynchronizerDelegate implements WorkspaceSynchronizer.Delegate {
-
- /**
- * @generated
- */
- public void dispose() {
- }
-
- /**
- * @generated
- */
- public boolean handleResourceChanged(final Resource resource) {
- synchronized (ResourceSetInfo.this) {
- if (ResourceSetInfo.this.fCanBeSaved) {
- ResourceSetInfo.this.setUnSynchronized(resource);
- return true;
- }
- }
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- handleElementChanged(ResourceSetInfo.this, resource, null);
- }
- });
- return true;
- }
-
- /**
- * @generated
- */
- public boolean handleResourceDeleted(Resource resource) {
- synchronized (ResourceSetInfo.this) {
- if (ResourceSetInfo.this.fCanBeSaved) {
- ResourceSetInfo.this.setUnSynchronized(resource);
- return true;
- }
- }
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- fireElementDeleted(ResourceSetInfo.this.getEditorInput());
- }
- });
- return true;
- }
-
- /**
- * @generated
- */
- public boolean handleResourceMoved(Resource resource, final URI newURI) {
- synchronized (ResourceSetInfo.this) {
- if (ResourceSetInfo.this.fCanBeSaved) {
- ResourceSetInfo.this.setUnSynchronized(resource);
- return true;
- }
- }
- if (myDocument.getDiagram().eResource() == resource) {
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- handleElementMoved(ResourceSetInfo.this.getEditorInput(), newURI);
- }
- });
- } else {
- handleResourceDeleted(resource);
- }
- return true;
- }
-
- }
-
- }
-
- /**
- * @generated
- */
- private class ResourceSetModificationListener extends EContentAdapter {
-
- /**
- * @generated
- */
- private NotificationFilter myModifiedFilter;
-
- /**
- * @generated
- */
- private ResourceSetInfo myInfo;
-
- /**
- * @generated
- */
- public ResourceSetModificationListener(ResourceSetInfo info) {
- myInfo = info;
- myModifiedFilter = NotificationFilter.createEventTypeFilter(Notification.SET).or(NotificationFilter.createEventTypeFilter(Notification.UNSET)).and(NotificationFilter.createFeatureFilter(Resource.class, Resource.RESOURCE__IS_MODIFIED));
- }
-
- /**
- * @generated
- */
- public void notifyChanged(Notification notification) {
- if (notification.getNotifier() instanceof ResourceSet) {
- super.notifyChanged(notification);
- }
- if (!notification.isTouch() && myModifiedFilter.matches(notification)) {
- if (notification.getNotifier() instanceof Resource) {
- Resource resource = (Resource) notification.getNotifier();
- if (resource.isLoaded()) {
- boolean modified = false;
- for (Iterator<Resource> it = myInfo.getLoadedResourcesIterator(); it.hasNext() && !modified;) {
- Resource nextResource = it.next();
- if (nextResource.isLoaded()) {
- modified = nextResource.isModified();
- }
- }
- boolean dirtyStateChanged = false;
- synchronized (myInfo) {
- if (modified != myInfo.fCanBeSaved) {
- myInfo.fCanBeSaved = modified;
- dirtyStateChanged = true;
- }
- if (!resource.isModified()) {
- myInfo.setSynchronized(resource);
- }
- }
- if (dirtyStateChanged) {
- fireElementDirtyStateChanged(myInfo.getEditorInput(), modified);
-
- if (!modified) {
- myInfo.setModificationStamp(computeModificationStamp(myInfo));
- }
- }
- }
- }
- }
- }
-
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.part; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.IResourceStatus; +import org.eclipse.core.resources.IStorage; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Path; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.ISchedulingRule; +import org.eclipse.core.runtime.jobs.MultiRule; +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.Notifier; +import org.eclipse.emf.common.ui.URIEditorInput; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.util.EContentAdapter; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.emf.transaction.NotificationFilter; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.emf.workspace.util.WorkspaceSynchronizer; +import org.eclipse.gmf.runtime.common.core.command.CommandResult; +import org.eclipse.gmf.runtime.diagram.core.DiagramEditingDomainFactory; +import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.AbstractDocumentProvider; +import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.DiagramDocument; +import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocument; +import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocumentProvider; +import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDocument; +import org.eclipse.gmf.runtime.diagram.ui.resources.editor.internal.EditorStatusCodes; +import org.eclipse.gmf.runtime.diagram.ui.resources.editor.internal.util.DiagramIOUtil; +import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand; +import org.eclipse.gmf.runtime.emf.core.resources.GMFResourceFactory; +import org.eclipse.gmf.runtime.notation.Diagram; +import org.eclipse.jface.operation.IRunnableContext; +import org.eclipse.osgi.util.NLS; +import org.eclipse.swt.widgets.Display; +import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.part.FileEditorInput; + +/** + * @generated + */ +public class UMLDocumentProvider extends AbstractDocumentProvider implements IDiagramDocumentProvider { + + /** + * @generated + */ + protected ElementInfo createElementInfo(Object element) throws CoreException { + if (false == element instanceof FileEditorInput && false == element instanceof URIEditorInput) { + throw new CoreException(new Status(IStatus.ERROR, 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); + + ResourceSetInfo info = new ResourceSetInfo(document, editorInput); + info.setModificationStamp(computeModificationStamp(info)); + info.fStatus = null; + return info; + } + + /** + * @generated + */ + protected IDocument createDocument(Object element) throws CoreException { + if (false == element instanceof FileEditorInput && false == element instanceof URIEditorInput) { + throw new CoreException(new Status(IStatus.ERROR, 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); + setupDocument(element, document); + return document; + } + + /** + * Sets up the given document as it would be provided for the given element. The + * content of the document is not changed. This default implementation is empty. + * Subclasses may reimplement. + * + * @param element the blue-print element + * @param document the document to set up + * @generated + */ + protected void setupDocument(Object element, IDocument document) { + // for subclasses + } + + /** + * @generated + */ + private long computeModificationStamp(ResourceSetInfo info) { + int result = 0; + for (Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) { + Resource nextResource = it.next(); + IFile file = WorkspaceSynchronizer.getFile(nextResource); + if (file != null) { + if (file.getLocation() != null) { + result += file.getLocation().toFile().lastModified(); + } else { + result += file.getModificationStamp(); + } + } + } + return result; + } + + /** + * @generated + */ + protected IDocument createEmptyDocument() { + DiagramDocument document = new DiagramDocument(); + document.setEditingDomain(createEditingDomain()); + return document; + } + + /** + * @generated + */ + private TransactionalEditingDomain createEditingDomain() { + TransactionalEditingDomain editingDomain = DiagramEditingDomainFactory.getInstance().createEditingDomain(); + editingDomain.setID("org.eclipse.papyrus.uml.diagram.communication.EditingDomain"); //$NON-NLS-1$ + final NotificationFilter diagramResourceModifiedFilter = NotificationFilter.createNotifierFilter(editingDomain.getResourceSet()).and(NotificationFilter.createEventTypeFilter(Notification.ADD)) + .and(NotificationFilter.createFeatureFilter(ResourceSet.class, ResourceSet.RESOURCE_SET__RESOURCES)); + editingDomain.getResourceSet().eAdapters().add(new Adapter() { + + private Notifier myTarger; + + @Override + public Notifier getTarget() { + return myTarger; + } + + @Override + public boolean isAdapterForType(Object type) { + return false; + } + + @Override + public void notifyChanged(Notification notification) { + if (diagramResourceModifiedFilter.matches(notification)) { + Object value = notification.getNewValue(); + if (value instanceof Resource) { + ((Resource) value).setTrackingModification(true); + } + } + } + + @Override + public void setTarget(Notifier newTarget) { + myTarger = newTarget; + } + + }); + + return editingDomain; + } + + /** + * @generated + */ + protected void setDocumentContent(IDocument document, IEditorInput element) throws CoreException { + IDiagramDocument diagramDocument = (IDiagramDocument) document; + TransactionalEditingDomain domain = diagramDocument.getEditingDomain(); + if (element instanceof FileEditorInput) { + IStorage storage = ((FileEditorInput) element).getStorage(); + Diagram diagram = DiagramIOUtil.load(domain, storage, true, getProgressMonitor()); + document.setContent(diagram); + } else if (element instanceof URIEditorInput) { + URI uri = ((URIEditorInput) element).getURI(); + Resource resource = null; + try { + resource = domain.getResourceSet().getResource(uri.trimFragment(), false); + if (resource == null) { + resource = domain.getResourceSet().createResource(uri.trimFragment()); + } + if (!resource.isLoaded()) { + try { + @SuppressWarnings({ "rawtypes", "unchecked" }) + Map<?, ?> options = new HashMap(GMFResourceFactory.getDefaultLoadOptions()); + // @see 171060 + // options.put(org.eclipse.emf.ecore.xmi.XMLResource.OPTION_RECORD_UNKNOWN_FEATURE, Boolean.TRUE); + resource.load(options); + } catch (IOException e) { + resource.unload(); + throw e; + } + } + if (uri.fragment() != null) { + EObject rootElement = resource.getEObject(uri.fragment()); + if (rootElement instanceof Diagram) { + document.setContent(rootElement); + return; + } + } else { + for (Iterator<EObject> it = resource.getContents().iterator(); it.hasNext();) { + Object rootElement = it.next(); + if (rootElement instanceof Diagram) { + document.setContent(rootElement); + return; + } + } + } + throw new RuntimeException(Messages.UMLDocumentProvider_NoDiagramInResourceError); + } catch (Exception e) { + CoreException thrownExcp = null; + if (e instanceof CoreException) { + thrownExcp = (CoreException) e; + } else { + String msg = e.getLocalizedMessage(); + thrownExcp = new CoreException(new Status(IStatus.ERROR, 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)); + } + } + + /** + * @generated + */ + public long getModificationStamp(Object element) { + ResourceSetInfo info = getResourceSetInfo(element); + if (info != null) { + return computeModificationStamp(info); + } + return super.getModificationStamp(element); + } + + /** + * @generated + */ + public boolean isDeleted(Object element) { + IDiagramDocument document = getDiagramDocument(element); + if (document != null) { + Resource diagramResource = document.getDiagram().eResource(); + if (diagramResource != null) { + IFile file = WorkspaceSynchronizer.getFile(diagramResource); + return file == null || file.getLocation() == null || !file.getLocation().toFile().exists(); + } + } + return super.isDeleted(element); + } + + /** + * @generated + */ + public ResourceSetInfo getResourceSetInfo(Object editorInput) { + return (ResourceSetInfo) super.getElementInfo(editorInput); + } + + /** + * @generated + */ + protected void disposeElementInfo(Object element, ElementInfo info) { + if (info instanceof ResourceSetInfo) { + ResourceSetInfo resourceSetInfo = (ResourceSetInfo) info; + resourceSetInfo.dispose(); + } + super.disposeElementInfo(element, info); + } + + /** + * @generated + */ + protected void doValidateState(Object element, Object computationContext) throws CoreException { + ResourceSetInfo info = getResourceSetInfo(element); + if (info != null) { + LinkedList<IFile> files2Validate = new LinkedList<IFile>(); + for (Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) { + Resource nextResource = it.next(); + IFile file = WorkspaceSynchronizer.getFile(nextResource); + if (file != null && file.isReadOnly()) { + files2Validate.add(file); + } + } + ResourcesPlugin.getWorkspace().validateEdit(files2Validate.toArray(new IFile[files2Validate.size()]), computationContext); + } + + super.doValidateState(element, computationContext); + } + + /** + * @generated + */ + public boolean isReadOnly(Object element) { + ResourceSetInfo info = getResourceSetInfo(element); + if (info != null) { + if (info.isUpdateCache()) { + try { + updateCache(element); + } catch (CoreException ex) { + UMLDiagramEditorPlugin.getInstance().logError(Messages.UMLDocumentProvider_isModifiable, ex); + // Error message to log was initially taken from org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.internal.l10n.EditorMessages.StorageDocumentProvider_isModifiable + } + } + return info.isReadOnly(); + } + return super.isReadOnly(element); + } + + /** + * @generated + */ + public boolean isModifiable(Object element) { + if (!isStateValidated(element)) { + if (element instanceof FileEditorInput || element instanceof URIEditorInput) { + return true; + } + } + ResourceSetInfo info = getResourceSetInfo(element); + if (info != null) { + if (info.isUpdateCache()) { + try { + updateCache(element); + } catch (CoreException ex) { + UMLDiagramEditorPlugin.getInstance().logError(Messages.UMLDocumentProvider_isModifiable, ex); + // Error message to log was initially taken from org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.internal.l10n.EditorMessages.StorageDocumentProvider_isModifiable + } + } + return info.isModifiable(); + } + return super.isModifiable(element); + } + + /** + * @generated + */ + protected void updateCache(Object element) throws CoreException { + ResourceSetInfo info = getResourceSetInfo(element); + if (info != null) { + for (Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) { + Resource nextResource = it.next(); + IFile file = WorkspaceSynchronizer.getFile(nextResource); + if (file != null && file.isReadOnly()) { + info.setReadOnly(true); + info.setModifiable(false); + return; + } + } + info.setReadOnly(false); + info.setModifiable(true); + return; + } + } + + /** + * @generated + */ + protected void doUpdateStateCache(Object element) throws CoreException { + ResourceSetInfo info = getResourceSetInfo(element); + if (info != null) { + info.setUpdateCache(true); + } + super.doUpdateStateCache(element); + } + + /** + * @generated + */ + public boolean isSynchronized(Object element) { + ResourceSetInfo info = getResourceSetInfo(element); + if (info != null) { + return info.isSynchronized(); + } + return super.isSynchronized(element); + } + + /** + * @generated + */ + protected ISchedulingRule getResetRule(Object element) { + ResourceSetInfo info = getResourceSetInfo(element); + if (info != null) { + LinkedList<ISchedulingRule> rules = new LinkedList<ISchedulingRule>(); + for (Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) { + Resource nextResource = it.next(); + IFile file = WorkspaceSynchronizer.getFile(nextResource); + if (file != null) { + rules.add(ResourcesPlugin.getWorkspace().getRuleFactory().modifyRule(file)); + } + } + return new MultiRule(rules.toArray(new ISchedulingRule[rules.size()])); + } + return null; + } + + /** + * @generated + */ + protected ISchedulingRule getSaveRule(Object element) { + ResourceSetInfo info = getResourceSetInfo(element); + if (info != null) { + LinkedList<ISchedulingRule> rules = new LinkedList<ISchedulingRule>(); + for (Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) { + Resource nextResource = it.next(); + IFile file = WorkspaceSynchronizer.getFile(nextResource); + if (file != null) { + rules.add(computeSchedulingRule(file)); + } + } + return new MultiRule(rules.toArray(new ISchedulingRule[rules.size()])); + } + return null; + } + + /** + * @generated + */ + protected ISchedulingRule getSynchronizeRule(Object element) { + ResourceSetInfo info = getResourceSetInfo(element); + if (info != null) { + LinkedList<ISchedulingRule> rules = new LinkedList<ISchedulingRule>(); + for (Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) { + Resource nextResource = it.next(); + IFile file = WorkspaceSynchronizer.getFile(nextResource); + if (file != null) { + rules.add(ResourcesPlugin.getWorkspace().getRuleFactory().refreshRule(file)); + } + } + return new MultiRule(rules.toArray(new ISchedulingRule[rules.size()])); + } + return null; + } + + /** + * @generated + */ + protected ISchedulingRule getValidateStateRule(Object element) { + ResourceSetInfo info = getResourceSetInfo(element); + if (info != null) { + LinkedList<ISchedulingRule> files = new LinkedList<ISchedulingRule>(); + for (Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) { + Resource nextResource = it.next(); + IFile file = WorkspaceSynchronizer.getFile(nextResource); + if (file != null) { + files.add(file); + } + } + return ResourcesPlugin.getWorkspace().getRuleFactory().validateEditRule(files.toArray(new IFile[files.size()])); + } + return null; + } + + /** + * @generated + */ + private ISchedulingRule computeSchedulingRule(IResource toCreateOrModify) { + if (toCreateOrModify.exists()) { + return ResourcesPlugin.getWorkspace().getRuleFactory().modifyRule(toCreateOrModify); + } + IResource parent = toCreateOrModify; + do { + /* + * XXX This is a workaround for + * https://bugs.eclipse.org/bugs/show_bug.cgi?id=67601 + * IResourceRuleFactory.createRule should iterate the hierarchy + * itself. + */ + toCreateOrModify = parent; + parent = toCreateOrModify.getParent(); + } while (parent != null && !parent.exists()); + + return ResourcesPlugin.getWorkspace().getRuleFactory().createRule(toCreateOrModify); + } + + /** + * @generated + */ + protected void doSynchronize(Object element, IProgressMonitor monitor) throws CoreException { + ResourceSetInfo info = getResourceSetInfo(element); + if (info != null) { + for (Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) { + Resource nextResource = it.next(); + handleElementChanged(info, nextResource, monitor); + } + return; + } + super.doSynchronize(element, monitor); + } + + /** + * @generated + */ + protected void doSaveDocument(IProgressMonitor monitor, Object element, IDocument document, boolean overwrite) + throws CoreException { + ResourceSetInfo info = getResourceSetInfo(element); + if (info != null) { + if (!overwrite && !info.isSynchronized()) { + throw new CoreException(new Status(IStatus.ERROR, 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();) { + Resource nextResource = it.next(); + monitor.setTaskName(NLS.bind( + Messages.UMLDocumentProvider_SaveNextResourceTask, + nextResource.getURI())); + if (nextResource.isLoaded() && !info.getEditingDomain().isReadOnly(nextResource)) { + try { + nextResource.save(UMLDiagramEditorUtil.getSaveOptions()); + } catch (IOException e) { + fireElementStateChangeFailed(element); + throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, EditorStatusCodes.RESOURCE_FAILURE, e.getLocalizedMessage(), null)); + } + } + monitor.worked(1); + } + monitor.done(); + info.setModificationStamp(computeModificationStamp(info)); + } catch (RuntimeException x) { + fireElementStateChangeFailed(element); + throw x; + } finally { + info.startResourceListening(); + } + } else { + URI newResoruceURI; + List<IFile> affectedFiles = null; + if (element instanceof FileEditorInput) { + IFile newFile = ((FileEditorInput) element).getFile(); + affectedFiles = Collections.singletonList(newFile); + newResoruceURI = URI.createPlatformResourceURI(newFile.getFullPath().toString(), true); + } else if (element instanceof URIEditorInput) { + newResoruceURI = ((URIEditorInput) element).getURI(); + } else { + fireElementStateChangeFailed(element); + throw new CoreException(new Status(IStatus.ERROR, 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) { + 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$ + } + 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); + return CommandResult.newOKCommandResult(); + } + }.execute(monitor, null); + newResource.save(UMLDiagramEditorUtil.getSaveOptions()); + } catch (ExecutionException e) { + fireElementStateChangeFailed(element); + throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, 0, e.getLocalizedMessage(), null)); + } catch (IOException e) { + fireElementStateChangeFailed(element); + throw new CoreException(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, 0, e.getLocalizedMessage(), null)); + } + newResource.unload(); + } + } + + /** + * @generated + */ + protected void handleElementChanged(ResourceSetInfo info, Resource changedResource, IProgressMonitor monitor) { + IFile file = WorkspaceSynchronizer.getFile(changedResource); + if (file != null) { + try { + file.refreshLocal(IResource.DEPTH_INFINITE, monitor); + } catch (CoreException ex) { + UMLDiagramEditorPlugin.getInstance().logError(Messages.UMLDocumentProvider_handleElementContentChanged, ex); + // Error message to log was initially taken from org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.internal.l10n.EditorMessages.FileDocumentProvider_handleElementContentChanged + } + } + changedResource.unload(); + + fireElementContentAboutToBeReplaced(info.getEditorInput()); + removeUnchangedElementListeners(info.getEditorInput(), info); + info.fStatus = null; + try { + setDocumentContent(info.fDocument, info.getEditorInput()); + } catch (CoreException e) { + info.fStatus = e.getStatus(); + } + if (!info.fCanBeSaved) { + info.setModificationStamp(computeModificationStamp(info)); + } + addUnchangedElementListeners(info.getEditorInput(), info); + fireElementContentReplaced(info.getEditorInput()); + } + + /** + * @generated + */ + protected void handleElementMoved(IEditorInput input, URI uri) { + if (input instanceof FileEditorInput) { + IFile newFile = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(URI.decode(uri.path())).removeFirstSegments(1)); + fireElementMoved(input, newFile == null ? null : new FileEditorInput(newFile)); + return; + } + // TODO: append suffix to the URI! (use diagram as a parameter) + fireElementMoved(input, new URIEditorInput(uri)); + } + + /** + * @generated + */ + public IEditorInput createInputWithEditingDomain(IEditorInput editorInput, TransactionalEditingDomain domain) { + return editorInput; + } + + /** + * @generated + */ + public IDiagramDocument getDiagramDocument(Object element) { + IDocument doc = getDocument(element); + if (doc instanceof IDiagramDocument) { + return (IDiagramDocument) doc; + } + return null; + } + + /** + * @generated + */ + protected IRunnableContext getOperationRunner(IProgressMonitor monitor) { + return null; + } + + /** + * @generated + */ + protected class ResourceSetInfo extends ElementInfo { + + /** + * @generated + */ + private long myModificationStamp = IResource.NULL_STAMP; + + /** + * @generated + */ + private WorkspaceSynchronizer mySynchronizer; + + /** + * @generated + */ + private LinkedList<Resource> myUnSynchronizedResources = new LinkedList<Resource>(); + + /** + * @generated + */ + private IDiagramDocument myDocument; + + /** + * @generated + */ + private IEditorInput myEditorInput; + + /** + * @generated + */ + private boolean myUpdateCache = true; + + /** + * @generated + */ + private boolean myModifiable = false; + + /** + * @generated + */ + private boolean myReadOnly = true; + + /** + * @generated + */ + private ResourceSetModificationListener myResourceSetListener; + + /** + * @generated + */ + public ResourceSetInfo(IDiagramDocument document, IEditorInput editorInput) { + super(document); + myDocument = document; + myEditorInput = editorInput; + startResourceListening(); + myResourceSetListener = new ResourceSetModificationListener(this); + getResourceSet().eAdapters().add(myResourceSetListener); + } + + /** + * @generated + */ + public long getModificationStamp() { + return myModificationStamp; + } + + /** + * @generated + */ + public void setModificationStamp(long modificationStamp) { + myModificationStamp = modificationStamp; + } + + /** + * @generated + */ + public TransactionalEditingDomain getEditingDomain() { + return myDocument.getEditingDomain(); + } + + /** + * @generated + */ + public ResourceSet getResourceSet() { + return getEditingDomain().getResourceSet(); + } + + /** + * @generated + */ + public Iterator<Resource> getLoadedResourcesIterator() { + return new ArrayList<Resource>(getResourceSet().getResources()).iterator(); + } + + /** + * @generated + */ + public IEditorInput getEditorInput() { + return myEditorInput; + } + + /** + * @generated + */ + public void dispose() { + stopResourceListening(); + getResourceSet().eAdapters().remove(myResourceSetListener); + for (Iterator<Resource> it = getLoadedResourcesIterator(); it.hasNext();) { + Resource resource = it.next(); + resource.unload(); + } + getEditingDomain().dispose(); + } + + /** + * @generated + */ + public boolean isSynchronized() { + return myUnSynchronizedResources.size() == 0; + } + + /** + * @generated + */ + public void setUnSynchronized(Resource resource) { + myUnSynchronizedResources.add(resource); + } + + /** + * @generated + */ + public void setSynchronized(Resource resource) { + myUnSynchronizedResources.remove(resource); + } + + /** + * @generated + */ + public final void stopResourceListening() { + mySynchronizer.dispose(); + mySynchronizer = null; + } + + /** + * @generated + */ + public final void startResourceListening() { + mySynchronizer = new WorkspaceSynchronizer(getEditingDomain(), new SynchronizerDelegate()); + } + + /** + * @generated + */ + public boolean isUpdateCache() { + return myUpdateCache; + } + + /** + * @generated + */ + public void setUpdateCache(boolean update) { + myUpdateCache = update; + } + + /** + * @generated + */ + public boolean isModifiable() { + return myModifiable; + } + + /** + * @generated + */ + public void setModifiable(boolean modifiable) { + myModifiable = modifiable; + } + + /** + * @generated + */ + public boolean isReadOnly() { + return myReadOnly; + } + + /** + * @generated + */ + public void setReadOnly(boolean readOnly) { + myReadOnly = readOnly; + } + + /** + * @generated + */ + private class SynchronizerDelegate implements WorkspaceSynchronizer.Delegate { + + /** + * @generated + */ + public void dispose() { + } + + /** + * @generated + */ + public boolean handleResourceChanged(final Resource resource) { + synchronized (ResourceSetInfo.this) { + if (ResourceSetInfo.this.fCanBeSaved) { + ResourceSetInfo.this.setUnSynchronized(resource); + return true; + } + } + Display.getDefault().asyncExec(new Runnable() { + @Override + public void run() { + handleElementChanged(ResourceSetInfo.this, resource, null); + } + }); + return true; + } + + /** + * @generated + */ + public boolean handleResourceDeleted(Resource resource) { + synchronized (ResourceSetInfo.this) { + if (ResourceSetInfo.this.fCanBeSaved) { + ResourceSetInfo.this.setUnSynchronized(resource); + return true; + } + } + Display.getDefault().asyncExec(new Runnable() { + @Override + public void run() { + fireElementDeleted(ResourceSetInfo.this.getEditorInput()); + } + }); + return true; + } + + /** + * @generated + */ + public boolean handleResourceMoved(Resource resource, final URI newURI) { + synchronized (ResourceSetInfo.this) { + if (ResourceSetInfo.this.fCanBeSaved) { + ResourceSetInfo.this.setUnSynchronized(resource); + return true; + } + } + if (myDocument.getDiagram().eResource() == resource) { + Display.getDefault().asyncExec(new Runnable() { + @Override + public void run() { + handleElementMoved(ResourceSetInfo.this.getEditorInput(), newURI); + } + }); + } else { + handleResourceDeleted(resource); + } + return true; + } + + } + + } + + /** + * @generated + */ + private class ResourceSetModificationListener extends EContentAdapter { + + /** + * @generated + */ + private NotificationFilter myModifiedFilter; + + /** + * @generated + */ + private ResourceSetInfo myInfo; + + /** + * @generated + */ + public ResourceSetModificationListener(ResourceSetInfo info) { + myInfo = info; + myModifiedFilter = NotificationFilter.createEventTypeFilter(Notification.SET).or(NotificationFilter.createEventTypeFilter(Notification.UNSET)).and(NotificationFilter.createFeatureFilter(Resource.class, Resource.RESOURCE__IS_MODIFIED)); + } + + /** + * @generated + */ + public void notifyChanged(Notification notification) { + if (notification.getNotifier() instanceof ResourceSet) { + super.notifyChanged(notification); + } + if (!notification.isTouch() && myModifiedFilter.matches(notification)) { + if (notification.getNotifier() instanceof Resource) { + Resource resource = (Resource) notification.getNotifier(); + if (resource.isLoaded()) { + boolean modified = false; + for (Iterator<Resource> it = myInfo.getLoadedResourcesIterator(); it.hasNext() && !modified;) { + Resource nextResource = it.next(); + if (nextResource.isLoaded()) { + modified = nextResource.isModified(); + } + } + boolean dirtyStateChanged = false; + synchronized (myInfo) { + if (modified != myInfo.fCanBeSaved) { + myInfo.fCanBeSaved = modified; + dirtyStateChanged = true; + } + if (!resource.isModified()) { + myInfo.setSynchronized(resource); + } + } + if (dirtyStateChanged) { + fireElementDirtyStateChanged(myInfo.getEditorInput(), modified); + + if (!modified) { + myInfo.setModificationStamp(computeModificationStamp(myInfo)); + } + } + } + } + } + } + + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLInitDiagramFileAction.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLInitDiagramFileAction.java index 2bd6926621c..67f69670492 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLInitDiagramFileAction.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLInitDiagramFileAction.java @@ -1,102 +1,102 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.part;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.common.util.WrappedException;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.workspace.WorkspaceEditingDomainFactory;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ModelEditPart;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * @generated
- */
-public class UMLInitDiagramFileAction implements IObjectActionDelegate {
-
- /**
- * @generated
- */
- private IWorkbenchPart targetPart;
-
- /**
- * @generated
- */
- private URI domainModelURI;
-
- /**
- * @generated
- */
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- this.targetPart = targetPart;
- }
-
- /**
- * @generated
- */
- public void selectionChanged(IAction action, ISelection selection) {
- domainModelURI = null;
- action.setEnabled(false);
- if (selection instanceof IStructuredSelection == false || selection.isEmpty()) {
- return;
- }
- IFile file = (IFile) ((IStructuredSelection) selection).getFirstElement();
- domainModelURI = URI.createPlatformResourceURI(file.getFullPath().toString(), true);
- action.setEnabled(true);
- }
-
- /**
- * @generated
- */
- private Shell getShell() {
- return targetPart.getSite().getShell();
- }
-
- /**
- * @generated
- */
- public void run(IAction action) {
- TransactionalEditingDomain editingDomain = WorkspaceEditingDomainFactory.INSTANCE.createEditingDomain();
- ResourceSet resourceSet = editingDomain.getResourceSet();
- EObject diagramRoot = null;
- try {
- 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$
- }
- 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,
- ModelEditPart.MODEL_ID));
- UMLDiagramEditorUtil.runWizard(getShell(), wizard, "InitDiagramFile"); //$NON-NLS-1$
- }
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.part; + +import org.eclipse.core.resources.IFile; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.common.util.WrappedException; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.emf.workspace.WorkspaceEditingDomainFactory; +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.wizard.Wizard; +import org.eclipse.osgi.util.NLS; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ModelEditPart; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.IObjectActionDelegate; +import org.eclipse.ui.IWorkbenchPart; + +/** + * @generated + */ +public class UMLInitDiagramFileAction implements IObjectActionDelegate { + + /** + * @generated + */ + private IWorkbenchPart targetPart; + + /** + * @generated + */ + private URI domainModelURI; + + /** + * @generated + */ + public void setActivePart(IAction action, IWorkbenchPart targetPart) { + this.targetPart = targetPart; + } + + /** + * @generated + */ + public void selectionChanged(IAction action, ISelection selection) { + domainModelURI = null; + action.setEnabled(false); + if (selection instanceof IStructuredSelection == false || selection.isEmpty()) { + return; + } + IFile file = (IFile) ((IStructuredSelection) selection).getFirstElement(); + domainModelURI = URI.createPlatformResourceURI(file.getFullPath().toString(), true); + action.setEnabled(true); + } + + /** + * @generated + */ + private Shell getShell() { + return targetPart.getSite().getShell(); + } + + /** + * @generated + */ + public void run(IAction action) { + TransactionalEditingDomain editingDomain = WorkspaceEditingDomainFactory.INSTANCE.createEditingDomain(); + ResourceSet resourceSet = editingDomain.getResourceSet(); + EObject diagramRoot = null; + try { + 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$ + } + 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, + ModelEditPart.MODEL_ID)); + UMLDiagramEditorUtil.runWizard(getShell(), wizard, "InitDiagramFile"); //$NON-NLS-1$ + } +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLLinkDescriptor.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLLinkDescriptor.java index 5f38c889e42..7b54b3e4b3c 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLLinkDescriptor.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLLinkDescriptor.java @@ -1,37 +1,37 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.part;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.papyrus.infra.gmfdiag.common.updater.UpdaterLinkDescriptor;
-
-/**
- * @generated
- */
-public class UMLLinkDescriptor extends UpdaterLinkDescriptor {
- /**
- * @generated
- */
- public UMLLinkDescriptor(EObject source, EObject destination, IElementType elementType, String linkVID) {
- super(source, destination, elementType, linkVID);
- }
-
- /**
- * @generated
- */
- public UMLLinkDescriptor(EObject source, EObject destination, EObject linkElement, IElementType elementType,
- String linkVID) {
- super(source, destination, linkElement, elementType, linkVID);
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.part; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.papyrus.infra.gmfdiag.common.updater.UpdaterLinkDescriptor; + +/** + * @generated + */ +public class UMLLinkDescriptor extends UpdaterLinkDescriptor { + /** + * @generated + */ + public UMLLinkDescriptor(EObject source, EObject destination, IElementType elementType, String linkVID) { + super(source, destination, elementType, linkVID); + } + + /** + * @generated + */ + public UMLLinkDescriptor(EObject source, EObject destination, EObject linkElement, IElementType elementType, + String linkVID) { + super(source, destination, linkElement, elementType, linkVID); + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLMatchingStrategy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLMatchingStrategy.java index 1b433d0e287..476edc8adf2 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLMatchingStrategy.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLMatchingStrategy.java @@ -1,45 +1,45 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.part;
-
-import org.eclipse.emf.common.ui.URIEditorInput;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorMatchingStrategy;
-import org.eclipse.ui.IEditorReference;
-import org.eclipse.ui.PartInitException;
-
-/**
- * @generated
- */
-public class UMLMatchingStrategy implements IEditorMatchingStrategy {
-
- /**
- * @generated
- */
- public boolean matches(IEditorReference editorRef, IEditorInput input) {
- IEditorInput editorInput;
- try {
- editorInput = editorRef.getEditorInput();
- } catch (PartInitException e) {
- return false;
- }
-
- if (editorInput.equals(input)) {
- return true;
- }
- if (editorInput instanceof URIEditorInput && input instanceof URIEditorInput) {
- return ((URIEditorInput) editorInput).getURI().equals(((URIEditorInput) input).getURI());
- }
- return false;
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.part; + +import org.eclipse.emf.common.ui.URIEditorInput; +import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.IEditorMatchingStrategy; +import org.eclipse.ui.IEditorReference; +import org.eclipse.ui.PartInitException; + +/** + * @generated + */ +public class UMLMatchingStrategy implements IEditorMatchingStrategy { + + /** + * @generated + */ + public boolean matches(IEditorReference editorRef, IEditorInput input) { + IEditorInput editorInput; + try { + editorInput = editorRef.getEditorInput(); + } catch (PartInitException e) { + return false; + } + + if (editorInput.equals(input)) { + return true; + } + if (editorInput instanceof URIEditorInput && input instanceof URIEditorInput) { + return ((URIEditorInput) editorInput).getURI().equals(((URIEditorInput) input).getURI()); + } + return false; + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLNewDiagramFileWizard.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLNewDiagramFileWizard.java index 8dcf8a8545c..875ae6f01ef 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLNewDiagramFileWizard.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLNewDiagramFileWizard.java @@ -1,189 +1,189 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.part;
-
-import java.io.IOException;
-import java.util.LinkedList;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.operations.OperationHistoryFactory;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.diagram.core.services.ViewService;
-import org.eclipse.gmf.runtime.diagram.core.services.view.CreateDiagramViewOperation;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ModelEditPart;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
-
-/**
- * @generated
- */
-public class UMLNewDiagramFileWizard extends Wizard {
-
- /**
- * @generated
- */
- private WizardNewFileCreationPage myFileCreationPage;
-
- /**
- * @generated
- */
- private ModelElementSelectionPage diagramRootElementSelectionPage;
-
- /**
- * @generated
- */
- private TransactionalEditingDomain myEditingDomain;
-
- /**
- * @generated
- */
- public UMLNewDiagramFileWizard(URI domainModelURI, EObject diagramRoot, TransactionalEditingDomain editingDomain) {
- assert domainModelURI != null : "Domain model uri must be specified"; //$NON-NLS-1$
- assert diagramRoot != null : "Doagram root element must be specified"; //$NON-NLS-1$
- assert editingDomain != null : "Editing domain must be specified"; //$NON-NLS-1$
-
- myFileCreationPage = new WizardNewFileCreationPage(Messages.UMLNewDiagramFileWizard_CreationPageName, StructuredSelection.EMPTY);
- myFileCreationPage.setTitle(Messages.UMLNewDiagramFileWizard_CreationPageTitle);
- myFileCreationPage.setDescription(NLS.bind(
- Messages.UMLNewDiagramFileWizard_CreationPageDescription,
- ModelEditPart.MODEL_ID));
- IPath filePath;
- String fileName = URI.decode(domainModelURI.trimFileExtension().lastSegment());
- if (domainModelURI.isPlatformResource()) {
- filePath = new Path(domainModelURI.trimSegments(1).toPlatformString(true));
- } else if (domainModelURI.isFile()) {
- filePath = new Path(domainModelURI.trimSegments(1).toFileString());
- } else {
- // TODO : use some default path
- throw new IllegalArgumentException("Unsupported URI: " + domainModelURI); //$NON-NLS-1$
- }
- myFileCreationPage.setContainerFullPath(filePath);
- myFileCreationPage.setFileName(UMLDiagramEditorUtil.getUniqueFileName(
- filePath, fileName, "PapyrusUMLCommunication_diagram")); //$NON-NLS-1$
-
- diagramRootElementSelectionPage = new DiagramRootElementSelectionPage(Messages.UMLNewDiagramFileWizard_RootSelectionPageName);
- diagramRootElementSelectionPage.setTitle(Messages.UMLNewDiagramFileWizard_RootSelectionPageTitle);
- diagramRootElementSelectionPage.setDescription(Messages.UMLNewDiagramFileWizard_RootSelectionPageDescription);
- diagramRootElementSelectionPage.setModelElement(diagramRoot);
-
- myEditingDomain = editingDomain;
- }
-
- /**
- * @generated
- */
- public void addPages() {
- addPage(myFileCreationPage);
- addPage(diagramRootElementSelectionPage);
- }
-
- /**
- * @generated
- */
- public boolean performFinish() {
- LinkedList<IFile> affectedFiles = new LinkedList<IFile>();
- IFile diagramFile = myFileCreationPage.createNewFile();
- UMLDiagramEditorUtil.setCharset(diagramFile);
- affectedFiles.add(diagramFile);
- URI diagramModelURI = URI.createPlatformResourceURI(diagramFile.getFullPath().toString(), true);
- ResourceSet resourceSet = myEditingDomain.getResourceSet();
- final Resource diagramResource = resourceSet.createResource(diagramModelURI);
- AbstractTransactionalCommand command = new AbstractTransactionalCommand(
- myEditingDomain, Messages.UMLNewDiagramFileWizard_InitDiagramCommand, affectedFiles) {
-
- @Override
- protected CommandResult doExecuteWithResult(
- IProgressMonitor monitor, IAdaptable info)
- throws ExecutionException {
- String diagramVID = UMLVisualIDRegistry.getDiagramVisualID(diagramRootElementSelectionPage.getModelElement());
- if (diagramVID.equals(ModelEditPart.VISUAL_ID)) {
- return CommandResult.newErrorCommandResult(
- Messages.UMLNewDiagramFileWizard_IncorrectRootError);
- }
- Diagram diagram = ViewService.createDiagram(
- diagramRootElementSelectionPage.getModelElement(), ModelEditPart.MODEL_ID,
- UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
- diagramResource.getContents().add(diagram);
- return CommandResult.newOKCommandResult();
- }
- };
- try {
- 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$
- } catch (IOException ex) {
- 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$
- }
- return true;
- }
-
- /**
- * @generated
- */
- private static class DiagramRootElementSelectionPage extends ModelElementSelectionPage {
-
- /**
- * @generated
- */
- protected DiagramRootElementSelectionPage(String pageName) {
- super(pageName);
- }
-
- /**
- * @generated
- */
- protected String getSelectionTitle() {
- return Messages.UMLNewDiagramFileWizard_RootSelectionPageSelectionTitle;
- }
-
- /**
- * @generated
- */
- protected boolean validatePage() {
- if (getModelElement() == null) {
- setErrorMessage(Messages.UMLNewDiagramFileWizard_RootSelectionPageNoSelectionMessage);
- return false;
- }
- boolean result = ViewService.getInstance().provides(
- new CreateDiagramViewOperation(
- new EObjectAdapter(getModelElement()),
- ModelEditPart.MODEL_ID, UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT));
- setErrorMessage(result ? null : Messages.UMLNewDiagramFileWizard_RootSelectionPageInvalidSelectionMessage);
- return result;
- }
- }
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.part; + +import java.io.IOException; +import java.util.LinkedList; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.commands.operations.OperationHistoryFactory; +import org.eclipse.core.resources.IFile; +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.core.runtime.Path; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.gmf.runtime.common.core.command.CommandResult; +import org.eclipse.gmf.runtime.diagram.core.services.ViewService; +import org.eclipse.gmf.runtime.diagram.core.services.view.CreateDiagramViewOperation; +import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand; +import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter; +import org.eclipse.gmf.runtime.notation.Diagram; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.jface.wizard.Wizard; +import org.eclipse.osgi.util.NLS; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ModelEditPart; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.dialogs.WizardNewFileCreationPage; + +/** + * @generated + */ +public class UMLNewDiagramFileWizard extends Wizard { + + /** + * @generated + */ + private WizardNewFileCreationPage myFileCreationPage; + + /** + * @generated + */ + private ModelElementSelectionPage diagramRootElementSelectionPage; + + /** + * @generated + */ + private TransactionalEditingDomain myEditingDomain; + + /** + * @generated + */ + public UMLNewDiagramFileWizard(URI domainModelURI, EObject diagramRoot, TransactionalEditingDomain editingDomain) { + assert domainModelURI != null : "Domain model uri must be specified"; //$NON-NLS-1$ + assert diagramRoot != null : "Doagram root element must be specified"; //$NON-NLS-1$ + assert editingDomain != null : "Editing domain must be specified"; //$NON-NLS-1$ + + myFileCreationPage = new WizardNewFileCreationPage(Messages.UMLNewDiagramFileWizard_CreationPageName, StructuredSelection.EMPTY); + myFileCreationPage.setTitle(Messages.UMLNewDiagramFileWizard_CreationPageTitle); + myFileCreationPage.setDescription(NLS.bind( + Messages.UMLNewDiagramFileWizard_CreationPageDescription, + ModelEditPart.MODEL_ID)); + IPath filePath; + String fileName = URI.decode(domainModelURI.trimFileExtension().lastSegment()); + if (domainModelURI.isPlatformResource()) { + filePath = new Path(domainModelURI.trimSegments(1).toPlatformString(true)); + } else if (domainModelURI.isFile()) { + filePath = new Path(domainModelURI.trimSegments(1).toFileString()); + } else { + // TODO : use some default path + throw new IllegalArgumentException("Unsupported URI: " + domainModelURI); //$NON-NLS-1$ + } + myFileCreationPage.setContainerFullPath(filePath); + myFileCreationPage.setFileName(UMLDiagramEditorUtil.getUniqueFileName( + filePath, fileName, "PapyrusUMLCommunication_diagram")); //$NON-NLS-1$ + + diagramRootElementSelectionPage = new DiagramRootElementSelectionPage(Messages.UMLNewDiagramFileWizard_RootSelectionPageName); + diagramRootElementSelectionPage.setTitle(Messages.UMLNewDiagramFileWizard_RootSelectionPageTitle); + diagramRootElementSelectionPage.setDescription(Messages.UMLNewDiagramFileWizard_RootSelectionPageDescription); + diagramRootElementSelectionPage.setModelElement(diagramRoot); + + myEditingDomain = editingDomain; + } + + /** + * @generated + */ + public void addPages() { + addPage(myFileCreationPage); + addPage(diagramRootElementSelectionPage); + } + + /** + * @generated + */ + public boolean performFinish() { + LinkedList<IFile> affectedFiles = new LinkedList<IFile>(); + IFile diagramFile = myFileCreationPage.createNewFile(); + UMLDiagramEditorUtil.setCharset(diagramFile); + affectedFiles.add(diagramFile); + URI diagramModelURI = URI.createPlatformResourceURI(diagramFile.getFullPath().toString(), true); + ResourceSet resourceSet = myEditingDomain.getResourceSet(); + final Resource diagramResource = resourceSet.createResource(diagramModelURI); + AbstractTransactionalCommand command = new AbstractTransactionalCommand( + myEditingDomain, Messages.UMLNewDiagramFileWizard_InitDiagramCommand, affectedFiles) { + + @Override + protected CommandResult doExecuteWithResult( + IProgressMonitor monitor, IAdaptable info) + throws ExecutionException { + String diagramVID = UMLVisualIDRegistry.getDiagramVisualID(diagramRootElementSelectionPage.getModelElement()); + if (diagramVID.equals(ModelEditPart.VISUAL_ID)) { + return CommandResult.newErrorCommandResult( + Messages.UMLNewDiagramFileWizard_IncorrectRootError); + } + Diagram diagram = ViewService.createDiagram( + diagramRootElementSelectionPage.getModelElement(), ModelEditPart.MODEL_ID, + UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT); + diagramResource.getContents().add(diagram); + return CommandResult.newOKCommandResult(); + } + }; + try { + 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$ + } catch (IOException ex) { + 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$ + } + return true; + } + + /** + * @generated + */ + private static class DiagramRootElementSelectionPage extends ModelElementSelectionPage { + + /** + * @generated + */ + protected DiagramRootElementSelectionPage(String pageName) { + super(pageName); + } + + /** + * @generated + */ + protected String getSelectionTitle() { + return Messages.UMLNewDiagramFileWizard_RootSelectionPageSelectionTitle; + } + + /** + * @generated + */ + protected boolean validatePage() { + if (getModelElement() == null) { + setErrorMessage(Messages.UMLNewDiagramFileWizard_RootSelectionPageNoSelectionMessage); + return false; + } + boolean result = ViewService.getInstance().provides( + new CreateDiagramViewOperation( + new EObjectAdapter(getModelElement()), + ModelEditPart.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.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLNodeDescriptor.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLNodeDescriptor.java index 42934e2bd0d..6bf9fa17ba0 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLNodeDescriptor.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLNodeDescriptor.java @@ -1,28 +1,28 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.part;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.papyrus.infra.gmfdiag.common.updater.UpdaterNodeDescriptor;
-
-/**
- * @generated
- */
-public class UMLNodeDescriptor extends UpdaterNodeDescriptor {
- /**
- * @generated
- */
- public UMLNodeDescriptor(EObject modelElement, String visualID) {
- super(modelElement, visualID);
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.part; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.papyrus.infra.gmfdiag.common.updater.UpdaterNodeDescriptor; + +/** + * @generated + */ +public class UMLNodeDescriptor extends UpdaterNodeDescriptor { + /** + * @generated + */ + public UMLNodeDescriptor(EObject modelElement, String visualID) { + super(modelElement, visualID); + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLUriEditorInputTester.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLUriEditorInputTester.java index 87b37984995..c520ac26909 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLUriEditorInputTester.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLUriEditorInputTester.java @@ -1,33 +1,33 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.part;
-
-import org.eclipse.core.expressions.PropertyTester;
-import org.eclipse.emf.common.ui.URIEditorInput;
-
-/**
- * @generated
- */
-public class UMLUriEditorInputTester extends PropertyTester {
-
- /**
- * @generated
- */
- public boolean test(Object receiver, String method, Object[] args, Object expectedValue) {
- if (false == receiver instanceof URIEditorInput) {
- return false;
- }
- URIEditorInput editorInput = (URIEditorInput) receiver;
- return "PapyrusUMLCommunication_diagram".equals(editorInput.getURI().fileExtension()); //$NON-NLS-1$
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.part; + +import org.eclipse.core.expressions.PropertyTester; +import org.eclipse.emf.common.ui.URIEditorInput; + +/** + * @generated + */ +public class UMLUriEditorInputTester extends PropertyTester { + + /** + * @generated + */ + public boolean test(Object receiver, String method, Object[] args, Object expectedValue) { + if (false == receiver instanceof URIEditorInput) { + return false; + } + URIEditorInput editorInput = (URIEditorInput) receiver; + return "PapyrusUMLCommunication_diagram".equals(editorInput.getURI().fileExtension()); //$NON-NLS-1$ + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLVisualIDRegistry.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLVisualIDRegistry.java index 709c66a990b..b50304b44a8 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLVisualIDRegistry.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLVisualIDRegistry.java @@ -1,394 +1,394 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.part;
-
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.common.structure.DiagramStructure;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.AppliedStereotypeMessageEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.CommentBodyEditPartCN;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.CommentEditPartCN;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ConstraintBodyEditPartCN;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ConstraintEditPartCN;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ConstraintNameEditPartCN;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.DurationObservationEditPartCN;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.DurationObservationLabelEditPartCN;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.DurationObservationStereotypeLabelEditPartCN;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.InteractionCompartmentEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.InteractionEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.InteractionFloatingLabelEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.InteractionNameEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.LifelineEditPartCN;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.LifelineFloatingLabelEditPartCN;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.LifelineNameEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.MessageEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.MessageNameEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ModelEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.TimeObservationEditPartCN;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.TimeObservationNameEditPartCN;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.TimeObservationStereotypeLabelEditPartCN;
-import org.eclipse.papyrus.uml.diagram.communication.expressions.UMLOCLFactory;
-import org.eclipse.uml2.uml.Message;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * This registry is used to determine which type of visual object should be
- * created for the corresponding Diagram, Node, ChildNode or Link represented
- * by a domain model object.
- *
- * @generated
- */
-public class UMLVisualIDRegistry {
-
- /**
- * @generated
- */
- private static final String DEBUG_KEY = "org.eclipse.papyrus.uml.diagram.communication/debug/visualID"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static String getVisualID(View view) {
- if (view instanceof Diagram) {
- if (ModelEditPart.MODEL_ID.equals(view.getType())) {
- return ModelEditPart.VISUAL_ID;
- } else {
- return "";
- }
- }
- return org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry.getVisualID(view.getType());
- }
-
- /**
- * @generated
- */
- public static String getModelID(View view) {
- View diagram = view.getDiagram();
- while (view != diagram) {
- EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
- if (annotation != null) {
- return annotation.getDetails().get("modelID"); //$NON-NLS-1$
- }
- view = (View) view.eContainer();
- }
- return diagram != null ? diagram.getType() : null;
- }
-
- /**
- * @generated
- */
- public static String getVisualID(String type) {
- return type;
- }
-
- /**
- * @generated
- */
- public static String getType(String visualID) {
- return visualID;
- }
-
- /**
- * @generated
- */
- public static String getDiagramVisualID(EObject domainElement) {
- if (domainElement == null) {
- return "";
- }
- return ModelEditPart.VISUAL_ID;
- }
-
- /**
- * @generated
- */
- public static String getNodeVisualID(View containerView, EObject domainElement) {
- if (domainElement == null) {
- return "";
- }
- String containerModelID = org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry.getModelID(containerView);
- if (!ModelEditPart.MODEL_ID.equals(containerModelID)) {
- return "";
- }
- String containerVisualID;
- if (ModelEditPart.MODEL_ID.equals(containerModelID)) {
- containerVisualID = org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry.getVisualID(containerView);
- } else {
- if (containerView instanceof Diagram) {
- containerVisualID = ModelEditPart.VISUAL_ID;
- } else {
- return "";
- }
- }
- if (containerVisualID != null) {
- switch (containerVisualID) {
- case ModelEditPart.VISUAL_ID:
- if (UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {
- return InteractionEditPart.VISUAL_ID;
- }
- break;
- case InteractionCompartmentEditPart.VISUAL_ID:
- if (UMLPackage.eINSTANCE.getLifeline().isSuperTypeOf(domainElement.eClass())) {
- return LifelineEditPartCN.VISUAL_ID;
- }
- if (UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {
- return CommentEditPartCN.VISUAL_ID;
- }
- if (UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {
- return ConstraintEditPartCN.VISUAL_ID;
- }
- if (UMLPackage.eINSTANCE.getTimeObservation().isSuperTypeOf(domainElement.eClass())) {
- return TimeObservationEditPartCN.VISUAL_ID;
- }
- if (UMLPackage.eINSTANCE.getDurationObservation().isSuperTypeOf(domainElement.eClass())) {
- return DurationObservationEditPartCN.VISUAL_ID;
- }
- break;
- }
- }
- return "";
- }
-
- /**
- * @generated
- */
- public static boolean canCreateNode(View containerView, String nodeVisualID) {
- String containerModelID = org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry.getModelID(containerView);
- if (!ModelEditPart.MODEL_ID.equals(containerModelID)) {
- return false;
- }
- String containerVisualID;
- if (ModelEditPart.MODEL_ID.equals(containerModelID)) {
- containerVisualID = org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry.getVisualID(containerView);
- } else {
- if (containerView instanceof Diagram) {
- containerVisualID = ModelEditPart.VISUAL_ID;
- } else {
- return false;
- }
- }
- if (containerVisualID != null) {
- switch (containerVisualID) {
- case ModelEditPart.VISUAL_ID:
- if (InteractionEditPart.VISUAL_ID.equals(nodeVisualID)) {
- return true;
- }
- break;
- case InteractionEditPart.VISUAL_ID:
- if (InteractionNameEditPart.VISUAL_ID.equals(nodeVisualID)) {
- return true;
- }
- if (InteractionFloatingLabelEditPart.VISUAL_ID.equals(nodeVisualID)) {
- return true;
- }
- if (InteractionCompartmentEditPart.VISUAL_ID.equals(nodeVisualID)) {
- return true;
- }
- break;
- case LifelineEditPartCN.VISUAL_ID:
- if (LifelineNameEditPart.VISUAL_ID.equals(nodeVisualID)) {
- return true;
- }
- if (LifelineFloatingLabelEditPartCN.VISUAL_ID.equals(nodeVisualID)) {
- return true;
- }
- break;
- case ConstraintEditPartCN.VISUAL_ID:
- if (ConstraintNameEditPartCN.VISUAL_ID.equals(nodeVisualID)) {
- return true;
- }
- if (ConstraintBodyEditPartCN.VISUAL_ID.equals(nodeVisualID)) {
- return true;
- }
- break;
- case CommentEditPartCN.VISUAL_ID:
- if (CommentBodyEditPartCN.VISUAL_ID.equals(nodeVisualID)) {
- return true;
- }
- break;
- case TimeObservationEditPartCN.VISUAL_ID:
- if (TimeObservationNameEditPartCN.VISUAL_ID.equals(nodeVisualID)) {
- return true;
- }
- if (TimeObservationStereotypeLabelEditPartCN.VISUAL_ID.equals(nodeVisualID)) {
- return true;
- }
- break;
- case DurationObservationEditPartCN.VISUAL_ID:
- if (DurationObservationLabelEditPartCN.VISUAL_ID.equals(nodeVisualID)) {
- return true;
- }
- if (DurationObservationStereotypeLabelEditPartCN.VISUAL_ID.equals(nodeVisualID)) {
- return true;
- }
- break;
- case InteractionCompartmentEditPart.VISUAL_ID:
- if (LifelineEditPartCN.VISUAL_ID.equals(nodeVisualID)) {
- return true;
- }
- if (CommentEditPartCN.VISUAL_ID.equals(nodeVisualID)) {
- return true;
- }
- if (ConstraintEditPartCN.VISUAL_ID.equals(nodeVisualID)) {
- return true;
- }
- if (TimeObservationEditPartCN.VISUAL_ID.equals(nodeVisualID)) {
- return true;
- }
- if (DurationObservationEditPartCN.VISUAL_ID.equals(nodeVisualID)) {
- return true;
- }
- break;
- case MessageEditPart.VISUAL_ID:
- if (MessageNameEditPart.VISUAL_ID.equals(nodeVisualID)) {
- return true;
- }
- if (AppliedStereotypeMessageEditPart.VISUAL_ID.equals(nodeVisualID)) {
- return true;
- }
- break;
- }
- }
- return false;
- }
-
- /**
- * @generated
- */
- public static String getLinkWithClassVisualID(EObject domainElement) {
- if (domainElement == null) {
- return "";
- }
- if (UMLPackage.eINSTANCE.getMessage().isSuperTypeOf(domainElement.eClass()) && isPath_Edge((Message) domainElement)) {
- return MessageEditPart.VISUAL_ID;
- }
- return "";
- }
-
- /**
- * User can change implementation of this method to handle some specific
- * situations not covered by default logic.
- *
- * @generated
- */
- private static boolean isDiagram(Package element) {
- return true;
- }
-
- /**
- * @generated
- */
- private static boolean isPath_Edge(Message domainElement) {
- Object result = UMLOCLFactory.getExpression(5, UMLPackage.eINSTANCE.getMessage(), null).evaluate(domainElement);
- return result instanceof Boolean && ((Boolean) result).booleanValue();
- }
-
- /**
- * @generated
- */
- public static boolean checkNodeVisualID(View containerView, EObject domainElement, String candidate) {
- if (candidate == null) {
- //unrecognized id is always bad
- return false;
- }
- String basic = getNodeVisualID(containerView, domainElement);
- return candidate.equals(basic);
- }
-
- /**
- * @generated
- */
- public static boolean isCompartmentVisualID(String visualID) {
- if (visualID != null) {
- switch (visualID) {
- case InteractionCompartmentEditPart.VISUAL_ID:
- return true;
- }
- }
- return false;
- }
-
- /**
- * @generated
- */
- public static boolean isSemanticLeafVisualID(String visualID) {
- if (visualID != null) {
- switch (visualID) {
- case ModelEditPart.VISUAL_ID:
- return false;
- case LifelineEditPartCN.VISUAL_ID:
- case ConstraintEditPartCN.VISUAL_ID:
- case CommentEditPartCN.VISUAL_ID:
- case TimeObservationEditPartCN.VISUAL_ID:
- case DurationObservationEditPartCN.VISUAL_ID:
- return true;
- }
- }
- return false;
- }
-
- /**
- * @generated
- */
- public static final DiagramStructure TYPED_INSTANCE = new DiagramStructure() {
- /**
- * @generated
- */
- @Override
- public String getVisualID(View view) {
- return org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry.getVisualID(view);
- }
-
- /**
- * @generated
- */
- @Override
- public String getModelID(View view) {
- return org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry.getModelID(view);
- }
-
- /**
- * @generated
- */
- @Override
- public String getNodeVisualID(View containerView, EObject domainElement) {
- return org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry.getNodeVisualID(containerView, domainElement);
- }
-
- /**
- * @generated
- */
- @Override
- public boolean checkNodeVisualID(View containerView, EObject domainElement, String candidate) {
- return org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry.checkNodeVisualID(containerView, domainElement, candidate);
- }
-
- /**
- * @generated
- */
- @Override
- public boolean isCompartmentVisualID(String visualID) {
- return org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry.isCompartmentVisualID(visualID);
- }
-
- /**
- * @generated
- */
- @Override
- public boolean isSemanticLeafVisualID(String visualID) {
- return org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry.isSemanticLeafVisualID(visualID);
- }
- };
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.part; + +import org.eclipse.emf.ecore.EAnnotation; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.gmf.runtime.notation.Diagram; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.papyrus.infra.gmfdiag.common.structure.DiagramStructure; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.AppliedStereotypeMessageEditPart; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.CommentBodyEditPartCN; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.CommentEditPartCN; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ConstraintBodyEditPartCN; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ConstraintEditPartCN; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ConstraintNameEditPartCN; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.DurationObservationEditPartCN; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.DurationObservationLabelEditPartCN; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.DurationObservationStereotypeLabelEditPartCN; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.InteractionCompartmentEditPart; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.InteractionEditPart; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.InteractionFloatingLabelEditPart; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.InteractionNameEditPart; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.LifelineEditPartCN; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.LifelineFloatingLabelEditPartCN; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.LifelineNameEditPart; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.MessageEditPart; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.MessageNameEditPart; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ModelEditPart; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.TimeObservationEditPartCN; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.TimeObservationNameEditPartCN; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.TimeObservationStereotypeLabelEditPartCN; +import org.eclipse.papyrus.uml.diagram.communication.expressions.UMLOCLFactory; +import org.eclipse.uml2.uml.Message; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.UMLPackage; + +/** + * This registry is used to determine which type of visual object should be + * created for the corresponding Diagram, Node, ChildNode or Link represented + * by a domain model object. + * + * @generated + */ +public class UMLVisualIDRegistry { + + /** + * @generated + */ + private static final String DEBUG_KEY = "org.eclipse.papyrus.uml.diagram.communication/debug/visualID"; //$NON-NLS-1$ + + /** + * @generated + */ + public static String getVisualID(View view) { + if (view instanceof Diagram) { + if (ModelEditPart.MODEL_ID.equals(view.getType())) { + return ModelEditPart.VISUAL_ID; + } else { + return ""; + } + } + return org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry.getVisualID(view.getType()); + } + + /** + * @generated + */ + public static String getModelID(View view) { + View diagram = view.getDiagram(); + while (view != diagram) { + EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$ + if (annotation != null) { + return annotation.getDetails().get("modelID"); //$NON-NLS-1$ + } + view = (View) view.eContainer(); + } + return diagram != null ? diagram.getType() : null; + } + + /** + * @generated + */ + public static String getVisualID(String type) { + return type; + } + + /** + * @generated + */ + public static String getType(String visualID) { + return visualID; + } + + /** + * @generated + */ + public static String getDiagramVisualID(EObject domainElement) { + if (domainElement == null) { + return ""; + } + return ModelEditPart.VISUAL_ID; + } + + /** + * @generated + */ + public static String getNodeVisualID(View containerView, EObject domainElement) { + if (domainElement == null) { + return ""; + } + String containerModelID = org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry.getModelID(containerView); + if (!ModelEditPart.MODEL_ID.equals(containerModelID)) { + return ""; + } + String containerVisualID; + if (ModelEditPart.MODEL_ID.equals(containerModelID)) { + containerVisualID = org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry.getVisualID(containerView); + } else { + if (containerView instanceof Diagram) { + containerVisualID = ModelEditPart.VISUAL_ID; + } else { + return ""; + } + } + if (containerVisualID != null) { + switch (containerVisualID) { + case ModelEditPart.VISUAL_ID: + if (UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) { + return InteractionEditPart.VISUAL_ID; + } + break; + case InteractionCompartmentEditPart.VISUAL_ID: + if (UMLPackage.eINSTANCE.getLifeline().isSuperTypeOf(domainElement.eClass())) { + return LifelineEditPartCN.VISUAL_ID; + } + if (UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) { + return CommentEditPartCN.VISUAL_ID; + } + if (UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) { + return ConstraintEditPartCN.VISUAL_ID; + } + if (UMLPackage.eINSTANCE.getTimeObservation().isSuperTypeOf(domainElement.eClass())) { + return TimeObservationEditPartCN.VISUAL_ID; + } + if (UMLPackage.eINSTANCE.getDurationObservation().isSuperTypeOf(domainElement.eClass())) { + return DurationObservationEditPartCN.VISUAL_ID; + } + break; + } + } + return ""; + } + + /** + * @generated + */ + public static boolean canCreateNode(View containerView, String nodeVisualID) { + String containerModelID = org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry.getModelID(containerView); + if (!ModelEditPart.MODEL_ID.equals(containerModelID)) { + return false; + } + String containerVisualID; + if (ModelEditPart.MODEL_ID.equals(containerModelID)) { + containerVisualID = org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry.getVisualID(containerView); + } else { + if (containerView instanceof Diagram) { + containerVisualID = ModelEditPart.VISUAL_ID; + } else { + return false; + } + } + if (containerVisualID != null) { + switch (containerVisualID) { + case ModelEditPart.VISUAL_ID: + if (InteractionEditPart.VISUAL_ID.equals(nodeVisualID)) { + return true; + } + break; + case InteractionEditPart.VISUAL_ID: + if (InteractionNameEditPart.VISUAL_ID.equals(nodeVisualID)) { + return true; + } + if (InteractionFloatingLabelEditPart.VISUAL_ID.equals(nodeVisualID)) { + return true; + } + if (InteractionCompartmentEditPart.VISUAL_ID.equals(nodeVisualID)) { + return true; + } + break; + case LifelineEditPartCN.VISUAL_ID: + if (LifelineNameEditPart.VISUAL_ID.equals(nodeVisualID)) { + return true; + } + if (LifelineFloatingLabelEditPartCN.VISUAL_ID.equals(nodeVisualID)) { + return true; + } + break; + case ConstraintEditPartCN.VISUAL_ID: + if (ConstraintNameEditPartCN.VISUAL_ID.equals(nodeVisualID)) { + return true; + } + if (ConstraintBodyEditPartCN.VISUAL_ID.equals(nodeVisualID)) { + return true; + } + break; + case CommentEditPartCN.VISUAL_ID: + if (CommentBodyEditPartCN.VISUAL_ID.equals(nodeVisualID)) { + return true; + } + break; + case TimeObservationEditPartCN.VISUAL_ID: + if (TimeObservationNameEditPartCN.VISUAL_ID.equals(nodeVisualID)) { + return true; + } + if (TimeObservationStereotypeLabelEditPartCN.VISUAL_ID.equals(nodeVisualID)) { + return true; + } + break; + case DurationObservationEditPartCN.VISUAL_ID: + if (DurationObservationLabelEditPartCN.VISUAL_ID.equals(nodeVisualID)) { + return true; + } + if (DurationObservationStereotypeLabelEditPartCN.VISUAL_ID.equals(nodeVisualID)) { + return true; + } + break; + case InteractionCompartmentEditPart.VISUAL_ID: + if (LifelineEditPartCN.VISUAL_ID.equals(nodeVisualID)) { + return true; + } + if (CommentEditPartCN.VISUAL_ID.equals(nodeVisualID)) { + return true; + } + if (ConstraintEditPartCN.VISUAL_ID.equals(nodeVisualID)) { + return true; + } + if (TimeObservationEditPartCN.VISUAL_ID.equals(nodeVisualID)) { + return true; + } + if (DurationObservationEditPartCN.VISUAL_ID.equals(nodeVisualID)) { + return true; + } + break; + case MessageEditPart.VISUAL_ID: + if (MessageNameEditPart.VISUAL_ID.equals(nodeVisualID)) { + return true; + } + if (AppliedStereotypeMessageEditPart.VISUAL_ID.equals(nodeVisualID)) { + return true; + } + break; + } + } + return false; + } + + /** + * @generated + */ + public static String getLinkWithClassVisualID(EObject domainElement) { + if (domainElement == null) { + return ""; + } + if (UMLPackage.eINSTANCE.getMessage().isSuperTypeOf(domainElement.eClass()) && isPath_Edge((Message) domainElement)) { + return MessageEditPart.VISUAL_ID; + } + return ""; + } + + /** + * User can change implementation of this method to handle some specific + * situations not covered by default logic. + * + * @generated + */ + private static boolean isDiagram(Package element) { + return true; + } + + /** + * @generated + */ + private static boolean isPath_Edge(Message domainElement) { + Object result = UMLOCLFactory.getExpression(5, UMLPackage.eINSTANCE.getMessage(), null).evaluate(domainElement); + return result instanceof Boolean && ((Boolean) result).booleanValue(); + } + + /** + * @generated + */ + public static boolean checkNodeVisualID(View containerView, EObject domainElement, String candidate) { + if (candidate == null) { + //unrecognized id is always bad + return false; + } + String basic = getNodeVisualID(containerView, domainElement); + return candidate.equals(basic); + } + + /** + * @generated + */ + public static boolean isCompartmentVisualID(String visualID) { + if (visualID != null) { + switch (visualID) { + case InteractionCompartmentEditPart.VISUAL_ID: + return true; + } + } + return false; + } + + /** + * @generated + */ + public static boolean isSemanticLeafVisualID(String visualID) { + if (visualID != null) { + switch (visualID) { + case ModelEditPart.VISUAL_ID: + return false; + case LifelineEditPartCN.VISUAL_ID: + case ConstraintEditPartCN.VISUAL_ID: + case CommentEditPartCN.VISUAL_ID: + case TimeObservationEditPartCN.VISUAL_ID: + case DurationObservationEditPartCN.VISUAL_ID: + return true; + } + } + return false; + } + + /** + * @generated + */ + public static final DiagramStructure TYPED_INSTANCE = new DiagramStructure() { + /** + * @generated + */ + @Override + public String getVisualID(View view) { + return org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry.getVisualID(view); + } + + /** + * @generated + */ + @Override + public String getModelID(View view) { + return org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry.getModelID(view); + } + + /** + * @generated + */ + @Override + public String getNodeVisualID(View containerView, EObject domainElement) { + return org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry.getNodeVisualID(containerView, domainElement); + } + + /** + * @generated + */ + @Override + public boolean checkNodeVisualID(View containerView, EObject domainElement, String candidate) { + return org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry.checkNodeVisualID(containerView, domainElement, candidate); + } + + /** + * @generated + */ + @Override + public boolean isCompartmentVisualID(String visualID) { + return org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry.isCompartmentVisualID(visualID); + } + + /** + * @generated + */ + @Override + public boolean isSemanticLeafVisualID(String visualID) { + return org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry.isSemanticLeafVisualID(visualID); + } + }; + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/ValidateAction.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/ValidateAction.java index 1ba1d8a9e5c..505655883dc 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/ValidateAction.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/ValidateAction.java @@ -1,292 +1,292 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.part;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.util.Diagnostician;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.emf.validation.model.EvaluationMode;
-import org.eclipse.emf.validation.model.IConstraintStatus;
-import org.eclipse.emf.validation.service.IBatchValidator;
-import org.eclipse.emf.validation.service.ModelValidationService;
-import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gmf.runtime.diagram.ui.OffscreenEditPartFactory;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart;
-import org.eclipse.gmf.runtime.emf.core.util.EMFCoreUtil;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.papyrus.uml.diagram.communication.providers.UMLMarkerNavigationProvider;
-import org.eclipse.papyrus.uml.diagram.communication.providers.UMLValidationProvider;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.WorkspaceModifyDelegatingOperation;
-
-/**
- * @generated
- */
-public class ValidateAction extends Action {
- /**
- * @generated
- */
- private IWorkbenchPage page;
-
- /**
- * @generated
- */
- public ValidateAction(IWorkbenchPage page) {
- setText(Messages.ValidateActionMessage);
- this.page = page;
- }
-
- /**
- * @generated
- */
- public void run() {
- IWorkbenchPart workbenchPart = page.getActivePart();
- if (workbenchPart instanceof IDiagramWorkbenchPart) {
- final IDiagramWorkbenchPart part = (IDiagramWorkbenchPart) workbenchPart;
- try {
- new WorkspaceModifyDelegatingOperation(
- new IRunnableWithProgress() {
-
- @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$
- }
- }
- }
-
- /**
- * @generated
- */
- 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);
- } else {
- runNonUIValidation(view);
- }
- }
- } catch (Exception e) {
- UMLDiagramEditorPlugin.getInstance().logError(
- "Validation action failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public static void runNonUIValidation(View view) {
- Shell shell = Display.getCurrent().getActiveShell();
- if (shell == null) {
- shell = new Shell();
- }
-
- DiagramEditPart diagramEditPart = OffscreenEditPartFactory.getInstance().createDiagramEditPart(
- view.getDiagram(), shell);
- runValidation(diagramEditPart, view);
- }
-
- /**
- * @generated
- */
- public static void runValidation(DiagramEditPart diagramEditPart, View view) {
- final DiagramEditPart fpart = diagramEditPart;
- final View fview = view;
- TransactionalEditingDomain txDomain = TransactionUtil.getEditingDomain(view);
- UMLValidationProvider.runWithConstraints(txDomain, new Runnable() {
-
- @Override
- public void run() {
- validate(fpart, fview);
- }
- });
- }
-
- /**
- * @generated
- */
- private static Diagnostic runEMFValidator(View target) {
- if (target.isSetElement() && target.getElement() != null) {
- return new Diagnostician() {
-
- @Override
- public String getObjectLabel(EObject eObject) {
- return EMFCoreUtil.getQualifiedName(eObject, true);
- }
- }.validate(target.getElement());
- }
- return Diagnostic.OK_INSTANCE;
- }
-
- /**
- * @generated
- */
- private static void validate(DiagramEditPart diagramEditPart, View view) {
- IFile target = view.eResource() != null ? WorkspaceSynchronizer.getFile(view.eResource()) : null;
- if (target != null) {
- UMLMarkerNavigationProvider.deleteMarkers(target);
- }
- Diagnostic diagnostic = runEMFValidator(view);
- createMarkers(target, diagnostic, diagramEditPart);
- IBatchValidator validator = (IBatchValidator) ModelValidationService.getInstance().newValidator(
- EvaluationMode.BATCH);
- validator.setIncludeLiveConstraints(true);
- if (view.isSetElement() && view.getElement() != null) {
- IStatus status = validator.validate(view.getElement());
- createMarkers(target, status, diagramEditPart);
- }
- }
-
- /**
- * @generated
- */
- private static void createMarkers(IFile target, IStatus validationStatus, DiagramEditPart diagramEditPart) {
- if (validationStatus.isOK()) {
- return;
- }
- final IStatus rootStatus = validationStatus;
- List allStatuses = new ArrayList();
- 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());
- }
- }
-
- /**
- * @generated
- */
- private static void createMarkers(IFile target, Diagnostic emfValidationStatus, DiagramEditPart diagramEditPart) {
- 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();) {
- 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()));
- }
- }
- }
-
- /**
- * @generated
- */
- private static void addMarker(EditPartViewer viewer, IFile target, String elementId, String location, String message, int statusSeverity) {
- if (target == null) {
- return;
- }
- UMLMarkerNavigationProvider.addMarker(
- target, elementId, location, message, statusSeverity);
- }
-
- /**
- * @generated
- */
- private static int diagnosticToStatusSeverity(int diagnosticSeverity) {
- if (diagnosticSeverity == Diagnostic.OK) {
- return IStatus.OK;
- } else if (diagnosticSeverity == Diagnostic.INFO) {
- return IStatus.INFO;
- } else if (diagnosticSeverity == Diagnostic.WARNING) {
- return IStatus.WARNING;
- } else if (diagnosticSeverity == Diagnostic.ERROR
- || diagnosticSeverity == Diagnostic.CANCEL) {
- return IStatus.ERROR;
- }
- return IStatus.INFO;
- }
-
- /**
- * @generated
- */
- private static Set<EObject> collectTargetElements(IStatus status, Set<EObject> targetElementCollector,
- List<IConstraintStatus> allConstraintStatuses) {
- if (status instanceof IConstraintStatus) {
- targetElementCollector.add(((IConstraintStatus) status).getTarget());
- allConstraintStatuses.add((IConstraintStatus) status);
- }
- if (status.isMultiStatus()) {
- IStatus[] children = status.getChildren();
- for (int i = 0; i < children.length; i++) {
- collectTargetElements(children[i], targetElementCollector, allConstraintStatuses);
- }
- }
- return targetElementCollector;
- }
-
- /**
- * @generated
- */
- private static Set<EObject> collectTargetElements(Diagnostic diagnostic, Set<EObject> targetElementCollector,
- List<Diagnostic> allDiagnostics) {
- List<?> data = diagnostic.getData();
- EObject target = null;
- if (data != null && !data.isEmpty() && data.get(0) instanceof EObject) {
- target = (EObject) data.get(0);
- targetElementCollector.add(target);
- allDiagnostics.add(diagnostic);
- }
- if (diagnostic.getChildren() != null && !diagnostic.getChildren().isEmpty()) {
- for (Iterator<Diagnostic> it = diagnostic.getChildren().iterator(); it.hasNext();) {
- collectTargetElements(it.next(), targetElementCollector, allDiagnostics);
- }
- }
- return targetElementCollector;
- }
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.part; + +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; + +import org.eclipse.core.resources.IFile; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.emf.common.util.Diagnostic; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.util.Diagnostician; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.emf.transaction.util.TransactionUtil; +import org.eclipse.emf.validation.model.EvaluationMode; +import org.eclipse.emf.validation.model.IConstraintStatus; +import org.eclipse.emf.validation.service.IBatchValidator; +import org.eclipse.emf.validation.service.ModelValidationService; +import org.eclipse.emf.workspace.util.WorkspaceSynchronizer; +import org.eclipse.gef.EditPartViewer; +import org.eclipse.gmf.runtime.diagram.ui.OffscreenEditPartFactory; +import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart; +import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart; +import org.eclipse.gmf.runtime.emf.core.util.EMFCoreUtil; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.jface.action.Action; +import org.eclipse.jface.operation.IRunnableWithProgress; +import org.eclipse.papyrus.uml.diagram.communication.providers.UMLMarkerNavigationProvider; +import org.eclipse.papyrus.uml.diagram.communication.providers.UMLValidationProvider; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.actions.WorkspaceModifyDelegatingOperation; + +/** + * @generated + */ +public class ValidateAction extends Action { + /** + * @generated + */ + private IWorkbenchPage page; + + /** + * @generated + */ + public ValidateAction(IWorkbenchPage page) { + setText(Messages.ValidateActionMessage); + this.page = page; + } + + /** + * @generated + */ + public void run() { + IWorkbenchPart workbenchPart = page.getActivePart(); + if (workbenchPart instanceof IDiagramWorkbenchPart) { + final IDiagramWorkbenchPart part = (IDiagramWorkbenchPart) workbenchPart; + try { + new WorkspaceModifyDelegatingOperation( + new IRunnableWithProgress() { + + @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$ + } + } + } + + /** + * @generated + */ + 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); + } else { + runNonUIValidation(view); + } + } + } catch (Exception e) { + UMLDiagramEditorPlugin.getInstance().logError( + "Validation action failed", e); //$NON-NLS-1$ + } + } + + /** + * @generated + */ + public static void runNonUIValidation(View view) { + Shell shell = Display.getCurrent().getActiveShell(); + if (shell == null) { + shell = new Shell(); + } + + DiagramEditPart diagramEditPart = OffscreenEditPartFactory.getInstance().createDiagramEditPart( + view.getDiagram(), shell); + runValidation(diagramEditPart, view); + } + + /** + * @generated + */ + public static void runValidation(DiagramEditPart diagramEditPart, View view) { + final DiagramEditPart fpart = diagramEditPart; + final View fview = view; + TransactionalEditingDomain txDomain = TransactionUtil.getEditingDomain(view); + UMLValidationProvider.runWithConstraints(txDomain, new Runnable() { + + @Override + public void run() { + validate(fpart, fview); + } + }); + } + + /** + * @generated + */ + private static Diagnostic runEMFValidator(View target) { + if (target.isSetElement() && target.getElement() != null) { + return new Diagnostician() { + + @Override + public String getObjectLabel(EObject eObject) { + return EMFCoreUtil.getQualifiedName(eObject, true); + } + }.validate(target.getElement()); + } + return Diagnostic.OK_INSTANCE; + } + + /** + * @generated + */ + private static void validate(DiagramEditPart diagramEditPart, View view) { + IFile target = view.eResource() != null ? WorkspaceSynchronizer.getFile(view.eResource()) : null; + if (target != null) { + UMLMarkerNavigationProvider.deleteMarkers(target); + } + Diagnostic diagnostic = runEMFValidator(view); + createMarkers(target, diagnostic, diagramEditPart); + IBatchValidator validator = (IBatchValidator) ModelValidationService.getInstance().newValidator( + EvaluationMode.BATCH); + validator.setIncludeLiveConstraints(true); + if (view.isSetElement() && view.getElement() != null) { + IStatus status = validator.validate(view.getElement()); + createMarkers(target, status, diagramEditPart); + } + } + + /** + * @generated + */ + private static void createMarkers(IFile target, IStatus validationStatus, DiagramEditPart diagramEditPart) { + if (validationStatus.isOK()) { + return; + } + final IStatus rootStatus = validationStatus; + List allStatuses = new ArrayList(); + 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()); + } + } + + /** + * @generated + */ + private static void createMarkers(IFile target, Diagnostic emfValidationStatus, DiagramEditPart diagramEditPart) { + 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();) { + 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())); + } + } + } + + /** + * @generated + */ + private static void addMarker(EditPartViewer viewer, IFile target, String elementId, String location, String message, int statusSeverity) { + if (target == null) { + return; + } + UMLMarkerNavigationProvider.addMarker( + target, elementId, location, message, statusSeverity); + } + + /** + * @generated + */ + private static int diagnosticToStatusSeverity(int diagnosticSeverity) { + if (diagnosticSeverity == Diagnostic.OK) { + return IStatus.OK; + } else if (diagnosticSeverity == Diagnostic.INFO) { + return IStatus.INFO; + } else if (diagnosticSeverity == Diagnostic.WARNING) { + return IStatus.WARNING; + } else if (diagnosticSeverity == Diagnostic.ERROR + || diagnosticSeverity == Diagnostic.CANCEL) { + return IStatus.ERROR; + } + return IStatus.INFO; + } + + /** + * @generated + */ + private static Set<EObject> collectTargetElements(IStatus status, Set<EObject> targetElementCollector, + List<IConstraintStatus> allConstraintStatuses) { + if (status instanceof IConstraintStatus) { + targetElementCollector.add(((IConstraintStatus) status).getTarget()); + allConstraintStatuses.add((IConstraintStatus) status); + } + if (status.isMultiStatus()) { + IStatus[] children = status.getChildren(); + for (int i = 0; i < children.length; i++) { + collectTargetElements(children[i], targetElementCollector, allConstraintStatuses); + } + } + return targetElementCollector; + } + + /** + * @generated + */ + private static Set<EObject> collectTargetElements(Diagnostic diagnostic, Set<EObject> targetElementCollector, + List<Diagnostic> allDiagnostics) { + List<?> data = diagnostic.getData(); + EObject target = null; + if (data != null && !data.isEmpty() && data.get(0) instanceof EObject) { + target = (EObject) data.get(0); + targetElementCollector.add(target); + allDiagnostics.add(diagnostic); + } + if (diagnostic.getChildren() != null && !diagnostic.getChildren().isEmpty()) { + for (Iterator<Diagnostic> it = diagnostic.getChildren().iterator(); it.hasNext();) { + collectTargetElements(it.next(), targetElementCollector, allDiagnostics); + } + } + return targetElementCollector; + } +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/preferences/DiagramAppearancePreferencePage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/preferences/DiagramAppearancePreferencePage.java index 62385bfd1e5..32363ee915a 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/preferences/DiagramAppearancePreferencePage.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/preferences/DiagramAppearancePreferencePage.java @@ -1,28 +1,28 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.preferences;
-
-import org.eclipse.gmf.runtime.diagram.ui.preferences.AppearancePreferencePage;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditorPlugin;
-
-/**
- * @generated
- */
-public class DiagramAppearancePreferencePage extends AppearancePreferencePage {
-
- /**
- * @generated
- */
- public DiagramAppearancePreferencePage() {
- setPreferenceStore(UMLDiagramEditorPlugin.getInstance().getPreferenceStore());
- }
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.preferences; + +import org.eclipse.gmf.runtime.diagram.ui.preferences.AppearancePreferencePage; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditorPlugin; + +/** + * @generated + */ +public class DiagramAppearancePreferencePage extends AppearancePreferencePage { + + /** + * @generated + */ + public DiagramAppearancePreferencePage() { + setPreferenceStore(UMLDiagramEditorPlugin.getInstance().getPreferenceStore()); + } +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/preferences/DiagramConnectionsPreferencePage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/preferences/DiagramConnectionsPreferencePage.java index 9bb9436a6c2..0f8d5aaf6cb 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/preferences/DiagramConnectionsPreferencePage.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/preferences/DiagramConnectionsPreferencePage.java @@ -1,28 +1,28 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.preferences;
-
-import org.eclipse.gmf.runtime.diagram.ui.preferences.ConnectionsPreferencePage;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditorPlugin;
-
-/**
- * @generated
- */
-public class DiagramConnectionsPreferencePage extends ConnectionsPreferencePage {
-
- /**
- * @generated
- */
- public DiagramConnectionsPreferencePage() {
- setPreferenceStore(UMLDiagramEditorPlugin.getInstance().getPreferenceStore());
- }
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.preferences; + +import org.eclipse.gmf.runtime.diagram.ui.preferences.ConnectionsPreferencePage; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditorPlugin; + +/** + * @generated + */ +public class DiagramConnectionsPreferencePage extends ConnectionsPreferencePage { + + /** + * @generated + */ + public DiagramConnectionsPreferencePage() { + setPreferenceStore(UMLDiagramEditorPlugin.getInstance().getPreferenceStore()); + } +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/preferences/DiagramGeneralPreferencePage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/preferences/DiagramGeneralPreferencePage.java index 9a098b4793c..8e68e0cc476 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/preferences/DiagramGeneralPreferencePage.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/preferences/DiagramGeneralPreferencePage.java @@ -1,30 +1,30 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.preferences;
-
-import org.eclipse.papyrus.infra.gmfdiag.preferences.pages.DiagramPreferencePage;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ModelEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditorPlugin;
-
-/**
- * @generated
- */
-public class DiagramGeneralPreferencePage extends DiagramPreferencePage {
-
- /**
- * @generated
- */
- public DiagramGeneralPreferencePage() {
- setPreferenceStore(UMLDiagramEditorPlugin.getInstance().getPreferenceStore());
- setPreferenceKey(ModelEditPart.MODEL_ID);
- }
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.preferences; + +import org.eclipse.papyrus.infra.gmfdiag.preferences.pages.DiagramPreferencePage; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ModelEditPart; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditorPlugin; + +/** + * @generated + */ +public class DiagramGeneralPreferencePage extends DiagramPreferencePage { + + /** + * @generated + */ + public DiagramGeneralPreferencePage() { + setPreferenceStore(UMLDiagramEditorPlugin.getInstance().getPreferenceStore()); + setPreferenceKey(ModelEditPart.MODEL_ID); + } +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/preferences/DiagramPreferenceInitializer.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/preferences/DiagramPreferenceInitializer.java index 87f1e3de7b8..f1bc3417970 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/preferences/DiagramPreferenceInitializer.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/preferences/DiagramPreferenceInitializer.java @@ -1,41 +1,41 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.preferences;
-
-import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditorPlugin;
-
-/**
- * @generated
- */
-public class DiagramPreferenceInitializer extends AbstractPreferenceInitializer {
-
- /**
- * @generated
- */
- public void initializeDefaultPreferences() {
- IPreferenceStore store = getPreferenceStore();
- DiagramGeneralPreferencePage.initDefaults(store);
- DiagramAppearancePreferencePage.initDefaults(store);
- DiagramConnectionsPreferencePage.initDefaults(store);
- DiagramPrintingPreferencePage.initDefaults(store);
-
- }
-
- /**
- * @generated
- */
- protected IPreferenceStore getPreferenceStore() {
- return UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
- }
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.preferences; + +import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditorPlugin; + +/** + * @generated + */ +public class DiagramPreferenceInitializer extends AbstractPreferenceInitializer { + + /** + * @generated + */ + public void initializeDefaultPreferences() { + IPreferenceStore store = getPreferenceStore(); + DiagramGeneralPreferencePage.initDefaults(store); + DiagramAppearancePreferencePage.initDefaults(store); + DiagramConnectionsPreferencePage.initDefaults(store); + DiagramPrintingPreferencePage.initDefaults(store); + + } + + /** + * @generated + */ + protected IPreferenceStore getPreferenceStore() { + return UMLDiagramEditorPlugin.getInstance().getPreferenceStore(); + } +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/preferences/DiagramPrintingPreferencePage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/preferences/DiagramPrintingPreferencePage.java index 219c0f34306..033936bd0db 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/preferences/DiagramPrintingPreferencePage.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/preferences/DiagramPrintingPreferencePage.java @@ -1,28 +1,28 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.preferences;
-
-import org.eclipse.gmf.runtime.diagram.ui.preferences.PrintingPreferencePage;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditorPlugin;
-
-/**
- * @generated
- */
-public class DiagramPrintingPreferencePage extends PrintingPreferencePage {
-
- /**
- * @generated
- */
- public DiagramPrintingPreferencePage() {
- setPreferenceStore(UMLDiagramEditorPlugin.getInstance().getPreferenceStore());
- }
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.preferences; + +import org.eclipse.gmf.runtime.diagram.ui.preferences.PrintingPreferencePage; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditorPlugin; + +/** + * @generated + */ +public class DiagramPrintingPreferencePage extends PrintingPreferencePage { + + /** + * @generated + */ + public DiagramPrintingPreferencePage() { + setPreferenceStore(UMLDiagramEditorPlugin.getInstance().getPreferenceStore()); + } +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/providers/ElementInitializers.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/providers/ElementInitializers.java index 722ea00e798..61d20d2b689 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/providers/ElementInitializers.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/providers/ElementInitializers.java @@ -1,209 +1,209 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.providers;
-
-import org.eclipse.papyrus.uml.diagram.communication.expressions.UMLOCLFactory;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.uml.tools.utils.NamedElementUtil;
-import org.eclipse.uml2.uml.Comment;
-import org.eclipse.uml2.uml.Constraint;
-import org.eclipse.uml2.uml.DurationObservation;
-import org.eclipse.uml2.uml.Interaction;
-import org.eclipse.uml2.uml.Lifeline;
-import org.eclipse.uml2.uml.LiteralString;
-import org.eclipse.uml2.uml.Message;
-import org.eclipse.uml2.uml.TimeObservation;
-import org.eclipse.uml2.uml.UMLFactory;
-import org.eclipse.uml2.uml.UMLPackage;
-import org.eclipse.uml2.uml.ValueSpecification;
-
-/**
- * @generated
- */
-public class ElementInitializers {
-
- protected ElementInitializers() {
- // use #getInstance to access cached instance
- }
-
- /**
- * @generated
- */
- public void init_Interaction_Shape(Interaction instance) {
- try {
- Object value_0 = name_Interaction_Shape(instance);
- if (value_0 != null) {
- instance.setName(
- (String) value_0);
- }
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Lifeline_Shape(Lifeline instance) {
- try {
- Object value_0 = name_Lifeline_Shape(instance);
- if (value_0 != null) {
- instance.setName(
- (String) value_0);
- }
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Constraint_Shape(Constraint instance) {
- try {
- Object value_0 = name_Constraint_Shape(instance);
- if (value_0 != null) {
- instance.setName(
- (String) value_0);
- }
- Object value_1 = specification_Constraint_Shape(instance);
- if (value_1 != null) {
- instance.setSpecification(
- (ValueSpecification) value_1);
- }
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Comment_Shape(Comment instance) {
- try {
- Object value_0 = UMLOCLFactory.getExpression(7, UMLPackage.eINSTANCE.getComment(), null).evaluate(instance);
- if (value_0 != null) {
- instance.setBody(
- (String) value_0);
- }
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_TimeObservation_Shape(TimeObservation instance) {
- try {
- Object value_0 = name_TimeObservation_Shape(instance);
- if (value_0 != null) {
- instance.setName(
- (String) value_0);
- }
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_DurationObservation_Shape(DurationObservation instance) {
- try {
- Object value_0 = name_DurationObservation_Shape(instance);
- if (value_0 != null) {
- instance.setName(
- (String) value_0);
- }
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public void init_Path_Edge(Message instance) {
- try {
- Object value_0 = name_Path_Edge(instance);
- if (value_0 != null) {
- instance.setName(
- (String) value_0);
- }
- } catch (RuntimeException e) {
- UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- private String name_Interaction_Shape(Interaction it) {
- return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());
- }
-
- /**
- * @generated
- */
- private String name_Lifeline_Shape(Lifeline it) {
- return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());
- }
-
- /**
- * @generated
- */
- private String name_Constraint_Shape(Constraint it) {
- return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());
- }
-
- /**
- * @generated
- */
- private ValueSpecification specification_Constraint_Shape(Constraint it) {
- LiteralString literalString = UMLFactory.eINSTANCE.createLiteralString();
- literalString.setValue("");
- return literalString;
- }
-
- /**
- * @generated
- */
- private String name_TimeObservation_Shape(TimeObservation it) {
- return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());
- }
-
- /**
- * @generated
- */
- private String name_DurationObservation_Shape(DurationObservation it) {
- return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());
- }
-
- /**
- * @generated
- */
- private String name_Path_Edge(Message it) {
- return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents());
- }
-
- /**
- * @generated
- */
- public static ElementInitializers getInstance() {
- ElementInitializers cached = UMLDiagramEditorPlugin.getInstance().getElementInitializers();
- if (cached == null) {
- UMLDiagramEditorPlugin.getInstance().setElementInitializers(cached = new ElementInitializers());
- }
- return cached;
- }
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.providers; + +import org.eclipse.papyrus.uml.diagram.communication.expressions.UMLOCLFactory; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditorPlugin; +import org.eclipse.papyrus.uml.tools.utils.NamedElementUtil; +import org.eclipse.uml2.uml.Comment; +import org.eclipse.uml2.uml.Constraint; +import org.eclipse.uml2.uml.DurationObservation; +import org.eclipse.uml2.uml.Interaction; +import org.eclipse.uml2.uml.Lifeline; +import org.eclipse.uml2.uml.LiteralString; +import org.eclipse.uml2.uml.Message; +import org.eclipse.uml2.uml.TimeObservation; +import org.eclipse.uml2.uml.UMLFactory; +import org.eclipse.uml2.uml.UMLPackage; +import org.eclipse.uml2.uml.ValueSpecification; + +/** + * @generated + */ +public class ElementInitializers { + + protected ElementInitializers() { + // use #getInstance to access cached instance + } + + /** + * @generated + */ + public void init_Interaction_Shape(Interaction instance) { + try { + Object value_0 = name_Interaction_Shape(instance); + if (value_0 != null) { + instance.setName( + (String) value_0); + } + } catch (RuntimeException e) { + UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$ + } + } + + /** + * @generated + */ + public void init_Lifeline_Shape(Lifeline instance) { + try { + Object value_0 = name_Lifeline_Shape(instance); + if (value_0 != null) { + instance.setName( + (String) value_0); + } + } catch (RuntimeException e) { + UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$ + } + } + + /** + * @generated + */ + public void init_Constraint_Shape(Constraint instance) { + try { + Object value_0 = name_Constraint_Shape(instance); + if (value_0 != null) { + instance.setName( + (String) value_0); + } + Object value_1 = specification_Constraint_Shape(instance); + if (value_1 != null) { + instance.setSpecification( + (ValueSpecification) value_1); + } + } catch (RuntimeException e) { + UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$ + } + } + + /** + * @generated + */ + public void init_Comment_Shape(Comment instance) { + try { + Object value_0 = UMLOCLFactory.getExpression(7, UMLPackage.eINSTANCE.getComment(), null).evaluate(instance); + if (value_0 != null) { + instance.setBody( + (String) value_0); + } + } catch (RuntimeException e) { + UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$ + } + } + + /** + * @generated + */ + public void init_TimeObservation_Shape(TimeObservation instance) { + try { + Object value_0 = name_TimeObservation_Shape(instance); + if (value_0 != null) { + instance.setName( + (String) value_0); + } + } catch (RuntimeException e) { + UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$ + } + } + + /** + * @generated + */ + public void init_DurationObservation_Shape(DurationObservation instance) { + try { + Object value_0 = name_DurationObservation_Shape(instance); + if (value_0 != null) { + instance.setName( + (String) value_0); + } + } catch (RuntimeException e) { + UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$ + } + } + + /** + * @generated + */ + public void init_Path_Edge(Message instance) { + try { + Object value_0 = name_Path_Edge(instance); + if (value_0 != null) { + instance.setName( + (String) value_0); + } + } catch (RuntimeException e) { + UMLDiagramEditorPlugin.getInstance().logError("Element initialization failed", e); //$NON-NLS-1$ + } + } + + /** + * @generated + */ + private String name_Interaction_Shape(Interaction it) { + return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents()); + } + + /** + * @generated + */ + private String name_Lifeline_Shape(Lifeline it) { + return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents()); + } + + /** + * @generated + */ + private String name_Constraint_Shape(Constraint it) { + return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents()); + } + + /** + * @generated + */ + private ValueSpecification specification_Constraint_Shape(Constraint it) { + LiteralString literalString = UMLFactory.eINSTANCE.createLiteralString(); + literalString.setValue(""); + return literalString; + } + + /** + * @generated + */ + private String name_TimeObservation_Shape(TimeObservation it) { + return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents()); + } + + /** + * @generated + */ + private String name_DurationObservation_Shape(DurationObservation it) { + return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents()); + } + + /** + * @generated + */ + private String name_Path_Edge(Message it) { + return NamedElementUtil.getDefaultNameWithIncrement(it, it.getOwner().eContents()); + } + + /** + * @generated + */ + public static ElementInitializers getInstance() { + ElementInitializers cached = UMLDiagramEditorPlugin.getInstance().getElementInitializers(); + if (cached == null) { + UMLDiagramEditorPlugin.getInstance().setElementInitializers(cached = new ElementInitializers()); + } + return cached; + } +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/providers/UMLEditPartProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/providers/UMLEditPartProvider.java index 9ce53031eff..6366506d7d6 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/providers/UMLEditPartProvider.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/providers/UMLEditPartProvider.java @@ -1,33 +1,33 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.providers;
-
-import org.eclipse.papyrus.infra.gmfdiag.common.providers.DefaultEditPartProvider;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ModelEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.UMLEditPartFactory;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry;
-
-/**
- * @generated
- */
-public class UMLEditPartProvider extends DefaultEditPartProvider {
-
- /**
- * @generated
- */
- public UMLEditPartProvider() {
- super(new UMLEditPartFactory(),
- UMLVisualIDRegistry.TYPED_INSTANCE,
- ModelEditPart.MODEL_ID);
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.providers; + +import org.eclipse.papyrus.infra.gmfdiag.common.providers.DefaultEditPartProvider; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ModelEditPart; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.UMLEditPartFactory; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry; + +/** + * @generated + */ +public class UMLEditPartProvider extends DefaultEditPartProvider { + + /** + * @generated + */ + public UMLEditPartProvider() { + super(new UMLEditPartFactory(), + UMLVisualIDRegistry.TYPED_INSTANCE, + ModelEditPart.MODEL_ID); + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/providers/UMLElementTypes.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/providers/UMLElementTypes.java index 7f4091702a9..5097456f420 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/providers/UMLElementTypes.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/providers/UMLElementTypes.java @@ -1,308 +1,308 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.providers;
-
-import java.util.HashSet;
-import java.util.IdentityHashMap;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.ENamedElement;
-import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.papyrus.infra.gmfdiag.common.providers.DiagramElementTypes;
-import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.providers.DiagramElementTypeImages;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.CommentEditPartCN;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ConnectorDurationObservationEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ConnectorTimeObservationEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ConstraintEditPartCN;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.DurationObservationEditPartCN;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.InteractionEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.LifelineEditPartCN;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.MessageEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ModelEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.TimeObservationEditPartCN;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditorPlugin;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * @generated
- */
-public class UMLElementTypes {
-
- /**
- * @generated
- */
- private UMLElementTypes() {
- }
-
- /**
- * @generated
- */
- private static Map<IElementType, ENamedElement> elements;
-
- /**
- * @generated
- */
- private static DiagramElementTypeImages elementTypeImages = new DiagramElementTypeImages(UMLDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory());
-
- /**
- * @generated
- */
- private static Set<IElementType> KNOWN_ELEMENT_TYPES;
-
- /**
- * @generated
- */
- public static final IElementType Package_CommunicationDiagram = getElementTypeByUniqueId("org.eclipse.papyrus.uml.diagram.communication.Package_CommunicationDiagram"); //$NON-NLS-1$
- /**
- * @generated
- */
- public static final IElementType Interaction_Shape = getElementTypeByUniqueId("org.eclipse.papyrus.umldi.Interaction_Shape"); //$NON-NLS-1$
- /**
- * @generated
- */
- public static final IElementType Lifeline_Shape = getElementTypeByUniqueId("org.eclipse.papyrus.umldi.Lifeline_Shape"); //$NON-NLS-1$
- /**
- * @generated
- */
- public static final IElementType Constraint_Shape = getElementTypeByUniqueId("org.eclipse.papyrus.umldi.Constraint_Shape"); //$NON-NLS-1$
- /**
- * @generated
- */
- public static final IElementType Comment_Shape = getElementTypeByUniqueId("org.eclipse.papyrus.umldi.Comment_Shape"); //$NON-NLS-1$
- /**
- * @generated
- */
- public static final IElementType TimeObservation_Shape = getElementTypeByUniqueId("org.eclipse.papyrus.umldi.TimeObservation_Shape"); //$NON-NLS-1$
- /**
- * @generated
- */
- public static final IElementType DurationObservation_Shape = getElementTypeByUniqueId("org.eclipse.papyrus.umldi.DurationObservation_Shape"); //$NON-NLS-1$
- /**
- * @generated
- */
- public static final IElementType Path_Edge = getElementTypeByUniqueId("org.eclipse.papyrus.uml.communication.Path_Edge"); //$NON-NLS-1$
- /**
- * @generated
- */
- public static final IElementType Comment_AnnotatedElementEdge = getElementTypeByUniqueId("org.eclipse.papyrus.umldi.Comment_AnnotatedElementEdge"); //$NON-NLS-1$
- /**
- * @generated
- */
- public static final IElementType Constraint_ConstrainedElementEdge = getElementTypeByUniqueId("org.eclipse.papyrus.umldi.Constraint_ConstrainedElementEdge"); //$NON-NLS-1$
- /**
- * @generated
- */
- public static final IElementType DurationObservation_EventEdge = getElementTypeByUniqueId("org.eclipse.papyrus.umldi.DurationObservation_EventEdge"); //$NON-NLS-1$
- /**
- * @generated
- */
- public static final IElementType TimeObservation_EventEdge = getElementTypeByUniqueId("org.eclipse.papyrus.umldi.TimeObservation_EventEdge"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static ImageDescriptor getImageDescriptor(ENamedElement element) {
- return elementTypeImages.getImageDescriptor(element);
- }
-
- /**
- * @generated
- */
- public static Image getImage(ENamedElement element) {
- return elementTypeImages.getImage(element);
- }
-
- /**
- * @generated
- */
- public static ImageDescriptor getImageDescriptor(IAdaptable hint) {
- return getImageDescriptor(getElement(hint));
- }
-
- /**
- * @generated
- */
- public static Image getImage(IAdaptable hint) {
- return getImage(getElement(hint));
- }
-
- /**
- * Returns 'type' of the ecore object associated with the hint.
- *
- * @generated
- */
- public static synchronized ENamedElement getElement(IAdaptable hint) {
- Object type = hint.getAdapter(IElementType.class);
- if (elements == null) {
- elements = new IdentityHashMap<IElementType, ENamedElement>();
-
- elements.put(Package_CommunicationDiagram, UMLPackage.eINSTANCE.getPackage());
-
-
- elements.put(Interaction_Shape, UMLPackage.eINSTANCE.getInteraction());
-
-
- elements.put(Lifeline_Shape, UMLPackage.eINSTANCE.getLifeline());
-
-
- elements.put(Constraint_Shape, UMLPackage.eINSTANCE.getConstraint());
-
-
- elements.put(Comment_Shape, UMLPackage.eINSTANCE.getComment());
-
-
- elements.put(TimeObservation_Shape, UMLPackage.eINSTANCE.getTimeObservation());
-
-
- elements.put(DurationObservation_Shape, UMLPackage.eINSTANCE.getDurationObservation());
-
-
- elements.put(Path_Edge, UMLPackage.eINSTANCE.getMessage());
-
- elements.put(Comment_AnnotatedElementEdge, UMLPackage.eINSTANCE.getComment_AnnotatedElement());
-
- elements.put(Constraint_ConstrainedElementEdge, UMLPackage.eINSTANCE.getConstraint_ConstrainedElement());
-
- elements.put(DurationObservation_EventEdge, UMLPackage.eINSTANCE.getDurationObservation_Event());
-
- elements.put(TimeObservation_EventEdge, UMLPackage.eINSTANCE.getTimeObservation_Event());
- }
- return elements.get(type);
- }
-
- /**
- * @generated
- */
- private static IElementType getElementTypeByUniqueId(String id) {
- return ElementTypeRegistry.getInstance().getType(id);
- }
-
- /**
- * @generated
- */
- public static synchronized boolean isKnownElementType(IElementType elementType) {
- if (KNOWN_ELEMENT_TYPES == null) {
- KNOWN_ELEMENT_TYPES = new HashSet<IElementType>();
- KNOWN_ELEMENT_TYPES.add(Package_CommunicationDiagram);
- KNOWN_ELEMENT_TYPES.add(Interaction_Shape);
- KNOWN_ELEMENT_TYPES.add(Lifeline_Shape);
- KNOWN_ELEMENT_TYPES.add(Constraint_Shape);
- KNOWN_ELEMENT_TYPES.add(Comment_Shape);
- KNOWN_ELEMENT_TYPES.add(TimeObservation_Shape);
- KNOWN_ELEMENT_TYPES.add(DurationObservation_Shape);
- KNOWN_ELEMENT_TYPES.add(Path_Edge);
- KNOWN_ELEMENT_TYPES.add(Comment_AnnotatedElementEdge);
- KNOWN_ELEMENT_TYPES.add(Constraint_ConstrainedElementEdge);
- KNOWN_ELEMENT_TYPES.add(DurationObservation_EventEdge);
- KNOWN_ELEMENT_TYPES.add(TimeObservation_EventEdge);
- }
-
- boolean result = KNOWN_ELEMENT_TYPES.contains(elementType);
-
- if (!result) {
- IElementType[] supertypes = elementType.getAllSuperTypes();
- for (int i = 0; !result && (i < supertypes.length); i++) {
- result = KNOWN_ELEMENT_TYPES.contains(supertypes[i]);
- }
- }
-
- return result;
- }
-
- /**
- * @generated
- */
- public static IElementType getElementType(String visualID) {
- if (visualID != null) {
- switch (visualID) {
- case ModelEditPart.VISUAL_ID:
- return Package_CommunicationDiagram;
- case InteractionEditPart.VISUAL_ID:
- return Interaction_Shape;
- case LifelineEditPartCN.VISUAL_ID:
- return Lifeline_Shape;
- case ConstraintEditPartCN.VISUAL_ID:
- return Constraint_Shape;
- case CommentEditPartCN.VISUAL_ID:
- return Comment_Shape;
- case TimeObservationEditPartCN.VISUAL_ID:
- return TimeObservation_Shape;
- case DurationObservationEditPartCN.VISUAL_ID:
- return DurationObservation_Shape;
- case MessageEditPart.VISUAL_ID:
- return Path_Edge;
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return Comment_AnnotatedElementEdge;
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return Constraint_ConstrainedElementEdge;
- case ConnectorDurationObservationEditPart.VISUAL_ID:
- return DurationObservation_EventEdge;
- case ConnectorTimeObservationEditPart.VISUAL_ID:
- return TimeObservation_EventEdge;
- }
- }
- return null;
- }
-
- /**
- * @generated
- */
- public static final DiagramElementTypes TYPED_INSTANCE = new DiagramElementTypes(elementTypeImages) {
-
- /**
- * @generated
- */
- @Override
- public boolean isKnownElementType(IElementType elementType) {
- return org.eclipse.papyrus.uml.diagram.communication.providers.UMLElementTypes.isKnownElementType(elementType);
- }
-
- /**
- * @generated
- */
- @Override
- public IElementType getElementTypeForVisualId(String visualID) {
- return org.eclipse.papyrus.uml.diagram.communication.providers.UMLElementTypes.getElementType(visualID);
- }
-
- /**
- * @generated
- */
- @Override
- public ENamedElement getDefiningNamedElement(IAdaptable elementTypeAdapter) {
- return org.eclipse.papyrus.uml.diagram.communication.providers.UMLElementTypes.getElement(elementTypeAdapter);
- }
- };
-
- /**
- * @generated
- */
- public static boolean isKindOf(IElementType subtype, IElementType supertype) {
- boolean result = subtype == supertype;
-
- if (!result) {
- IElementType[] supertypes = subtype.getAllSuperTypes();
- for (int i = 0; !result && (i < supertypes.length); i++) {
- result = supertype == supertypes[i];
- }
- }
-
- return result;
- }
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.providers; + +import java.util.HashSet; +import java.util.IdentityHashMap; +import java.util.Map; +import java.util.Set; + +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.emf.ecore.ENamedElement; +import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.papyrus.infra.gmfdiag.common.providers.DiagramElementTypes; +import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.providers.DiagramElementTypeImages; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.CommentAnnotatedElementEditPart; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.CommentEditPartCN; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ConnectorDurationObservationEditPart; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ConnectorTimeObservationEditPart; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ConstraintConstrainedElementEditPart; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ConstraintEditPartCN; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.DurationObservationEditPartCN; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.InteractionEditPart; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.LifelineEditPartCN; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.MessageEditPart; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ModelEditPart; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.TimeObservationEditPartCN; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditorPlugin; +import org.eclipse.swt.graphics.Image; +import org.eclipse.uml2.uml.UMLPackage; + +/** + * @generated + */ +public class UMLElementTypes { + + /** + * @generated + */ + private UMLElementTypes() { + } + + /** + * @generated + */ + private static Map<IElementType, ENamedElement> elements; + + /** + * @generated + */ + private static DiagramElementTypeImages elementTypeImages = new DiagramElementTypeImages(UMLDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory()); + + /** + * @generated + */ + private static Set<IElementType> KNOWN_ELEMENT_TYPES; + + /** + * @generated + */ + public static final IElementType Package_CommunicationDiagram = getElementTypeByUniqueId("org.eclipse.papyrus.uml.diagram.communication.Package_CommunicationDiagram"); //$NON-NLS-1$ + /** + * @generated + */ + public static final IElementType Interaction_Shape = getElementTypeByUniqueId("org.eclipse.papyrus.umldi.Interaction_Shape"); //$NON-NLS-1$ + /** + * @generated + */ + public static final IElementType Lifeline_Shape = getElementTypeByUniqueId("org.eclipse.papyrus.umldi.Lifeline_Shape"); //$NON-NLS-1$ + /** + * @generated + */ + public static final IElementType Constraint_Shape = getElementTypeByUniqueId("org.eclipse.papyrus.umldi.Constraint_Shape"); //$NON-NLS-1$ + /** + * @generated + */ + public static final IElementType Comment_Shape = getElementTypeByUniqueId("org.eclipse.papyrus.umldi.Comment_Shape"); //$NON-NLS-1$ + /** + * @generated + */ + public static final IElementType TimeObservation_Shape = getElementTypeByUniqueId("org.eclipse.papyrus.umldi.TimeObservation_Shape"); //$NON-NLS-1$ + /** + * @generated + */ + public static final IElementType DurationObservation_Shape = getElementTypeByUniqueId("org.eclipse.papyrus.umldi.DurationObservation_Shape"); //$NON-NLS-1$ + /** + * @generated + */ + public static final IElementType Path_Edge = getElementTypeByUniqueId("org.eclipse.papyrus.uml.communication.Path_Edge"); //$NON-NLS-1$ + /** + * @generated + */ + public static final IElementType Comment_AnnotatedElementEdge = getElementTypeByUniqueId("org.eclipse.papyrus.umldi.Comment_AnnotatedElementEdge"); //$NON-NLS-1$ + /** + * @generated + */ + public static final IElementType Constraint_ConstrainedElementEdge = getElementTypeByUniqueId("org.eclipse.papyrus.umldi.Constraint_ConstrainedElementEdge"); //$NON-NLS-1$ + /** + * @generated + */ + public static final IElementType DurationObservation_EventEdge = getElementTypeByUniqueId("org.eclipse.papyrus.umldi.DurationObservation_EventEdge"); //$NON-NLS-1$ + /** + * @generated + */ + public static final IElementType TimeObservation_EventEdge = getElementTypeByUniqueId("org.eclipse.papyrus.umldi.TimeObservation_EventEdge"); //$NON-NLS-1$ + + /** + * @generated + */ + public static ImageDescriptor getImageDescriptor(ENamedElement element) { + return elementTypeImages.getImageDescriptor(element); + } + + /** + * @generated + */ + public static Image getImage(ENamedElement element) { + return elementTypeImages.getImage(element); + } + + /** + * @generated + */ + public static ImageDescriptor getImageDescriptor(IAdaptable hint) { + return getImageDescriptor(getElement(hint)); + } + + /** + * @generated + */ + public static Image getImage(IAdaptable hint) { + return getImage(getElement(hint)); + } + + /** + * Returns 'type' of the ecore object associated with the hint. + * + * @generated + */ + public static synchronized ENamedElement getElement(IAdaptable hint) { + Object type = hint.getAdapter(IElementType.class); + if (elements == null) { + elements = new IdentityHashMap<IElementType, ENamedElement>(); + + elements.put(Package_CommunicationDiagram, UMLPackage.eINSTANCE.getPackage()); + + + elements.put(Interaction_Shape, UMLPackage.eINSTANCE.getInteraction()); + + + elements.put(Lifeline_Shape, UMLPackage.eINSTANCE.getLifeline()); + + + elements.put(Constraint_Shape, UMLPackage.eINSTANCE.getConstraint()); + + + elements.put(Comment_Shape, UMLPackage.eINSTANCE.getComment()); + + + elements.put(TimeObservation_Shape, UMLPackage.eINSTANCE.getTimeObservation()); + + + elements.put(DurationObservation_Shape, UMLPackage.eINSTANCE.getDurationObservation()); + + + elements.put(Path_Edge, UMLPackage.eINSTANCE.getMessage()); + + elements.put(Comment_AnnotatedElementEdge, UMLPackage.eINSTANCE.getComment_AnnotatedElement()); + + elements.put(Constraint_ConstrainedElementEdge, UMLPackage.eINSTANCE.getConstraint_ConstrainedElement()); + + elements.put(DurationObservation_EventEdge, UMLPackage.eINSTANCE.getDurationObservation_Event()); + + elements.put(TimeObservation_EventEdge, UMLPackage.eINSTANCE.getTimeObservation_Event()); + } + return elements.get(type); + } + + /** + * @generated + */ + private static IElementType getElementTypeByUniqueId(String id) { + return ElementTypeRegistry.getInstance().getType(id); + } + + /** + * @generated + */ + public static synchronized boolean isKnownElementType(IElementType elementType) { + if (KNOWN_ELEMENT_TYPES == null) { + KNOWN_ELEMENT_TYPES = new HashSet<IElementType>(); + KNOWN_ELEMENT_TYPES.add(Package_CommunicationDiagram); + KNOWN_ELEMENT_TYPES.add(Interaction_Shape); + KNOWN_ELEMENT_TYPES.add(Lifeline_Shape); + KNOWN_ELEMENT_TYPES.add(Constraint_Shape); + KNOWN_ELEMENT_TYPES.add(Comment_Shape); + KNOWN_ELEMENT_TYPES.add(TimeObservation_Shape); + KNOWN_ELEMENT_TYPES.add(DurationObservation_Shape); + KNOWN_ELEMENT_TYPES.add(Path_Edge); + KNOWN_ELEMENT_TYPES.add(Comment_AnnotatedElementEdge); + KNOWN_ELEMENT_TYPES.add(Constraint_ConstrainedElementEdge); + KNOWN_ELEMENT_TYPES.add(DurationObservation_EventEdge); + KNOWN_ELEMENT_TYPES.add(TimeObservation_EventEdge); + } + + boolean result = KNOWN_ELEMENT_TYPES.contains(elementType); + + if (!result) { + IElementType[] supertypes = elementType.getAllSuperTypes(); + for (int i = 0; !result && (i < supertypes.length); i++) { + result = KNOWN_ELEMENT_TYPES.contains(supertypes[i]); + } + } + + return result; + } + + /** + * @generated + */ + public static IElementType getElementType(String visualID) { + if (visualID != null) { + switch (visualID) { + case ModelEditPart.VISUAL_ID: + return Package_CommunicationDiagram; + case InteractionEditPart.VISUAL_ID: + return Interaction_Shape; + case LifelineEditPartCN.VISUAL_ID: + return Lifeline_Shape; + case ConstraintEditPartCN.VISUAL_ID: + return Constraint_Shape; + case CommentEditPartCN.VISUAL_ID: + return Comment_Shape; + case TimeObservationEditPartCN.VISUAL_ID: + return TimeObservation_Shape; + case DurationObservationEditPartCN.VISUAL_ID: + return DurationObservation_Shape; + case MessageEditPart.VISUAL_ID: + return Path_Edge; + case CommentAnnotatedElementEditPart.VISUAL_ID: + return Comment_AnnotatedElementEdge; + case ConstraintConstrainedElementEditPart.VISUAL_ID: + return Constraint_ConstrainedElementEdge; + case ConnectorDurationObservationEditPart.VISUAL_ID: + return DurationObservation_EventEdge; + case ConnectorTimeObservationEditPart.VISUAL_ID: + return TimeObservation_EventEdge; + } + } + return null; + } + + /** + * @generated + */ + public static final DiagramElementTypes TYPED_INSTANCE = new DiagramElementTypes(elementTypeImages) { + + /** + * @generated + */ + @Override + public boolean isKnownElementType(IElementType elementType) { + return org.eclipse.papyrus.uml.diagram.communication.providers.UMLElementTypes.isKnownElementType(elementType); + } + + /** + * @generated + */ + @Override + public IElementType getElementTypeForVisualId(String visualID) { + return org.eclipse.papyrus.uml.diagram.communication.providers.UMLElementTypes.getElementType(visualID); + } + + /** + * @generated + */ + @Override + public ENamedElement getDefiningNamedElement(IAdaptable elementTypeAdapter) { + return org.eclipse.papyrus.uml.diagram.communication.providers.UMLElementTypes.getElement(elementTypeAdapter); + } + }; + + /** + * @generated + */ + public static boolean isKindOf(IElementType subtype, IElementType supertype) { + boolean result = subtype == supertype; + + if (!result) { + IElementType[] supertypes = subtype.getAllSuperTypes(); + 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.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/providers/UMLIconProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/providers/UMLIconProvider.java index 3ff393c9d81..6cb40a97357 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/providers/UMLIconProvider.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/providers/UMLIconProvider.java @@ -1,29 +1,29 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.providers;
-
-import org.eclipse.gmf.runtime.common.ui.services.icon.IIconProvider;
-import org.eclipse.papyrus.infra.gmfdiag.common.providers.DefaultElementTypeIconProvider;
-
-/**
- * @generated
- */
-public class UMLIconProvider extends DefaultElementTypeIconProvider implements IIconProvider {
-
- /**
- * @generated
- */
- public UMLIconProvider() {
- super(UMLElementTypes.TYPED_INSTANCE);
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.providers; + +import org.eclipse.gmf.runtime.common.ui.services.icon.IIconProvider; +import org.eclipse.papyrus.infra.gmfdiag.common.providers.DefaultElementTypeIconProvider; + +/** + * @generated + */ +public class UMLIconProvider extends DefaultElementTypeIconProvider implements IIconProvider { + + /** + * @generated + */ + public UMLIconProvider() { + super(UMLElementTypes.TYPED_INSTANCE); + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/providers/UMLMarkerNavigationProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/providers/UMLMarkerNavigationProvider.java index 611cd34c917..b69899fa88d 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/providers/UMLMarkerNavigationProvider.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/providers/UMLMarkerNavigationProvider.java @@ -1,96 +1,96 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.providers;
-
-import java.util.Arrays;
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor;
-import org.eclipse.gmf.runtime.emf.ui.providers.marker.AbstractModelMarkerNavigationProvider;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditorUtil;
-
-/**
- * @generated
- */
-public class UMLMarkerNavigationProvider extends AbstractModelMarkerNavigationProvider {
-
- /**
- * @generated
- */
- public static final String MARKER_TYPE = UMLDiagramEditorPlugin.ID + ".diagnostic"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- protected void doGotoMarker(IMarker marker) {
- String elementId = marker.getAttribute(org.eclipse.gmf.runtime.common.core.resources.IMarker.ELEMENT_ID, null);
- if (elementId == null || !(getEditor() instanceof DiagramEditor)) {
- return;
- }
- DiagramEditor editor = (DiagramEditor) getEditor();
- Map<?, ?> editPartRegistry = editor.getDiagramGraphicalViewer().getEditPartRegistry();
- EObject targetView = editor.getDiagram().eResource().getEObject(elementId);
- if (targetView == null) {
- return;
- }
- EditPart targetEditPart = (EditPart) editPartRegistry.get(targetView);
- if (targetEditPart != null) {
- UMLDiagramEditorUtil.selectElementsInDiagram(
- editor, Arrays.asList(new EditPart[] { targetEditPart }));
- }
- }
-
- /**
- * @generated
- */
- public static void deleteMarkers(IResource resource) {
- try {
- resource.deleteMarkers(MARKER_TYPE, true, IResource.DEPTH_ZERO);
- } catch (CoreException e) {
- UMLDiagramEditorPlugin.getInstance().logError(
- "Failed to delete validation markers", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public static IMarker addMarker(IFile file, String elementId, String location, String message, int statusSeverity) {
- IMarker marker = null;
- try {
- marker = file.createMarker(MARKER_TYPE);
- marker.setAttribute(IMarker.MESSAGE, message);
- marker.setAttribute(IMarker.LOCATION, location);
- marker.setAttribute(org.eclipse.gmf.runtime.common.core.resources.IMarker.ELEMENT_ID, elementId);
- int markerSeverity = IMarker.SEVERITY_INFO;
- if (statusSeverity == IStatus.WARNING) {
- markerSeverity = IMarker.SEVERITY_WARNING;
- } else if (statusSeverity == IStatus.ERROR ||
- statusSeverity == IStatus.CANCEL) {
- markerSeverity = IMarker.SEVERITY_ERROR;
- }
- marker.setAttribute(IMarker.SEVERITY, markerSeverity);
- } catch (CoreException e) {
- UMLDiagramEditorPlugin.getInstance().logError(
- "Failed to create validation marker", e); //$NON-NLS-1$
- }
- return marker;
- }
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.providers; + +import java.util.Arrays; +import java.util.Map; + +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IMarker; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.gef.EditPart; +import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor; +import org.eclipse.gmf.runtime.emf.ui.providers.marker.AbstractModelMarkerNavigationProvider; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditorPlugin; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditorUtil; + +/** + * @generated + */ +public class UMLMarkerNavigationProvider extends AbstractModelMarkerNavigationProvider { + + /** + * @generated + */ + public static final String MARKER_TYPE = UMLDiagramEditorPlugin.ID + ".diagnostic"; //$NON-NLS-1$ + + /** + * @generated + */ + protected void doGotoMarker(IMarker marker) { + String elementId = marker.getAttribute(org.eclipse.gmf.runtime.common.core.resources.IMarker.ELEMENT_ID, null); + if (elementId == null || !(getEditor() instanceof DiagramEditor)) { + return; + } + DiagramEditor editor = (DiagramEditor) getEditor(); + Map<?, ?> editPartRegistry = editor.getDiagramGraphicalViewer().getEditPartRegistry(); + EObject targetView = editor.getDiagram().eResource().getEObject(elementId); + if (targetView == null) { + return; + } + EditPart targetEditPart = (EditPart) editPartRegistry.get(targetView); + if (targetEditPart != null) { + UMLDiagramEditorUtil.selectElementsInDiagram( + editor, Arrays.asList(new EditPart[] { targetEditPart })); + } + } + + /** + * @generated + */ + public static void deleteMarkers(IResource resource) { + try { + resource.deleteMarkers(MARKER_TYPE, true, IResource.DEPTH_ZERO); + } catch (CoreException e) { + UMLDiagramEditorPlugin.getInstance().logError( + "Failed to delete validation markers", e); //$NON-NLS-1$ + } + } + + /** + * @generated + */ + public static IMarker addMarker(IFile file, String elementId, String location, String message, int statusSeverity) { + IMarker marker = null; + try { + marker = file.createMarker(MARKER_TYPE); + marker.setAttribute(IMarker.MESSAGE, message); + marker.setAttribute(IMarker.LOCATION, location); + marker.setAttribute(org.eclipse.gmf.runtime.common.core.resources.IMarker.ELEMENT_ID, elementId); + int markerSeverity = IMarker.SEVERITY_INFO; + if (statusSeverity == IStatus.WARNING) { + markerSeverity = IMarker.SEVERITY_WARNING; + } else if (statusSeverity == IStatus.ERROR || + statusSeverity == IStatus.CANCEL) { + markerSeverity = IMarker.SEVERITY_ERROR; + } + marker.setAttribute(IMarker.SEVERITY, markerSeverity); + } catch (CoreException e) { + 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.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/providers/UMLParserProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/providers/UMLParserProvider.java index 162485a09b7..6cf6829fd84 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/providers/UMLParserProvider.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/providers/UMLParserProvider.java @@ -1,395 +1,395 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.providers;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.service.AbstractProvider;
-import org.eclipse.gmf.runtime.common.core.service.IOperation;
-import org.eclipse.gmf.runtime.common.ui.services.parser.GetParserOperation;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserProvider;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserService;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ParserHintAdapter;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.common.parser.CommentParser;
-import org.eclipse.papyrus.uml.diagram.common.parser.ConstraintParser;
-import org.eclipse.papyrus.uml.diagram.common.parser.stereotype.AppliedStereotypeParser;
-import org.eclipse.papyrus.uml.diagram.communication.custom.parser.LifelineCustomParsers;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.AppliedStereotypeMessageEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.CommentBodyEditPartCN;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ConstraintBodyEditPartCN;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ConstraintNameEditPartCN;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.DurationObservationLabelEditPartCN;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.DurationObservationStereotypeLabelEditPartCN;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.InteractionFloatingLabelEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.InteractionNameEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.LifelineFloatingLabelEditPartCN;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.LifelineNameEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.MessageNameEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.TimeObservationNameEditPartCN;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.TimeObservationStereotypeLabelEditPartCN;
-import org.eclipse.papyrus.uml.diagram.communication.parsers.MessageFormatParser;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * @generated
- */
-public class UMLParserProvider extends AbstractProvider implements IParserProvider {
-
- /**
- * @generated
- */
- private IParser interaction_NameLabel_Parser;
-
- /**
- * @generated
- */
- private IParser getInteraction_NameLabel_Parser() {
- if (interaction_NameLabel_Parser == 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$
- parser.setEditPattern("{0}"); //$NON-NLS-1$
- interaction_NameLabel_Parser = parser;
- }
- return interaction_NameLabel_Parser;
- }
-
- /**
- * @generated
- */
- private IParser interaction_FloatingNameLabel_Parser;
-
- /**
- * @generated
- */
- private IParser getInteraction_FloatingNameLabel_Parser() {
- if (interaction_FloatingNameLabel_Parser == null) {
- EAttribute[] features = new EAttribute[] {
- UMLPackage.eINSTANCE.getNamedElement_Name()
- };
- MessageFormatParser parser = new MessageFormatParser(features);
- interaction_FloatingNameLabel_Parser = parser;
- }
- return interaction_FloatingNameLabel_Parser;
- }
-
- /**
- * @generated
- */
- private LifelineCustomParsers lifeline_NameLabel_Parser;
-
- /**
- * @generated
- */
- private IParser getLifeline_NameLabel_Parser() {
- if (lifeline_NameLabel_Parser == null) {
- lifeline_NameLabel_Parser = new LifelineCustomParsers();
- }
- return lifeline_NameLabel_Parser;
- }
-
- /**
- * @generated
- */
- private IParser lifeline_FloatingNameLabel_Parser;
-
- /**
- * @generated
- */
- private IParser getLifeline_FloatingNameLabel_Parser() {
- if (lifeline_FloatingNameLabel_Parser == null) {
- EAttribute[] features = new EAttribute[] {
- UMLPackage.eINSTANCE.getNamedElement_Name()
- };
- MessageFormatParser parser = new MessageFormatParser(features);
- lifeline_FloatingNameLabel_Parser = parser;
- }
- return lifeline_FloatingNameLabel_Parser;
- }
-
- /**
- * @generated
- */
- private IParser constraint_NameLabel_Parser;
-
- /**
- * @generated
- */
- private IParser getConstraint_NameLabel_Parser() {
- if (constraint_NameLabel_Parser == null) {
- EAttribute[] features = new EAttribute[] {
- UMLPackage.eINSTANCE.getNamedElement_Name()
- };
- MessageFormatParser parser = new MessageFormatParser(features);
- constraint_NameLabel_Parser = parser;
- }
- return constraint_NameLabel_Parser;
- }
-
- /**
- * @generated
- */
- private ConstraintParser constraint_BodyLabel_Parser;
-
- /**
- * @generated
- */
- private IParser getConstraint_BodyLabel_Parser() {
- if (constraint_BodyLabel_Parser == null) {
- constraint_BodyLabel_Parser = new ConstraintParser();
- }
- return constraint_BodyLabel_Parser;
- }
-
- /**
- * @generated
- */
- private CommentParser comment_BodyLabel_Parser;
-
- /**
- * @generated
- */
- private IParser getComment_BodyLabel_Parser() {
- if (comment_BodyLabel_Parser == null) {
- comment_BodyLabel_Parser = new CommentParser();
- }
- return comment_BodyLabel_Parser;
- }
-
- /**
- * @generated
- */
- private IParser timeObservation_NameLabel_Parser;
-
- /**
- * @generated
- */
- private IParser getTimeObservation_NameLabel_Parser() {
- if (timeObservation_NameLabel_Parser == null) {
- EAttribute[] features = new EAttribute[] {
- UMLPackage.eINSTANCE.getNamedElement_Name()
- };
- MessageFormatParser parser = new MessageFormatParser(features);
- timeObservation_NameLabel_Parser = parser;
- }
- return timeObservation_NameLabel_Parser;
- }
-
- /**
- * @generated
- */
- private AppliedStereotypeParser timeObservation_StereotypeLabel_Parser;
-
- /**
- * @generated
- */
- private IParser getTimeObservation_StereotypeLabel_Parser() {
- if (timeObservation_StereotypeLabel_Parser == null) {
- timeObservation_StereotypeLabel_Parser = new AppliedStereotypeParser();
- }
- return timeObservation_StereotypeLabel_Parser;
- }
-
- /**
- * @generated
- */
- private IParser durationObservation_NameLabel_Parser;
-
- /**
- * @generated
- */
- private IParser getDurationObservation_NameLabel_Parser() {
- if (durationObservation_NameLabel_Parser == null) {
- EAttribute[] features = new EAttribute[] {
- UMLPackage.eINSTANCE.getNamedElement_Name()
- };
- MessageFormatParser parser = new MessageFormatParser(features);
- durationObservation_NameLabel_Parser = parser;
- }
- return durationObservation_NameLabel_Parser;
- }
-
- /**
- * @generated
- */
- private AppliedStereotypeParser durationObservation_StereotypeLabel_Parser;
-
- /**
- * @generated
- */
- private IParser getDurationObservation_StereotypeLabel_Parser() {
- if (durationObservation_StereotypeLabel_Parser == null) {
- durationObservation_StereotypeLabel_Parser = new AppliedStereotypeParser();
- }
- return durationObservation_StereotypeLabel_Parser;
- }
-
- /**
- * @generated
- */
- private IParser path_MessageLabel_Parser;
-
- /**
- * @generated
- */
- private IParser getPath_MessageLabel_Parser() {
- if (path_MessageLabel_Parser == null) {
- EAttribute[] features = new EAttribute[] {
- UMLPackage.eINSTANCE.getNamedElement_Name()
- };
- MessageFormatParser parser = new MessageFormatParser(features);
- parser.setEditorPattern("{0}"); //$NON-NLS-1$
- parser.setEditPattern("{0}"); //$NON-NLS-1$
- path_MessageLabel_Parser = parser;
- }
- return path_MessageLabel_Parser;
- }
-
- /**
- * @generated
- */
- private AppliedStereotypeParser path_StereotypeLabel_Parser;
-
- /**
- * @generated
- */
- private IParser getPath_StereotypeLabel_Parser() {
- if (path_StereotypeLabel_Parser == null) {
- path_StereotypeLabel_Parser = new AppliedStereotypeParser();
- }
- return path_StereotypeLabel_Parser;
- }
-
- /**
- * @generated
- */
- protected IParser getParser(String visualID) {
- if (visualID != null) {
- switch (visualID) {
- case InteractionNameEditPart.VISUAL_ID:
- return getInteraction_NameLabel_Parser();
- case InteractionFloatingLabelEditPart.VISUAL_ID:
- return getInteraction_FloatingNameLabel_Parser();
-
- case LifelineNameEditPart.VISUAL_ID:
- return getLifeline_NameLabel_Parser();
- case LifelineFloatingLabelEditPartCN.VISUAL_ID:
- return getLifeline_FloatingNameLabel_Parser();
-
- case ConstraintNameEditPartCN.VISUAL_ID:
- return getConstraint_NameLabel_Parser();
- case ConstraintBodyEditPartCN.VISUAL_ID:
- return getConstraint_BodyLabel_Parser();
-
- case CommentBodyEditPartCN.VISUAL_ID:
- return getComment_BodyLabel_Parser();
-
- case TimeObservationNameEditPartCN.VISUAL_ID:
- return getTimeObservation_NameLabel_Parser();
- case TimeObservationStereotypeLabelEditPartCN.VISUAL_ID:
- return getTimeObservation_StereotypeLabel_Parser();
-
- case DurationObservationLabelEditPartCN.VISUAL_ID:
- return getDurationObservation_NameLabel_Parser();
- case DurationObservationStereotypeLabelEditPartCN.VISUAL_ID:
- return getDurationObservation_StereotypeLabel_Parser();
-
- case MessageNameEditPart.VISUAL_ID:
- return getPath_MessageLabel_Parser();
- case AppliedStereotypeMessageEditPart.VISUAL_ID:
- return getPath_StereotypeLabel_Parser();
-
-
-
-
-
- }
- }
- return null;
- }
-
- /**
- * Utility method that consults ParserService
- * @generated
- */
- public static IParser getParser(IElementType type, EObject object, String parserHint) {
- return ParserService.getInstance().getParser(new HintAdapter(type, object, parserHint));
- }
-
- /**
- * @generated
- */
- public IParser getParser(IAdaptable hint) {
- String vid = (String) hint.getAdapter(String.class);
- if (vid != null) {
- return getParser(UMLVisualIDRegistry.getVisualID(vid));
- }
- View view = (View) hint.getAdapter(View.class);
- if (view != null) {
- return getParser(UMLVisualIDRegistry.getVisualID(view));
- }
- return null;
- }
-
- /**
- * @generated
- */
- public boolean provides(IOperation operation) {
- if (operation instanceof GetParserOperation) {
- IAdaptable hint = ((GetParserOperation) operation).getHint();
- if (UMLElementTypes.getElement(hint) == null) {
- return false;
- }
- return getParser(hint) != null;
- }
- return false;
- }
-
- /**
- * @generated
- */
- private static class HintAdapter extends ParserHintAdapter {
-
- /**
- * @generated
- */
- private final IElementType elementType;
-
- /**
- * @generated
- */
- public HintAdapter(IElementType type, EObject object, String parserHint) {
- super(object, parserHint);
- assert type != null;
- elementType = type;
- }
-
- /**
- * @generated
- */
- public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) {
- if (IElementType.class.equals(adapter)) {
- return elementType;
- }
- return super.getAdapter(adapter);
- }
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.providers; + +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.gmf.runtime.common.core.service.AbstractProvider; +import org.eclipse.gmf.runtime.common.core.service.IOperation; +import org.eclipse.gmf.runtime.common.ui.services.parser.GetParserOperation; +import org.eclipse.gmf.runtime.common.ui.services.parser.IParser; +import org.eclipse.gmf.runtime.common.ui.services.parser.IParserProvider; +import org.eclipse.gmf.runtime.common.ui.services.parser.ParserService; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.gmf.runtime.emf.ui.services.parser.ParserHintAdapter; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.papyrus.uml.diagram.common.parser.CommentParser; +import org.eclipse.papyrus.uml.diagram.common.parser.ConstraintParser; +import org.eclipse.papyrus.uml.diagram.common.parser.stereotype.AppliedStereotypeParser; +import org.eclipse.papyrus.uml.diagram.communication.custom.parser.LifelineCustomParsers; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.AppliedStereotypeMessageEditPart; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.CommentBodyEditPartCN; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ConstraintBodyEditPartCN; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ConstraintNameEditPartCN; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.DurationObservationLabelEditPartCN; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.DurationObservationStereotypeLabelEditPartCN; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.InteractionFloatingLabelEditPart; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.InteractionNameEditPart; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.LifelineFloatingLabelEditPartCN; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.LifelineNameEditPart; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.MessageNameEditPart; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.TimeObservationNameEditPartCN; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.TimeObservationStereotypeLabelEditPartCN; +import org.eclipse.papyrus.uml.diagram.communication.parsers.MessageFormatParser; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry; +import org.eclipse.uml2.uml.UMLPackage; + +/** + * @generated + */ +public class UMLParserProvider extends AbstractProvider implements IParserProvider { + + /** + * @generated + */ + private IParser interaction_NameLabel_Parser; + + /** + * @generated + */ + private IParser getInteraction_NameLabel_Parser() { + if (interaction_NameLabel_Parser == 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$ + parser.setEditPattern("{0}"); //$NON-NLS-1$ + interaction_NameLabel_Parser = parser; + } + return interaction_NameLabel_Parser; + } + + /** + * @generated + */ + private IParser interaction_FloatingNameLabel_Parser; + + /** + * @generated + */ + private IParser getInteraction_FloatingNameLabel_Parser() { + if (interaction_FloatingNameLabel_Parser == null) { + EAttribute[] features = new EAttribute[] { + UMLPackage.eINSTANCE.getNamedElement_Name() + }; + MessageFormatParser parser = new MessageFormatParser(features); + interaction_FloatingNameLabel_Parser = parser; + } + return interaction_FloatingNameLabel_Parser; + } + + /** + * @generated + */ + private LifelineCustomParsers lifeline_NameLabel_Parser; + + /** + * @generated + */ + private IParser getLifeline_NameLabel_Parser() { + if (lifeline_NameLabel_Parser == null) { + lifeline_NameLabel_Parser = new LifelineCustomParsers(); + } + return lifeline_NameLabel_Parser; + } + + /** + * @generated + */ + private IParser lifeline_FloatingNameLabel_Parser; + + /** + * @generated + */ + private IParser getLifeline_FloatingNameLabel_Parser() { + if (lifeline_FloatingNameLabel_Parser == null) { + EAttribute[] features = new EAttribute[] { + UMLPackage.eINSTANCE.getNamedElement_Name() + }; + MessageFormatParser parser = new MessageFormatParser(features); + lifeline_FloatingNameLabel_Parser = parser; + } + return lifeline_FloatingNameLabel_Parser; + } + + /** + * @generated + */ + private IParser constraint_NameLabel_Parser; + + /** + * @generated + */ + private IParser getConstraint_NameLabel_Parser() { + if (constraint_NameLabel_Parser == null) { + EAttribute[] features = new EAttribute[] { + UMLPackage.eINSTANCE.getNamedElement_Name() + }; + MessageFormatParser parser = new MessageFormatParser(features); + constraint_NameLabel_Parser = parser; + } + return constraint_NameLabel_Parser; + } + + /** + * @generated + */ + private ConstraintParser constraint_BodyLabel_Parser; + + /** + * @generated + */ + private IParser getConstraint_BodyLabel_Parser() { + if (constraint_BodyLabel_Parser == null) { + constraint_BodyLabel_Parser = new ConstraintParser(); + } + return constraint_BodyLabel_Parser; + } + + /** + * @generated + */ + private CommentParser comment_BodyLabel_Parser; + + /** + * @generated + */ + private IParser getComment_BodyLabel_Parser() { + if (comment_BodyLabel_Parser == null) { + comment_BodyLabel_Parser = new CommentParser(); + } + return comment_BodyLabel_Parser; + } + + /** + * @generated + */ + private IParser timeObservation_NameLabel_Parser; + + /** + * @generated + */ + private IParser getTimeObservation_NameLabel_Parser() { + if (timeObservation_NameLabel_Parser == null) { + EAttribute[] features = new EAttribute[] { + UMLPackage.eINSTANCE.getNamedElement_Name() + }; + MessageFormatParser parser = new MessageFormatParser(features); + timeObservation_NameLabel_Parser = parser; + } + return timeObservation_NameLabel_Parser; + } + + /** + * @generated + */ + private AppliedStereotypeParser timeObservation_StereotypeLabel_Parser; + + /** + * @generated + */ + private IParser getTimeObservation_StereotypeLabel_Parser() { + if (timeObservation_StereotypeLabel_Parser == null) { + timeObservation_StereotypeLabel_Parser = new AppliedStereotypeParser(); + } + return timeObservation_StereotypeLabel_Parser; + } + + /** + * @generated + */ + private IParser durationObservation_NameLabel_Parser; + + /** + * @generated + */ + private IParser getDurationObservation_NameLabel_Parser() { + if (durationObservation_NameLabel_Parser == null) { + EAttribute[] features = new EAttribute[] { + UMLPackage.eINSTANCE.getNamedElement_Name() + }; + MessageFormatParser parser = new MessageFormatParser(features); + durationObservation_NameLabel_Parser = parser; + } + return durationObservation_NameLabel_Parser; + } + + /** + * @generated + */ + private AppliedStereotypeParser durationObservation_StereotypeLabel_Parser; + + /** + * @generated + */ + private IParser getDurationObservation_StereotypeLabel_Parser() { + if (durationObservation_StereotypeLabel_Parser == null) { + durationObservation_StereotypeLabel_Parser = new AppliedStereotypeParser(); + } + return durationObservation_StereotypeLabel_Parser; + } + + /** + * @generated + */ + private IParser path_MessageLabel_Parser; + + /** + * @generated + */ + private IParser getPath_MessageLabel_Parser() { + if (path_MessageLabel_Parser == null) { + EAttribute[] features = new EAttribute[] { + UMLPackage.eINSTANCE.getNamedElement_Name() + }; + MessageFormatParser parser = new MessageFormatParser(features); + parser.setEditorPattern("{0}"); //$NON-NLS-1$ + parser.setEditPattern("{0}"); //$NON-NLS-1$ + path_MessageLabel_Parser = parser; + } + return path_MessageLabel_Parser; + } + + /** + * @generated + */ + private AppliedStereotypeParser path_StereotypeLabel_Parser; + + /** + * @generated + */ + private IParser getPath_StereotypeLabel_Parser() { + if (path_StereotypeLabel_Parser == null) { + path_StereotypeLabel_Parser = new AppliedStereotypeParser(); + } + return path_StereotypeLabel_Parser; + } + + /** + * @generated + */ + protected IParser getParser(String visualID) { + if (visualID != null) { + switch (visualID) { + case InteractionNameEditPart.VISUAL_ID: + return getInteraction_NameLabel_Parser(); + case InteractionFloatingLabelEditPart.VISUAL_ID: + return getInteraction_FloatingNameLabel_Parser(); + + case LifelineNameEditPart.VISUAL_ID: + return getLifeline_NameLabel_Parser(); + case LifelineFloatingLabelEditPartCN.VISUAL_ID: + return getLifeline_FloatingNameLabel_Parser(); + + case ConstraintNameEditPartCN.VISUAL_ID: + return getConstraint_NameLabel_Parser(); + case ConstraintBodyEditPartCN.VISUAL_ID: + return getConstraint_BodyLabel_Parser(); + + case CommentBodyEditPartCN.VISUAL_ID: + return getComment_BodyLabel_Parser(); + + case TimeObservationNameEditPartCN.VISUAL_ID: + return getTimeObservation_NameLabel_Parser(); + case TimeObservationStereotypeLabelEditPartCN.VISUAL_ID: + return getTimeObservation_StereotypeLabel_Parser(); + + case DurationObservationLabelEditPartCN.VISUAL_ID: + return getDurationObservation_NameLabel_Parser(); + case DurationObservationStereotypeLabelEditPartCN.VISUAL_ID: + return getDurationObservation_StereotypeLabel_Parser(); + + case MessageNameEditPart.VISUAL_ID: + return getPath_MessageLabel_Parser(); + case AppliedStereotypeMessageEditPart.VISUAL_ID: + return getPath_StereotypeLabel_Parser(); + + + + + + } + } + return null; + } + + /** + * Utility method that consults ParserService + * @generated + */ + public static IParser getParser(IElementType type, EObject object, String parserHint) { + return ParserService.getInstance().getParser(new HintAdapter(type, object, parserHint)); + } + + /** + * @generated + */ + public IParser getParser(IAdaptable hint) { + String vid = (String) hint.getAdapter(String.class); + if (vid != null) { + return getParser(UMLVisualIDRegistry.getVisualID(vid)); + } + View view = (View) hint.getAdapter(View.class); + if (view != null) { + return getParser(UMLVisualIDRegistry.getVisualID(view)); + } + return null; + } + + /** + * @generated + */ + public boolean provides(IOperation operation) { + if (operation instanceof GetParserOperation) { + IAdaptable hint = ((GetParserOperation) operation).getHint(); + if (UMLElementTypes.getElement(hint) == null) { + return false; + } + return getParser(hint) != null; + } + return false; + } + + /** + * @generated + */ + private static class HintAdapter extends ParserHintAdapter { + + /** + * @generated + */ + private final IElementType elementType; + + /** + * @generated + */ + public HintAdapter(IElementType type, EObject object, String parserHint) { + super(object, parserHint); + assert type != null; + elementType = type; + } + + /** + * @generated + */ + public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) { + if (IElementType.class.equals(adapter)) { + return elementType; + } + return super.getAdapter(adapter); + } + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/providers/UMLValidationDecoratorProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/providers/UMLValidationDecoratorProvider.java index 80ebb9e2f29..8f7f53adb15 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/providers/UMLValidationDecoratorProvider.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/providers/UMLValidationDecoratorProvider.java @@ -1,72 +1,72 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.providers;
-
-import org.eclipse.gef.EditDomain;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.editparts.AbstractConnectionEditPart;
-import org.eclipse.gmf.runtime.common.core.service.IOperation;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditDomain;
-import org.eclipse.gmf.runtime.diagram.ui.services.decorator.CreateDecoratorsOperation;
-import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorProvider;
-import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorTarget;
-import org.eclipse.gmf.runtime.notation.Edge;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.common.providers.ValidationDecoratorProvider;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ModelEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditor;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry;
-
-/**
- * @generated
- */
-public class UMLValidationDecoratorProvider extends ValidationDecoratorProvider implements IDecoratorProvider {
-
- /**
- * @generated
- */
- public void createDecorators(IDecoratorTarget decoratorTarget) {
- 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()) {
- return;
- }
- }
- EditDomain ed = editPart.getViewer().getEditDomain();
- if (!(ed instanceof DiagramEditDomain)) {
- return;
- }
- if (((DiagramEditDomain) ed).getEditorPart() instanceof UMLDiagramEditor) {
- decoratorTarget.installDecorator(KEY, new StatusDecorator(decoratorTarget));
- }
- }
- }
-
- /**
- * @generated
- */
- public boolean provides(IOperation operation) {
- if (!(operation instanceof CreateDecoratorsOperation)) {
- return false;
- }
- IDecoratorTarget decoratorTarget = ((CreateDecoratorsOperation) operation).getDecoratorTarget();
- View view = (View) decoratorTarget.getAdapter(
- View.class);
- return view != null && ModelEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(view));
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.providers; + +import org.eclipse.gef.EditDomain; +import org.eclipse.gef.EditPart; +import org.eclipse.gef.editparts.AbstractConnectionEditPart; +import org.eclipse.gmf.runtime.common.core.service.IOperation; +import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart; +import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditDomain; +import org.eclipse.gmf.runtime.diagram.ui.services.decorator.CreateDecoratorsOperation; +import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorProvider; +import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorTarget; +import org.eclipse.gmf.runtime.notation.Edge; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.papyrus.uml.diagram.common.providers.ValidationDecoratorProvider; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ModelEditPart; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditor; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry; + +/** + * @generated + */ +public class UMLValidationDecoratorProvider extends ValidationDecoratorProvider implements IDecoratorProvider { + + /** + * @generated + */ + public void createDecorators(IDecoratorTarget decoratorTarget) { + 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()) { + return; + } + } + EditDomain ed = editPart.getViewer().getEditDomain(); + if (!(ed instanceof DiagramEditDomain)) { + return; + } + if (((DiagramEditDomain) ed).getEditorPart() instanceof UMLDiagramEditor) { + decoratorTarget.installDecorator(KEY, new StatusDecorator(decoratorTarget)); + } + } + } + + /** + * @generated + */ + public boolean provides(IOperation operation) { + if (!(operation instanceof CreateDecoratorsOperation)) { + return false; + } + IDecoratorTarget decoratorTarget = ((CreateDecoratorsOperation) operation).getDecoratorTarget(); + View view = (View) decoratorTarget.getAdapter( + View.class); + return view != null && ModelEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(view)); + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/providers/UMLValidationProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/providers/UMLValidationProvider.java index b069d2caf23..c161a76eefc 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/providers/UMLValidationProvider.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/providers/UMLValidationProvider.java @@ -1,77 +1,77 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.providers;
-
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ModelEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditorPlugin;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry;
-
-/**
- * @generated
- */
-public class UMLValidationProvider {
-
- /**
- * @generated
- */
- private static boolean constraintsActive = false;
-
- /**
- * @generated
- */
- public static boolean shouldConstraintsBePrivate() {
- return false;
- }
-
- /**
- * @generated
- */
- public static void runWithConstraints(TransactionalEditingDomain editingDomain, Runnable operation) {
- final Runnable op = operation;
- Runnable task = new Runnable() {
- @Override
- public void run() {
- try {
- constraintsActive = true;
- op.run();
- } finally {
- constraintsActive = false;
- }
- }
- };
- if (editingDomain != null) {
- try {
- editingDomain.runExclusive(task);
- } catch (Exception e) {
- UMLDiagramEditorPlugin.getInstance().logError("Validation failed", e); //$NON-NLS-1$
- }
- } else {
- task.run();
- }
- }
-
- /**
- * @generated
- */
- static boolean isInDefaultEditorContext(Object object) {
- if (shouldConstraintsBePrivate() && !constraintsActive) {
- return false;
- }
- if (object instanceof View) {
- return constraintsActive && ModelEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID((View) object));
- }
- return true;
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.providers; + +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ModelEditPart; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLDiagramEditorPlugin; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry; + +/** + * @generated + */ +public class UMLValidationProvider { + + /** + * @generated + */ + private static boolean constraintsActive = false; + + /** + * @generated + */ + public static boolean shouldConstraintsBePrivate() { + return false; + } + + /** + * @generated + */ + public static void runWithConstraints(TransactionalEditingDomain editingDomain, Runnable operation) { + final Runnable op = operation; + Runnable task = new Runnable() { + @Override + public void run() { + try { + constraintsActive = true; + op.run(); + } finally { + constraintsActive = false; + } + } + }; + if (editingDomain != null) { + try { + editingDomain.runExclusive(task); + } catch (Exception e) { + UMLDiagramEditorPlugin.getInstance().logError("Validation failed", e); //$NON-NLS-1$ + } + } else { + task.run(); + } + } + + /** + * @generated + */ + static boolean isInDefaultEditorContext(Object object) { + if (shouldConstraintsBePrivate() && !constraintsActive) { + return false; + } + if (object instanceof View) { + return constraintsActive && ModelEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID((View) object)); + } + return true; + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/providers/UMLViewProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/providers/UMLViewProvider.java index e29e2e12e8a..abe4a4ac247 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/providers/UMLViewProvider.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/providers/UMLViewProvider.java @@ -1,739 +1,738 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.providers;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EcoreFactory;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gmf.runtime.common.core.service.AbstractProvider;
-import org.eclipse.gmf.runtime.common.core.service.IOperation;
-import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
-import org.eclipse.gmf.runtime.diagram.core.providers.IViewProvider;
-import org.eclipse.gmf.runtime.diagram.core.services.view.CreateChildViewOperation;
-import org.eclipse.gmf.runtime.diagram.core.services.view.CreateDiagramViewOperation;
-import org.eclipse.gmf.runtime.diagram.core.services.view.CreateEdgeViewOperation;
-import org.eclipse.gmf.runtime.diagram.core.services.view.CreateNodeViewOperation;
-import org.eclipse.gmf.runtime.diagram.core.services.view.CreateViewForKindOperation;
-import org.eclipse.gmf.runtime.diagram.core.services.view.CreateViewOperation;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
-import org.eclipse.gmf.runtime.emf.core.util.EMFCoreUtil;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
-import org.eclipse.gmf.runtime.notation.Connector;
-import org.eclipse.gmf.runtime.notation.DecorationNode;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.Edge;
-import org.eclipse.gmf.runtime.notation.FillStyle;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.Location;
-import org.eclipse.gmf.runtime.notation.MeasurementUnit;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.NotationFactory;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.RelativeBendpoints;
-import org.eclipse.gmf.runtime.notation.Shape;
-import org.eclipse.gmf.runtime.notation.TitleStyle;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.gmf.runtime.notation.datatype.RelativeBendpoint;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper;
-import org.eclipse.papyrus.infra.gmfdiag.common.reconciler.DiagramVersioningUtils;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter;
-import org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.AppliedStereotypeMessageEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.CommentAnnotatedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.CommentBodyEditPartCN;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.CommentEditPartCN;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ConnectorDurationObservationEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ConnectorTimeObservationEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ConstraintBodyEditPartCN;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ConstraintConstrainedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ConstraintEditPartCN;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ConstraintNameEditPartCN;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.DurationObservationEditPartCN;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.DurationObservationLabelEditPartCN;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.DurationObservationStereotypeLabelEditPartCN;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.InteractionCompartmentEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.InteractionEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.InteractionFloatingLabelEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.InteractionNameEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.LifelineEditPartCN;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.LifelineFloatingLabelEditPartCN;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.LifelineNameEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.MessageEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.MessageNameEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ModelEditPart;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.TimeObservationEditPartCN;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.TimeObservationNameEditPartCN;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.TimeObservationStereotypeLabelEditPartCN;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.FontData;
-
-/**
- * @generated
- */
-public class UMLViewProvider extends AbstractProvider implements IViewProvider {
-
- /**
- * @generated
- */
- public final boolean provides(IOperation operation) {
- if (operation instanceof CreateViewForKindOperation) {
- return provides((CreateViewForKindOperation) operation);
- }
- assert operation instanceof CreateViewOperation;
-
- /* we check this view provider is the good one for the currently edited diagram */
- if (operation instanceof CreateChildViewOperation) {
- View container = ((CreateChildViewOperation) operation).getContainerView();
- Diagram diagram = container.getDiagram();
- if (!getDiagramProvidedId().equals(diagram.getType())) {
- return false;
- }
- }
-
- if (operation instanceof CreateDiagramViewOperation) {
- return provides((CreateDiagramViewOperation) operation);
- } else if (operation instanceof CreateEdgeViewOperation) {
- return provides((CreateEdgeViewOperation) operation);
- } else if (operation instanceof CreateNodeViewOperation) {
- return provides((CreateNodeViewOperation) operation);
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected boolean provides(CreateViewForKindOperation op) {
- /*
- if (op.getViewKind() == Node.class)
- return getNodeViewClass(op.getSemanticAdapter(), op.getContainerView(), op.getSemanticHint()) != null;
- if (op.getViewKind() == Edge.class)
- return getEdgeViewClass(op.getSemanticAdapter(), op.getContainerView(), op.getSemanticHint()) != null;
- */
-
- // check Diagram Type should be the class diagram
- String modelID = UMLVisualIDRegistry.getModelID(op.getContainerView());
- if (!getDiagramProvidedId().equals(modelID)) {
- return false;
- }
-
- String visualID = UMLVisualIDRegistry.getVisualID(op.getSemanticHint());
- if (Node.class.isAssignableFrom(op.getViewKind())) {
- return UMLVisualIDRegistry.canCreateNode(op.getContainerView(), visualID);
- }
-
- return true;
- }
-
- /**
- * @generated
- */
- protected String getDiagramProvidedId() {
- /*
- * Indicates for which diagram this provider works for.
- * <p>
- * This method can be overloaded when diagram editor inherits from another one, but should never be <code>null</code>
- * </p>
- *
- * @return the unique identifier of the diagram for which views are provided.
- */
- return ModelEditPart.MODEL_ID;
- }
-
- /**
- * @generated
- */
- protected boolean provides(CreateDiagramViewOperation op) {
- return ModelEditPart.MODEL_ID.equals(op.getSemanticHint()) && UMLVisualIDRegistry.getDiagramVisualID(getSemanticElement(op.getSemanticAdapter())) != null && !UMLVisualIDRegistry.getDiagramVisualID(getSemanticElement(op.getSemanticAdapter())).isEmpty();
- }
-
- /**
- * @generated
- */
- protected boolean provides(CreateNodeViewOperation op) {
- if (op.getContainerView() == null) {
- return false;
- }
- IElementType elementType = getSemanticElementType(op.getSemanticAdapter());
- EObject domainElement = getSemanticElement(op.getSemanticAdapter());
- String visualID;
- if (op.getSemanticHint() == null) {
- // Semantic hint is not specified. Can be a result of call from CanonicalEditPolicy.
- // In this situation there should be NO elementType, visualID will be determined
- // by VisualIDRegistry.getNodeVisualID() for domainElement.
- if (elementType != null || domainElement == null) {
- return false;
- }
- visualID = UMLVisualIDRegistry.getNodeVisualID(op.getContainerView(), domainElement);
- } else {
- visualID = UMLVisualIDRegistry.getVisualID(op.getSemanticHint());
- 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)) {
- return false; // if semantic hint is specified it should be the same as in element type
- }
- //if (domainElement != null && !visualID.equals(org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry.getNodeVisualID(op.getContainerView(), domainElement))) {
- // return false; // visual id for node EClass should match visual id from element type
- //}
- } else {
- if (!ModelEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(op.getContainerView()))) {
- return false; // foreign diagram
- }
- if (visualID != null) {
- switch (visualID) {
- case InteractionEditPart.VISUAL_ID:
- case LifelineEditPartCN.VISUAL_ID:
- case ConstraintEditPartCN.VISUAL_ID:
- case CommentEditPartCN.VISUAL_ID:
- case TimeObservationEditPartCN.VISUAL_ID:
- case DurationObservationEditPartCN.VISUAL_ID:
- if (domainElement == null || !visualID.equals(UMLVisualIDRegistry.getNodeVisualID(op.getContainerView(), domainElement))) {
- return false; // visual id in semantic hint should match visual id for domain element
- }
- break;
- default:
- return false;
- }
- }
- }
- }
-
- return UMLVisualIDRegistry.canCreateNode(op.getContainerView(), visualID);
- }
-
- /**
- * @generated
- */
- protected boolean provides(CreateEdgeViewOperation op) {
- IElementType elementType = getSemanticElementType(op.getSemanticAdapter());
-
- if (!UMLElementTypes.isKnownElementType(elementType) || (!(elementType instanceof IHintedType))) {
- return false; // foreign element type
- }
-
- String elementTypeHint = ((IHintedType) elementType).getSemanticHint();
- if (elementTypeHint == null || (op.getSemanticHint() != null && !elementTypeHint.equals(op.getSemanticHint()))) {
- return false; // our hint is visual id and must be specified, and it should be the same as in element type
- }
- //String visualID = org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry.getVisualID(elementTypeHint);
- //org.eclipse.emf.ecore.EObject domainElement = getSemanticElement(op.getSemanticAdapter());
- //if (domainElement != null && !visualID.equals(org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry.getLinkWithClassVisualID(domainElement))) {
- // return false; // visual id for link EClass should match visual id from element type
- //}
- return true;
- }
-
- /**
- * @generated
- */
- @SuppressWarnings("unchecked")
- public Diagram createDiagram(IAdaptable semanticAdapter, String diagramKind, PreferencesHint preferencesHint) {
- Diagram diagram = NotationFactory.eINSTANCE.createDiagram();
- DiagramVersioningUtils.stampCurrentVersion(diagram);
- diagram.getStyles().add(NotationFactory.eINSTANCE.createDiagramStyle());
- diagram.setType(ModelEditPart.MODEL_ID);
- diagram.setElement(getSemanticElement(semanticAdapter));
- diagram.setMeasurementUnit(MeasurementUnit.PIXEL_LITERAL);
- return diagram;
- }
-
- /**
- * @generated
- */
- public Node createNode(IAdaptable semanticAdapter, View containerView, String semanticHint, int index,
- boolean persisted, PreferencesHint preferencesHint) {
- final EObject domainElement = getSemanticElement(semanticAdapter);
- final String visualID;
- if (semanticHint == null) {
- visualID = UMLVisualIDRegistry.getNodeVisualID(containerView, domainElement);
- } else {
- visualID = UMLVisualIDRegistry.getVisualID(semanticHint);
- }
- if (visualID != null) {
- switch (visualID) {
- case InteractionEditPart.VISUAL_ID:
- return createInteraction_Shape(domainElement, containerView, index, persisted, preferencesHint);
- case LifelineEditPartCN.VISUAL_ID:
- return createLifeline_Shape(domainElement, containerView, index, persisted, preferencesHint);
- case ConstraintEditPartCN.VISUAL_ID:
- return createConstraint_Shape(domainElement, containerView, index, persisted, preferencesHint);
- case CommentEditPartCN.VISUAL_ID:
- return createComment_Shape(domainElement, containerView, index, persisted, preferencesHint);
- case TimeObservationEditPartCN.VISUAL_ID:
- return createTimeObservation_Shape(domainElement, containerView, index, persisted, preferencesHint);
- case DurationObservationEditPartCN.VISUAL_ID:
- return createDurationObservation_Shape(domainElement, containerView, index, persisted, preferencesHint);
- }
- }
- // can't happen, provided #provides(CreateNodeViewOperation) is correct
- return null;
- }
-
- /**
- * @generated
- */
- public Edge createEdge(IAdaptable semanticAdapter, View containerView, String semanticHint, int index,
- boolean persisted, PreferencesHint preferencesHint) {
- IElementType elementType = getSemanticElementType(semanticAdapter);
- String elementTypeHint = ((IHintedType) elementType).getSemanticHint();
- String vid = UMLVisualIDRegistry.getVisualID(elementTypeHint);
- if (vid != null) {
- switch (vid) {
- case MessageEditPart.VISUAL_ID:
- return createPath_Edge(getSemanticElement(semanticAdapter), containerView, index, persisted, preferencesHint);
- case CommentAnnotatedElementEditPart.VISUAL_ID:
- return createComment_AnnotatedElementEdge(containerView, index, persisted, preferencesHint);
- case ConstraintConstrainedElementEditPart.VISUAL_ID:
- return createConstraint_ConstrainedElementEdge(containerView, index, persisted, preferencesHint);
- case ConnectorDurationObservationEditPart.VISUAL_ID:
- return createDurationObservation_EventEdge(containerView, index, persisted, preferencesHint);
- case ConnectorTimeObservationEditPart.VISUAL_ID:
- return createTimeObservation_EventEdge(containerView, index, persisted, preferencesHint);
- }
- }
- // can never happen, provided #provides(CreateEdgeViewOperation) is correct
- return null;
- }
-
- /**
- * @generated
- */
- public Node createInteraction_Shape(EObject domainElement, View containerView, int index, boolean persisted,
- PreferencesHint preferencesHint) {
- Shape node = NotationFactory.eINSTANCE.createShape();
- node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
- node.setType(UMLVisualIDRegistry.getType(InteractionEditPart.VISUAL_ID));
- ViewUtil.insertChildView(containerView, node, index, persisted);
- node.setElement(domainElement);
- stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Interaction");
- Node interaction_NameLabel = createLabel(node, UMLVisualIDRegistry.getType(InteractionNameEditPart.VISUAL_ID));
- Node interaction_FloatingNameLabel = createLabel(node, UMLVisualIDRegistry.getType(InteractionFloatingLabelEditPart.VISUAL_ID));
- interaction_FloatingNameLabel.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location interaction_FloatingNameLabel_Location = (Location) interaction_FloatingNameLabel.getLayoutConstraint();
- interaction_FloatingNameLabel_Location.setX(50);
- interaction_FloatingNameLabel_Location.setY(0);
- createCompartment(node, UMLVisualIDRegistry.getType(InteractionCompartmentEditPart.VISUAL_ID), true, false, false, false);
- PreferenceInitializerForElementHelper.initCompartmentsStatusFromPrefs(node, prefStore, "Interaction");
- return node;
- }
-
- /**
- * @generated
- */
- public Node createLifeline_Shape(EObject domainElement, View containerView, int index, boolean persisted,
- PreferencesHint preferencesHint) {
- Shape node = NotationFactory.eINSTANCE.createShape();
- node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
- node.setType(UMLVisualIDRegistry.getType(LifelineEditPartCN.VISUAL_ID));
- ViewUtil.insertChildView(containerView, node, index, persisted);
- node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Lifeline");
- Node lifeline_NameLabel = createLabel(node, UMLVisualIDRegistry.getType(LifelineNameEditPart.VISUAL_ID));
- Node lifeline_FloatingNameLabel = createLabel(node, UMLVisualIDRegistry.getType(LifelineFloatingLabelEditPartCN.VISUAL_ID));
- lifeline_FloatingNameLabel.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location lifeline_FloatingNameLabel_Location = (Location) lifeline_FloatingNameLabel.getLayoutConstraint();
- lifeline_FloatingNameLabel_Location.setX(0);
- lifeline_FloatingNameLabel_Location.setY(15);
- return node;
- }
-
- /**
- * @generated
- */
- public Node createConstraint_Shape(EObject domainElement, View containerView, int index, boolean persisted,
- PreferencesHint preferencesHint) {
- Shape node = NotationFactory.eINSTANCE.createShape();
- node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
- node.setType(UMLVisualIDRegistry.getType(ConstraintEditPartCN.VISUAL_ID));
- ViewUtil.insertChildView(containerView, node, index, persisted);
- node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Constraint");
- Node constraint_NameLabel = createLabel(node, UMLVisualIDRegistry.getType(ConstraintNameEditPartCN.VISUAL_ID));
- Node constraint_BodyLabel = createLabel(node, UMLVisualIDRegistry.getType(ConstraintBodyEditPartCN.VISUAL_ID));
- return node;
- }
-
- /**
- * @generated
- */
- public Node createComment_Shape(EObject domainElement, View containerView, int index, boolean persisted,
- PreferencesHint preferencesHint) {
- Shape node = NotationFactory.eINSTANCE.createShape();
- node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle());
- node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
- node.setType(UMLVisualIDRegistry.getType(CommentEditPartCN.VISUAL_ID));
- ViewUtil.insertChildView(containerView, node, index, persisted);
- node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Comment");
- Node comment_BodyLabel = createLabel(node, UMLVisualIDRegistry.getType(CommentBodyEditPartCN.VISUAL_ID));
- return node;
- }
-
- /**
- * @generated
- */
- public Node createTimeObservation_Shape(EObject domainElement, View containerView, int index, boolean persisted,
- PreferencesHint preferencesHint) {
- Shape node = NotationFactory.eINSTANCE.createShape();
- node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
- node.setType(UMLVisualIDRegistry.getType(TimeObservationEditPartCN.VISUAL_ID));
- ViewUtil.insertChildView(containerView, node, index, persisted);
- node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "TimeObservation");
- Node timeObservation_NameLabel = createLabel(node, UMLVisualIDRegistry.getType(TimeObservationNameEditPartCN.VISUAL_ID));
- timeObservation_NameLabel.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location timeObservation_NameLabel_Location = (Location) timeObservation_NameLabel.getLayoutConstraint();
- timeObservation_NameLabel_Location.setX(25);
- timeObservation_NameLabel_Location.setY(3);
- Node timeObservation_StereotypeLabel = createLabel(node, UMLVisualIDRegistry.getType(TimeObservationStereotypeLabelEditPartCN.VISUAL_ID));
- timeObservation_StereotypeLabel.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location timeObservation_StereotypeLabel_Location = (Location) timeObservation_StereotypeLabel.getLayoutConstraint();
- timeObservation_StereotypeLabel_Location.setX(25);
- timeObservation_StereotypeLabel_Location.setY(-10);
- return node;
- }
-
- /**
- * @generated
- */
- public Node createDurationObservation_Shape(EObject domainElement, View containerView, int index, boolean persisted,
- PreferencesHint preferencesHint) {
- Shape node = NotationFactory.eINSTANCE.createShape();
- node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
- node.setType(UMLVisualIDRegistry.getType(DurationObservationEditPartCN.VISUAL_ID));
- ViewUtil.insertChildView(containerView, node, index, persisted);
- node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "DurationObservation");
- Node durationObservation_NameLabel = createLabel(node, UMLVisualIDRegistry.getType(DurationObservationLabelEditPartCN.VISUAL_ID));
- durationObservation_NameLabel.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location durationObservation_NameLabel_Location = (Location) durationObservation_NameLabel.getLayoutConstraint();
- durationObservation_NameLabel_Location.setX(25);
- durationObservation_NameLabel_Location.setY(3);
- Node durationObservation_StereotypeLabel = createLabel(node, UMLVisualIDRegistry.getType(DurationObservationStereotypeLabelEditPartCN.VISUAL_ID));
- durationObservation_StereotypeLabel.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location durationObservation_StereotypeLabel_Location = (Location) durationObservation_StereotypeLabel.getLayoutConstraint();
- durationObservation_StereotypeLabel_Location.setX(25);
- durationObservation_StereotypeLabel_Location.setY(-10);
- return node;
- }
-
- /**
- * @generated
- */
- public Edge createPath_Edge(EObject domainElement, View containerView, int index, boolean persisted,
- PreferencesHint preferencesHint) {
- Connector edge = NotationFactory.eINSTANCE.createConnector();
- edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
- RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
- List<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
- points.add(new RelativeBendpoint());
- points.add(new RelativeBendpoint());
- bendpoints.setPoints(points);
- edge.setBendpoints(bendpoints);
- ViewUtil.insertChildView(containerView, edge, index, persisted);
- edge.setType(UMLVisualIDRegistry.getType(MessageEditPart.VISUAL_ID));
- edge.setElement(domainElement);
- // initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "Message");
- //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 path_MessageLabel = createLabel(edge, UMLVisualIDRegistry.getType(MessageNameEditPart.VISUAL_ID));
- path_MessageLabel.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location path_MessageLabel_Location = (Location) path_MessageLabel.getLayoutConstraint();
- path_MessageLabel_Location.setX(1);
- path_MessageLabel_Location.setY(-23);
- Node path_StereotypeLabel = createLabel(edge, UMLVisualIDRegistry.getType(AppliedStereotypeMessageEditPart.VISUAL_ID));
- path_StereotypeLabel.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location path_StereotypeLabel_Location = (Location) path_StereotypeLabel.getLayoutConstraint();
- path_StereotypeLabel_Location.setX(1);
- path_StereotypeLabel_Location.setY(-53);
-
- return edge;
- }
-
- /**
- * @generated
- */
- public Edge createComment_AnnotatedElementEdge(View containerView, int index, boolean persisted,
- PreferencesHint preferencesHint) {
- Connector edge = NotationFactory.eINSTANCE.createConnector();
- edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
- RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
- List<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
- points.add(new RelativeBendpoint());
- points.add(new RelativeBendpoint());
- bendpoints.setPoints(points);
- edge.setBendpoints(bendpoints);
- ViewUtil.insertChildView(containerView, edge, index, persisted);
- edge.setType(UMLVisualIDRegistry.getType(CommentAnnotatedElementEditPart.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);
- //}
-
- return edge;
- }
-
- /**
- * @generated
- */
- public Edge createConstraint_ConstrainedElementEdge(View containerView, int index, boolean persisted,
- PreferencesHint preferencesHint) {
- Connector edge = NotationFactory.eINSTANCE.createConnector();
- edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
- RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
- List<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
- points.add(new RelativeBendpoint());
- points.add(new RelativeBendpoint());
- bendpoints.setPoints(points);
- edge.setBendpoints(bendpoints);
- ViewUtil.insertChildView(containerView, edge, index, persisted);
- edge.setType(UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.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);
- //}
-
- return edge;
- }
-
- /**
- * @generated
- */
- public Edge createDurationObservation_EventEdge(View containerView, int index, boolean persisted,
- PreferencesHint preferencesHint) {
- Connector edge = NotationFactory.eINSTANCE.createConnector();
- edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
- RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
- List<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
- points.add(new RelativeBendpoint());
- points.add(new RelativeBendpoint());
- bendpoints.setPoints(points);
- edge.setBendpoints(bendpoints);
- ViewUtil.insertChildView(containerView, edge, index, persisted);
- edge.setType(UMLVisualIDRegistry.getType(ConnectorDurationObservationEditPart.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);
- //}
-
- return edge;
- }
-
- /**
- * @generated
- */
- public Edge createTimeObservation_EventEdge(View containerView, int index, boolean persisted,
- PreferencesHint preferencesHint) {
- Connector edge = NotationFactory.eINSTANCE.createConnector();
- edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
- RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
- List<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
- points.add(new RelativeBendpoint());
- points.add(new RelativeBendpoint());
- bendpoints.setPoints(points);
- edge.setBendpoints(bendpoints);
- ViewUtil.insertChildView(containerView, edge, index, persisted);
- edge.setType(UMLVisualIDRegistry.getType(ConnectorTimeObservationEditPart.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);
- //}
-
- return edge;
- }
-
- /**
- * @generated
- */
- protected void stampShortcut(View containerView, Node target) {
- if (!ModelEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
- EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
- shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
- shortcutAnnotation.getDetails().put("modelID", ModelEditPart.MODEL_ID); //$NON-NLS-1$
- target.getEAnnotations().add(shortcutAnnotation);
- }
- }
-
- /**
- * @generated
- */
- protected Node createLabel(View owner, String hint) {
- DecorationNode rv = NotationFactory.eINSTANCE.createDecorationNode();
- rv.setType(hint);
- ViewUtil.insertChildView(owner, rv, ViewUtil.APPEND, true);
- return rv;
- }
-
- /**
- * @generated
- */
- protected 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);
- Node rv = NotationFactory.eINSTANCE.createBasicCompartment();
-
- rv.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
-
- if (hasTitle) {
- TitleStyle ts = NotationFactory.eINSTANCE.createTitleStyle();
- rv.getStyles().add(ts);
- }
- if (canSort) {
- rv.getStyles().add(NotationFactory.eINSTANCE.createSortingStyle());
- }
- if (canFilter) {
- rv.getStyles().add(NotationFactory.eINSTANCE.createFilteringStyle());
- }
- rv.setType(hint);
- ViewUtil.insertChildView(owner, rv, ViewUtil.APPEND, true);
- return rv;
- }
-
- /**
- * @generated
- */
- protected EObject getSemanticElement(IAdaptable semanticAdapter) {
- if (semanticAdapter == null) {
- return null;
- }
- EObject eObject = (EObject) semanticAdapter.getAdapter(EObject.class);
- if (eObject != null) {
- return EMFCoreUtil.resolve(TransactionUtil.getEditingDomain(eObject), eObject);
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected IElementType getSemanticElementType(IAdaptable semanticAdapter) {
- if (semanticAdapter == null) {
- return null;
- }
- return (IElementType) semanticAdapter.getAdapter(IElementType.class);
- }
-
- /**
- * @generated
- */
- private void initFontStyleFromPrefs(View view, final IPreferenceStore store, String elementName) {
- String fontConstant = 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) {
- FontData fontData = PreferenceConverter.getFontData(store, fontConstant);
- viewFontStyle.setFontName(fontData.getName());
- viewFontStyle.setFontHeight(fontData.getHeight());
- viewFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
- viewFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
-
- org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(store, fontColorConstant);
- viewFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
- }
- }
-
- /**
- * @generated
- */
- private void initForegroundFromPrefs(View view, final IPreferenceStore store, String elementName) {
- String lineColorConstant = PreferencesConstantsHelper.getElementConstant(elementName, PreferencesConstantsHelper.COLOR_LINE);
- org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(store, lineColorConstant);
- ViewUtil.setStructuralFeatureValue(view, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.RGBToInteger(lineRGB));
- }
-
- /**
- * @generated
- */
- private void initBackgroundFromPrefs(View view, final IPreferenceStore store, String elementName) {
- String fillColorConstant = 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.setGradient(gradientPreferenceConverter.getGradientData());
- fillStyle
- .setTransparency(gradientPreferenceConverter.getTransparency());
- }
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.providers; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.emf.ecore.EAnnotation; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EcoreFactory; +import org.eclipse.emf.transaction.util.TransactionUtil; +import org.eclipse.gmf.runtime.common.core.service.AbstractProvider; +import org.eclipse.gmf.runtime.common.core.service.IOperation; +import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint; +import org.eclipse.gmf.runtime.diagram.core.providers.IViewProvider; +import org.eclipse.gmf.runtime.diagram.core.services.view.CreateChildViewOperation; +import org.eclipse.gmf.runtime.diagram.core.services.view.CreateDiagramViewOperation; +import org.eclipse.gmf.runtime.diagram.core.services.view.CreateEdgeViewOperation; +import org.eclipse.gmf.runtime.diagram.core.services.view.CreateNodeViewOperation; +import org.eclipse.gmf.runtime.diagram.core.services.view.CreateViewForKindOperation; +import org.eclipse.gmf.runtime.diagram.core.services.view.CreateViewOperation; +import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; +import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities; +import org.eclipse.gmf.runtime.emf.core.util.EMFCoreUtil; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.gmf.runtime.emf.type.core.IHintedType; +import org.eclipse.gmf.runtime.notation.Connector; +import org.eclipse.gmf.runtime.notation.DecorationNode; +import org.eclipse.gmf.runtime.notation.Diagram; +import org.eclipse.gmf.runtime.notation.Edge; +import org.eclipse.gmf.runtime.notation.FillStyle; +import org.eclipse.gmf.runtime.notation.FontStyle; +import org.eclipse.gmf.runtime.notation.Location; +import org.eclipse.gmf.runtime.notation.MeasurementUnit; +import org.eclipse.gmf.runtime.notation.Node; +import org.eclipse.gmf.runtime.notation.NotationFactory; +import org.eclipse.gmf.runtime.notation.NotationPackage; +import org.eclipse.gmf.runtime.notation.RelativeBendpoints; +import org.eclipse.gmf.runtime.notation.Shape; +import org.eclipse.gmf.runtime.notation.TitleStyle; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.gmf.runtime.notation.datatype.RelativeBendpoint; +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.jface.preference.PreferenceConverter; +import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper; +import org.eclipse.papyrus.infra.gmfdiag.common.reconciler.DiagramVersioningUtils; +import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter; +import org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.AppliedStereotypeMessageEditPart; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.CommentAnnotatedElementEditPart; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.CommentBodyEditPartCN; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.CommentEditPartCN; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ConnectorDurationObservationEditPart; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ConnectorTimeObservationEditPart; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ConstraintBodyEditPartCN; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ConstraintConstrainedElementEditPart; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ConstraintEditPartCN; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ConstraintNameEditPartCN; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.DurationObservationEditPartCN; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.DurationObservationLabelEditPartCN; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.DurationObservationStereotypeLabelEditPartCN; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.InteractionCompartmentEditPart; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.InteractionEditPart; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.InteractionFloatingLabelEditPart; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.InteractionNameEditPart; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.LifelineEditPartCN; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.LifelineFloatingLabelEditPartCN; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.LifelineNameEditPart; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.MessageEditPart; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.MessageNameEditPart; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.ModelEditPart; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.TimeObservationEditPartCN; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.TimeObservationNameEditPartCN; +import org.eclipse.papyrus.uml.diagram.communication.edit.parts.TimeObservationStereotypeLabelEditPartCN; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.FontData; + +/** + * @generated + */ +public class UMLViewProvider extends AbstractProvider implements IViewProvider { + + /** + * @generated + */ + public final boolean provides(IOperation operation) { + if (operation instanceof CreateViewForKindOperation) { + return provides((CreateViewForKindOperation) operation); + } + assert operation instanceof CreateViewOperation; + + /* we check this view provider is the good one for the currently edited diagram */ + if (operation instanceof CreateChildViewOperation) { + View container = ((CreateChildViewOperation) operation).getContainerView(); + Diagram diagram = container.getDiagram(); + if (!getDiagramProvidedId().equals(diagram.getType())) { + return false; + } + } + + if (operation instanceof CreateDiagramViewOperation) { + return provides((CreateDiagramViewOperation) operation); + } else if (operation instanceof CreateEdgeViewOperation) { + return provides((CreateEdgeViewOperation) operation); + } else if (operation instanceof CreateNodeViewOperation) { + return provides((CreateNodeViewOperation) operation); + } + return false; + } + + /** + * @generated + */ + protected boolean provides(CreateViewForKindOperation op) { + /* + if (op.getViewKind() == Node.class) + return getNodeViewClass(op.getSemanticAdapter(), op.getContainerView(), op.getSemanticHint()) != null; + if (op.getViewKind() == Edge.class) + return getEdgeViewClass(op.getSemanticAdapter(), op.getContainerView(), op.getSemanticHint()) != null; + */ + + // check Diagram Type should be the class diagram + String modelID = UMLVisualIDRegistry.getModelID(op.getContainerView()); + if (!getDiagramProvidedId().equals(modelID)) { + return false; + } + + String visualID = UMLVisualIDRegistry.getVisualID(op.getSemanticHint()); + if (Node.class.isAssignableFrom(op.getViewKind())) { + return UMLVisualIDRegistry.canCreateNode(op.getContainerView(), visualID); + } + + return true; + } + + /** + * @generated + */ + protected String getDiagramProvidedId() { + /* + * Indicates for which diagram this provider works for. + * <p> + * This method can be overloaded when diagram editor inherits from another one, but should never be <code>null</code> + * </p> + * + * @return the unique identifier of the diagram for which views are provided. + */ + return ModelEditPart.MODEL_ID; + } + + /** + * @generated + */ + protected boolean provides(CreateDiagramViewOperation op) { + return ModelEditPart.MODEL_ID.equals(op.getSemanticHint()) && UMLVisualIDRegistry.getDiagramVisualID(getSemanticElement(op.getSemanticAdapter())) != null && !UMLVisualIDRegistry.getDiagramVisualID(getSemanticElement(op.getSemanticAdapter())).isEmpty(); + } + + /** + * @generated + */ + protected boolean provides(CreateNodeViewOperation op) { + if (op.getContainerView() == null) { + return false; + } + IElementType elementType = getSemanticElementType(op.getSemanticAdapter()); + EObject domainElement = getSemanticElement(op.getSemanticAdapter()); + String visualID; + if (op.getSemanticHint() == null) { + // Semantic hint is not specified. Can be a result of call from CanonicalEditPolicy. + // In this situation there should be NO elementType, visualID will be determined + // by VisualIDRegistry.getNodeVisualID() for domainElement. + if (elementType != null || domainElement == null) { + return false; + } + visualID = UMLVisualIDRegistry.getNodeVisualID(op.getContainerView(), domainElement); + } else { + visualID = UMLVisualIDRegistry.getVisualID(op.getSemanticHint()); + 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)) { + return false; // if semantic hint is specified it should be the same as in element type + } + //if (domainElement != null && !visualID.equals(org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry.getNodeVisualID(op.getContainerView(), domainElement))) { + // return false; // visual id for node EClass should match visual id from element type + //} + } else { + if (!ModelEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(op.getContainerView()))) { + return false; // foreign diagram + } + if (visualID != null) { + switch (visualID) { + case InteractionEditPart.VISUAL_ID: + case LifelineEditPartCN.VISUAL_ID: + case ConstraintEditPartCN.VISUAL_ID: + case CommentEditPartCN.VISUAL_ID: + case TimeObservationEditPartCN.VISUAL_ID: + case DurationObservationEditPartCN.VISUAL_ID: + if (domainElement == null || !visualID.equals(UMLVisualIDRegistry.getNodeVisualID(op.getContainerView(), domainElement))) { + return false; // visual id in semantic hint should match visual id for domain element + } + break; + default: + return false; + } + } + } + } + + return UMLVisualIDRegistry.canCreateNode(op.getContainerView(), visualID); + } + + /** + * @generated + */ + protected boolean provides(CreateEdgeViewOperation op) { + IElementType elementType = getSemanticElementType(op.getSemanticAdapter()); + + if (!UMLElementTypes.isKnownElementType(elementType) || (!(elementType instanceof IHintedType))) { + return false; // foreign element type + } + + String elementTypeHint = ((IHintedType) elementType).getSemanticHint(); + if (elementTypeHint == null || (op.getSemanticHint() != null && !elementTypeHint.equals(op.getSemanticHint()))) { + return false; // our hint is visual id and must be specified, and it should be the same as in element type + } + //String visualID = org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry.getVisualID(elementTypeHint); + //org.eclipse.emf.ecore.EObject domainElement = getSemanticElement(op.getSemanticAdapter()); + //if (domainElement != null && !visualID.equals(org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry.getLinkWithClassVisualID(domainElement))) { + // return false; // visual id for link EClass should match visual id from element type + //} + return true; + } + + /** + * @generated + */ + @SuppressWarnings("unchecked") + public Diagram createDiagram(IAdaptable semanticAdapter, String diagramKind, PreferencesHint preferencesHint) { + Diagram diagram = NotationFactory.eINSTANCE.createDiagram(); + DiagramVersioningUtils.stampCurrentVersion(diagram); + diagram.getStyles().add(NotationFactory.eINSTANCE.createDiagramStyle()); + diagram.setType(ModelEditPart.MODEL_ID); + diagram.setElement(getSemanticElement(semanticAdapter)); + diagram.setMeasurementUnit(MeasurementUnit.PIXEL_LITERAL); + return diagram; + } + + /** + * @generated + */ + public Node createNode(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, + boolean persisted, PreferencesHint preferencesHint) { + final EObject domainElement = getSemanticElement(semanticAdapter); + final String visualID; + if (semanticHint == null) { + visualID = UMLVisualIDRegistry.getNodeVisualID(containerView, domainElement); + } else { + visualID = UMLVisualIDRegistry.getVisualID(semanticHint); + } + if (visualID != null) { + switch (visualID) { + case InteractionEditPart.VISUAL_ID: + return createInteraction_Shape(domainElement, containerView, index, persisted, preferencesHint); + case LifelineEditPartCN.VISUAL_ID: + return createLifeline_Shape(domainElement, containerView, index, persisted, preferencesHint); + case ConstraintEditPartCN.VISUAL_ID: + return createConstraint_Shape(domainElement, containerView, index, persisted, preferencesHint); + case CommentEditPartCN.VISUAL_ID: + return createComment_Shape(domainElement, containerView, index, persisted, preferencesHint); + case TimeObservationEditPartCN.VISUAL_ID: + return createTimeObservation_Shape(domainElement, containerView, index, persisted, preferencesHint); + case DurationObservationEditPartCN.VISUAL_ID: + return createDurationObservation_Shape(domainElement, containerView, index, persisted, preferencesHint); + } + } + // can't happen, provided #provides(CreateNodeViewOperation) is correct + return null; + } + + /** + * @generated + */ + public Edge createEdge(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, + boolean persisted, PreferencesHint preferencesHint) { + IElementType elementType = getSemanticElementType(semanticAdapter); + String elementTypeHint = ((IHintedType) elementType).getSemanticHint(); + String vid = UMLVisualIDRegistry.getVisualID(elementTypeHint); + if (vid != null) { + switch (vid) { + case MessageEditPart.VISUAL_ID: + return createPath_Edge(getSemanticElement(semanticAdapter), containerView, index, persisted, preferencesHint); + case CommentAnnotatedElementEditPart.VISUAL_ID: + return createComment_AnnotatedElementEdge(containerView, index, persisted, preferencesHint); + case ConstraintConstrainedElementEditPart.VISUAL_ID: + return createConstraint_ConstrainedElementEdge(containerView, index, persisted, preferencesHint); + case ConnectorDurationObservationEditPart.VISUAL_ID: + return createDurationObservation_EventEdge(containerView, index, persisted, preferencesHint); + case ConnectorTimeObservationEditPart.VISUAL_ID: + return createTimeObservation_EventEdge(containerView, index, persisted, preferencesHint); + } + } + // can never happen, provided #provides(CreateEdgeViewOperation) is correct + return null; + } + + /** + * @generated + */ + public Node createInteraction_Shape(EObject domainElement, View containerView, int index, boolean persisted, + PreferencesHint preferencesHint) { + Shape node = NotationFactory.eINSTANCE.createShape(); + node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); + node.setType(UMLVisualIDRegistry.getType(InteractionEditPart.VISUAL_ID)); + ViewUtil.insertChildView(containerView, node, index, persisted); + node.setElement(domainElement); + stampShortcut(containerView, node); + // initializeFromPreferences + final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore(); + + PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Interaction"); + Node interaction_NameLabel = createLabel(node, UMLVisualIDRegistry.getType(InteractionNameEditPart.VISUAL_ID)); + Node interaction_FloatingNameLabel = createLabel(node, UMLVisualIDRegistry.getType(InteractionFloatingLabelEditPart.VISUAL_ID)); + interaction_FloatingNameLabel.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); + Location interaction_FloatingNameLabel_Location = (Location) interaction_FloatingNameLabel.getLayoutConstraint(); + interaction_FloatingNameLabel_Location.setX(50); + interaction_FloatingNameLabel_Location.setY(0); + createCompartment(node, UMLVisualIDRegistry.getType(InteractionCompartmentEditPart.VISUAL_ID), true, false, false, false); + PreferenceInitializerForElementHelper.initCompartmentsStatusFromPrefs(node, prefStore, "Interaction"); + return node; + } + + /** + * @generated + */ + public Node createLifeline_Shape(EObject domainElement, View containerView, int index, boolean persisted, + PreferencesHint preferencesHint) { + Shape node = NotationFactory.eINSTANCE.createShape(); + node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); + node.setType(UMLVisualIDRegistry.getType(LifelineEditPartCN.VISUAL_ID)); + ViewUtil.insertChildView(containerView, node, index, persisted); + node.setElement(domainElement); + // initializeFromPreferences + final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore(); + + PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Lifeline"); + Node lifeline_NameLabel = createLabel(node, UMLVisualIDRegistry.getType(LifelineNameEditPart.VISUAL_ID)); + Node lifeline_FloatingNameLabel = createLabel(node, UMLVisualIDRegistry.getType(LifelineFloatingLabelEditPartCN.VISUAL_ID)); + lifeline_FloatingNameLabel.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); + Location lifeline_FloatingNameLabel_Location = (Location) lifeline_FloatingNameLabel.getLayoutConstraint(); + lifeline_FloatingNameLabel_Location.setX(0); + lifeline_FloatingNameLabel_Location.setY(15); + return node; + } + + /** + * @generated + */ + public Node createConstraint_Shape(EObject domainElement, View containerView, int index, boolean persisted, + PreferencesHint preferencesHint) { + Shape node = NotationFactory.eINSTANCE.createShape(); + node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); + node.setType(UMLVisualIDRegistry.getType(ConstraintEditPartCN.VISUAL_ID)); + ViewUtil.insertChildView(containerView, node, index, persisted); + node.setElement(domainElement); + // initializeFromPreferences + final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore(); + + PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Constraint"); + Node constraint_NameLabel = createLabel(node, UMLVisualIDRegistry.getType(ConstraintNameEditPartCN.VISUAL_ID)); + Node constraint_BodyLabel = createLabel(node, UMLVisualIDRegistry.getType(ConstraintBodyEditPartCN.VISUAL_ID)); + return node; + } + + /** + * @generated + */ + public Node createComment_Shape(EObject domainElement, View containerView, int index, boolean persisted, + PreferencesHint preferencesHint) { + Shape node = NotationFactory.eINSTANCE.createShape(); + node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); + node.setType(UMLVisualIDRegistry.getType(CommentEditPartCN.VISUAL_ID)); + ViewUtil.insertChildView(containerView, node, index, persisted); + node.setElement(domainElement); + // initializeFromPreferences + final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore(); + + PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Comment"); + Node comment_BodyLabel = createLabel(node, UMLVisualIDRegistry.getType(CommentBodyEditPartCN.VISUAL_ID)); + return node; + } + + /** + * @generated + */ + public Node createTimeObservation_Shape(EObject domainElement, View containerView, int index, boolean persisted, + PreferencesHint preferencesHint) { + Shape node = NotationFactory.eINSTANCE.createShape(); + node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); + node.setType(UMLVisualIDRegistry.getType(TimeObservationEditPartCN.VISUAL_ID)); + ViewUtil.insertChildView(containerView, node, index, persisted); + node.setElement(domainElement); + // initializeFromPreferences + final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore(); + + PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "TimeObservation"); + Node timeObservation_NameLabel = createLabel(node, UMLVisualIDRegistry.getType(TimeObservationNameEditPartCN.VISUAL_ID)); + timeObservation_NameLabel.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); + Location timeObservation_NameLabel_Location = (Location) timeObservation_NameLabel.getLayoutConstraint(); + timeObservation_NameLabel_Location.setX(25); + timeObservation_NameLabel_Location.setY(3); + Node timeObservation_StereotypeLabel = createLabel(node, UMLVisualIDRegistry.getType(TimeObservationStereotypeLabelEditPartCN.VISUAL_ID)); + timeObservation_StereotypeLabel.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); + Location timeObservation_StereotypeLabel_Location = (Location) timeObservation_StereotypeLabel.getLayoutConstraint(); + timeObservation_StereotypeLabel_Location.setX(25); + timeObservation_StereotypeLabel_Location.setY(-10); + return node; + } + + /** + * @generated + */ + public Node createDurationObservation_Shape(EObject domainElement, View containerView, int index, boolean persisted, + PreferencesHint preferencesHint) { + Shape node = NotationFactory.eINSTANCE.createShape(); + node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); + node.setType(UMLVisualIDRegistry.getType(DurationObservationEditPartCN.VISUAL_ID)); + ViewUtil.insertChildView(containerView, node, index, persisted); + node.setElement(domainElement); + // initializeFromPreferences + final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore(); + + PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "DurationObservation"); + Node durationObservation_NameLabel = createLabel(node, UMLVisualIDRegistry.getType(DurationObservationLabelEditPartCN.VISUAL_ID)); + durationObservation_NameLabel.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); + Location durationObservation_NameLabel_Location = (Location) durationObservation_NameLabel.getLayoutConstraint(); + durationObservation_NameLabel_Location.setX(25); + durationObservation_NameLabel_Location.setY(3); + Node durationObservation_StereotypeLabel = createLabel(node, UMLVisualIDRegistry.getType(DurationObservationStereotypeLabelEditPartCN.VISUAL_ID)); + durationObservation_StereotypeLabel.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); + Location durationObservation_StereotypeLabel_Location = (Location) durationObservation_StereotypeLabel.getLayoutConstraint(); + durationObservation_StereotypeLabel_Location.setX(25); + durationObservation_StereotypeLabel_Location.setY(-10); + return node; + } + + /** + * @generated + */ + public Edge createPath_Edge(EObject domainElement, View containerView, int index, boolean persisted, + PreferencesHint preferencesHint) { + Connector edge = NotationFactory.eINSTANCE.createConnector(); + edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle()); + RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints(); + List<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2); + points.add(new RelativeBendpoint()); + points.add(new RelativeBendpoint()); + bendpoints.setPoints(points); + edge.setBendpoints(bendpoints); + ViewUtil.insertChildView(containerView, edge, index, persisted); + edge.setType(UMLVisualIDRegistry.getType(MessageEditPart.VISUAL_ID)); + edge.setElement(domainElement); + // initializePreferences + final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore(); + + PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "Message"); + //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 path_MessageLabel = createLabel(edge, UMLVisualIDRegistry.getType(MessageNameEditPart.VISUAL_ID)); + path_MessageLabel.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); + Location path_MessageLabel_Location = (Location) path_MessageLabel.getLayoutConstraint(); + path_MessageLabel_Location.setX(1); + path_MessageLabel_Location.setY(-23); + Node path_StereotypeLabel = createLabel(edge, UMLVisualIDRegistry.getType(AppliedStereotypeMessageEditPart.VISUAL_ID)); + path_StereotypeLabel.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); + Location path_StereotypeLabel_Location = (Location) path_StereotypeLabel.getLayoutConstraint(); + path_StereotypeLabel_Location.setX(1); + path_StereotypeLabel_Location.setY(-53); + + return edge; + } + + /** + * @generated + */ + public Edge createComment_AnnotatedElementEdge(View containerView, int index, boolean persisted, + PreferencesHint preferencesHint) { + Connector edge = NotationFactory.eINSTANCE.createConnector(); + edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle()); + RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints(); + List<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2); + points.add(new RelativeBendpoint()); + points.add(new RelativeBendpoint()); + bendpoints.setPoints(points); + edge.setBendpoints(bendpoints); + ViewUtil.insertChildView(containerView, edge, index, persisted); + edge.setType(UMLVisualIDRegistry.getType(CommentAnnotatedElementEditPart.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); + //} + + return edge; + } + + /** + * @generated + */ + public Edge createConstraint_ConstrainedElementEdge(View containerView, int index, boolean persisted, + PreferencesHint preferencesHint) { + Connector edge = NotationFactory.eINSTANCE.createConnector(); + edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle()); + RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints(); + List<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2); + points.add(new RelativeBendpoint()); + points.add(new RelativeBendpoint()); + bendpoints.setPoints(points); + edge.setBendpoints(bendpoints); + ViewUtil.insertChildView(containerView, edge, index, persisted); + edge.setType(UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.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); + //} + + return edge; + } + + /** + * @generated + */ + public Edge createDurationObservation_EventEdge(View containerView, int index, boolean persisted, + PreferencesHint preferencesHint) { + Connector edge = NotationFactory.eINSTANCE.createConnector(); + edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle()); + RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints(); + List<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2); + points.add(new RelativeBendpoint()); + points.add(new RelativeBendpoint()); + bendpoints.setPoints(points); + edge.setBendpoints(bendpoints); + ViewUtil.insertChildView(containerView, edge, index, persisted); + edge.setType(UMLVisualIDRegistry.getType(ConnectorDurationObservationEditPart.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); + //} + + return edge; + } + + /** + * @generated + */ + public Edge createTimeObservation_EventEdge(View containerView, int index, boolean persisted, + PreferencesHint preferencesHint) { + Connector edge = NotationFactory.eINSTANCE.createConnector(); + edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle()); + RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints(); + List<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2); + points.add(new RelativeBendpoint()); + points.add(new RelativeBendpoint()); + bendpoints.setPoints(points); + edge.setBendpoints(bendpoints); + ViewUtil.insertChildView(containerView, edge, index, persisted); + edge.setType(UMLVisualIDRegistry.getType(ConnectorTimeObservationEditPart.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); + //} + + return edge; + } + + /** + * @generated + */ + protected void stampShortcut(View containerView, Node target) { + if (!ModelEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) { + EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation(); + shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$ + shortcutAnnotation.getDetails().put("modelID", ModelEditPart.MODEL_ID); //$NON-NLS-1$ + target.getEAnnotations().add(shortcutAnnotation); + } + } + + /** + * @generated + */ + protected Node createLabel(View owner, String hint) { + DecorationNode rv = NotationFactory.eINSTANCE.createDecorationNode(); + rv.setType(hint); + ViewUtil.insertChildView(owner, rv, ViewUtil.APPEND, true); + return rv; + } + + /** + * @generated + */ + protected 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); + Node rv = NotationFactory.eINSTANCE.createBasicCompartment(); + + rv.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); + + if (hasTitle) { + TitleStyle ts = NotationFactory.eINSTANCE.createTitleStyle(); + rv.getStyles().add(ts); + } + if (canSort) { + rv.getStyles().add(NotationFactory.eINSTANCE.createSortingStyle()); + } + if (canFilter) { + rv.getStyles().add(NotationFactory.eINSTANCE.createFilteringStyle()); + } + rv.setType(hint); + ViewUtil.insertChildView(owner, rv, ViewUtil.APPEND, true); + return rv; + } + + /** + * @generated + */ + protected EObject getSemanticElement(IAdaptable semanticAdapter) { + if (semanticAdapter == null) { + return null; + } + EObject eObject = (EObject) semanticAdapter.getAdapter(EObject.class); + if (eObject != null) { + return EMFCoreUtil.resolve(TransactionUtil.getEditingDomain(eObject), eObject); + } + return null; + } + + /** + * @generated + */ + protected IElementType getSemanticElementType(IAdaptable semanticAdapter) { + if (semanticAdapter == null) { + return null; + } + return (IElementType) semanticAdapter.getAdapter(IElementType.class); + } + + /** + * @generated + */ + private void initFontStyleFromPrefs(View view, final IPreferenceStore store, String elementName) { + String fontConstant = 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) { + FontData fontData = PreferenceConverter.getFontData(store, fontConstant); + viewFontStyle.setFontName(fontData.getName()); + viewFontStyle.setFontHeight(fontData.getHeight()); + viewFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0); + viewFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0); + + org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(store, fontColorConstant); + viewFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue()); + } + } + + /** + * @generated + */ + private void initForegroundFromPrefs(View view, final IPreferenceStore store, String elementName) { + String lineColorConstant = PreferencesConstantsHelper.getElementConstant(elementName, PreferencesConstantsHelper.COLOR_LINE); + org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(store, lineColorConstant); + ViewUtil.setStructuralFeatureValue(view, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.RGBToInteger(lineRGB)); + } + + /** + * @generated + */ + private void initBackgroundFromPrefs(View view, final IPreferenceStore store, String elementName) { + String fillColorConstant = 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.setGradient(gradientPreferenceConverter.getGradientData()); + fillStyle + .setTransparency(gradientPreferenceConverter.getTransparency()); + } + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/providers/UMLVisualTypeProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/providers/UMLVisualTypeProvider.java index 8240149864c..f485f0ff66f 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/providers/UMLVisualTypeProvider.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/providers/UMLVisualTypeProvider.java @@ -1,65 +1,65 @@ -/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.communication.providers;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.common.service.visualtype.AbstractVisualTypeProvider;
-import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry;
-
-/**
- * @generated
- */
-public class UMLVisualTypeProvider extends AbstractVisualTypeProvider {
-
- /**
- * @generated
- */
- public UMLVisualTypeProvider() {
- super();
- }
-
- /**
- * @generated
- */
- @Override
- public IElementType getElementType(Diagram diagram, String viewType) {
- IElementType result = null;
-
- try {
- result = UMLElementTypes.getElementType(viewType);
- } catch (NumberFormatException e) {
- // Not supported by this diagram
- }
-
- return result;
- }
-
- /**
- * @generated
- */
- @Override
- public String getNodeType(View parentView, EObject element) {
- return UMLVisualIDRegistry.getNodeVisualID(parentView, element);
- }
-
- /**
- * @generated
- */
- @Override
- public String getLinkType(Diagram diagram, EObject element) {
- return UMLVisualIDRegistry.getLinkWithClassVisualID(element);
- }
-
-}
+/** + * Copyright (c) 2014 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.uml.diagram.communication.providers; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.gmf.runtime.notation.Diagram; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.papyrus.infra.gmfdiag.common.service.visualtype.AbstractVisualTypeProvider; +import org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry; + +/** + * @generated + */ +public class UMLVisualTypeProvider extends AbstractVisualTypeProvider { + + /** + * @generated + */ + public UMLVisualTypeProvider() { + super(); + } + + /** + * @generated + */ + @Override + public IElementType getElementType(Diagram diagram, String viewType) { + IElementType result = null; + + try { + result = UMLElementTypes.getElementType(viewType); + } catch (NumberFormatException e) { + // Not supported by this diagram + } + + return result; + } + + /** + * @generated + */ + @Override + public String getNodeType(View parentView, EObject element) { + return UMLVisualIDRegistry.getNodeVisualID(parentView, element); + } + + /** + * @generated + */ + @Override + public String getLinkType(Diagram diagram, EObject element) { + return UMLVisualIDRegistry.getLinkWithClassVisualID(element); + } + +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/model/stateMachineDiagram.gmfgen b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/model/stateMachineDiagram.gmfgen index b958c05d041..a934d56f5fd 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/model/stateMachineDiagram.gmfgen +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/model/stateMachineDiagram.gmfgen @@ -1597,8 +1597,6 @@ key="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.gef.EditPolicy.PRIMARY_DRAG_ROLE" editPolicyQualifiedClassName="org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.PapyrusReflowableShapeEditPolicy"/> diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src-gen/org/eclipse/papyrus/uml/diagram/statemachine/edit/parts/CommentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src-gen/org/eclipse/papyrus/uml/diagram/statemachine/edit/parts/CommentEditPart.java index 83fdcd4ee78..9536ed1fafe 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src-gen/org/eclipse/papyrus/uml/diagram/statemachine/edit/parts/CommentEditPart.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src-gen/org/eclipse/papyrus/uml/diagram/statemachine/edit/parts/CommentEditPart.java @@ -76,8 +76,6 @@ public class CommentEditPart extends NodeEditPart { installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PapyrusReflowableShapeEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src-gen/org/eclipse/papyrus/uml/diagram/statemachine/providers/UMLViewProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src-gen/org/eclipse/papyrus/uml/diagram/statemachine/providers/UMLViewProvider.java index 79e7b563728..1ed4dd939e8 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src-gen/org/eclipse/papyrus/uml/diagram/statemachine/providers/UMLViewProvider.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src-gen/org/eclipse/papyrus/uml/diagram/statemachine/providers/UMLViewProvider.java @@ -837,7 +837,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createComment_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(CommentEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/.options b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/.options index 164ab40eab5..1680aa41d18 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/.options +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/.options @@ -1,7 +1,7 @@ -# Tracing options for the org.eclipse.papyrus.uml.diagram.usecase plug-in
-
-# Common issues
-org.eclipse.papyrus.uml.diagram.usecase/debug=false
-
-# Visual IDs
-org.eclipse.papyrus.uml.diagram.usecase/debug/visualID=false
+# Tracing options for the org.eclipse.papyrus.uml.diagram.usecase plug-in + +# Common issues +org.eclipse.papyrus.uml.diagram.usecase/debug=false + +# Visual IDs +org.eclipse.papyrus.uml.diagram.usecase/debug/visualID=false diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/META-INF/MANIFEST.MF b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/META-INF/MANIFEST.MF index 46a3db54243..3a8a859cfa9 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/META-INF/MANIFEST.MF +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/META-INF/MANIFEST.MF @@ -25,19 +25,19 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: org.eclipse.gmf.runtime.diagram.ui.providers.ide;bundle-version="[1.7.0,2.0.0)", org.eclipse.gmf.runtime.diagram.ui.render;bundle-version="[1.7.0,2.0.0)", org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide;bundle-version="[1.7.0,2.0.0)", - org.eclipse.papyrus.infra.gmfdiag.preferences;bundle-version="[3.0.0,4.0.0)";visibility:=reexport, + org.eclipse.papyrus.infra.gmfdiag.preferences;visibility:=reexport;bundle-version="[3.0.0,4.0.0)", org.eclipse.papyrus.infra.widgets.toolbox;bundle-version="[2.0.0,3.0.0)", org.eclipse.papyrus.uml.profile;bundle-version="[3.0.0,4.0.0)", org.eclipse.papyrus.uml.appearance;bundle-version="[2.0.0,3.0.0)", org.eclipse.papyrus.uml.service.types;bundle-version="[3.0.0,4.0.0)", - org.eclipse.ui.navigator;bundle-version="[3.6.0,4.0.0)";visibility:=reexport, + org.eclipse.ui.navigator;visibility:=reexport;bundle-version="[3.6.0,4.0.0)", org.eclipse.ocl.ecore;bundle-version="[3.5.0,4.0.0)", org.eclipse.ui.navigator.resources;bundle-version="[3.5.0,4.0.0)", org.eclipse.papyrus.infra.gmfdiag.navigation;bundle-version="[2.0.0,3.0.0)", - org.eclipse.emf.ecore;bundle-version="[2.12.0,3.0.0)";visibility:=reexport, - org.eclipse.draw2d;bundle-version="[3.10.0,4.0.0)";visibility:=reexport, - org.eclipse.emf.ecore;bundle-version="[2.12.0,3.0.0)";visibility:=reexport, - org.eclipse.emf.ecore.edit;bundle-version="[2.9.0,3.0.0)";visibility:=reexport, + org.eclipse.emf.ecore;visibility:=reexport;bundle-version="[2.12.0,3.0.0)", + org.eclipse.draw2d;visibility:=reexport;bundle-version="[3.10.0,4.0.0)", + org.eclipse.emf.ecore;visibility:=reexport;bundle-version="[2.12.0,3.0.0)", + org.eclipse.emf.ecore.edit;visibility:=reexport;bundle-version="[2.9.0,3.0.0)", org.eclipse.papyrus.infra.gmfdiag.dnd;bundle-version="[1.2.0,2.0.0)", org.eclipse.papyrus.infra.internationalization.utils;bundle-version="[1.0.0,2.0.0)", org.eclipse.papyrus.uml.internationalization.utils;bundle-version="[1.0.0,2.0.0)", @@ -62,10 +62,10 @@ Require-Bundle: org.eclipse.gmf.runtime.diagram.ui.providers.ide;bundle-version= org.eclipse.gmf.runtime.diagram.ui.providers, org.eclipse.gmf.runtime.diagram.ui.resources.editor, org.eclipse.gmf.runtime.draw2d.ui;visibility:=reexport, - org.eclipse.uml2.uml;bundle-version="[5.3.0,6.0.0)";visibility:=reexport, - org.eclipse.uml2.uml.edit;bundle-version="[5.3.0,6.0.0)";visibility:=reexport, + org.eclipse.uml2.uml;visibility:=reexport;bundle-version="[5.3.0,6.0.0)", + org.eclipse.uml2.uml.edit;visibility:=reexport;bundle-version="[5.3.0,6.0.0)", org.eclipse.emf.validation;visibility:=reexport, - org.eclipse.papyrus.infra.gmfdiag.tooling.runtime;bundle-version="[3.0.0,4.0.0)";visibility:=reexport, + org.eclipse.papyrus.infra.gmfdiag.tooling.runtime;visibility:=reexport;bundle-version="[3.0.0,4.0.0)", org.eclipse.gef, org.eclipse.papyrus.extensionpoints.editors;bundle-version="[2.0.0,3.0.0)", org.eclipse.papyrus.infra.services.edit;bundle-version="[3.0.0,4.0.0)" diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/models/usecaseDiagram.gmfgen b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/models/usecaseDiagram.gmfgen index 9c43e4ad792..72d7ae944e2 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/models/usecaseDiagram.gmfgen +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/models/usecaseDiagram.gmfgen @@ -325,8 +325,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.HTMLCornerBentFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy"/> @@ -1020,8 +1018,6 @@ height="150"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy"/> @@ -1535,8 +1531,6 @@ height="150"/> </viewmap> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy"/> @@ -1679,8 +1673,6 @@ xsi:type="gmfgen:FigureViewmap" figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.HTMLCornerBentFigure"/> <behaviour - xsi:type="gmfgen:OpenDiagramBehaviour"/> - <behaviour xsi:type="gmfgen:CustomBehaviour" key="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY" editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy"/> @@ -3000,7 +2992,7 @@ iD="org.eclipse.papyrus.uml.diagram.usecase" name="Papyrus useCase editor Plugin" provider="Papyrus" - version="3.1.0.qualifier"> + version="4.0.0.qualifier"> <requiredPlugins>org.eclipse.draw2d</requiredPlugins> <requiredPlugins>org.eclipse.gmf.runtime.draw2d.ui</requiredPlugins> </plugin> diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src-gen/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/CommentEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src-gen/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/CommentEditPartCN.java index 45de0e186ae..e12e48f7bba 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src-gen/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/CommentEditPartCN.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src-gen/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/CommentEditPartCN.java @@ -76,8 +76,6 @@ public class CommentEditPartCN extends AbstractCommentEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PapyrusReflowableShapeEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src-gen/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/CommentEditPartTN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src-gen/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/CommentEditPartTN.java index 7327195b7df..654b06c6984 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src-gen/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/CommentEditPartTN.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src-gen/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/CommentEditPartTN.java @@ -76,8 +76,6 @@ public class CommentEditPartTN extends AbstractCommentEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PapyrusReflowableShapeEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src-gen/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/PackageEditPartCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src-gen/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/PackageEditPartCN.java index a1eaea907c0..44b73a725c0 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src-gen/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/PackageEditPartCN.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src-gen/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/PackageEditPartCN.java @@ -76,8 +76,6 @@ public class PackageEditPartCN extends PackageEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); installEditPolicy(ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY, new ShowHideCompartmentEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src-gen/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/PackageEditPartTN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src-gen/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/PackageEditPartTN.java index afffd1fecda..f8afa8ceff0 100755 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src-gen/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/PackageEditPartTN.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src-gen/org/eclipse/papyrus/uml/diagram/usecase/edit/parts/PackageEditPartTN.java @@ -76,8 +76,6 @@ public class PackageEditPartTN extends PackageEditPart { installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - installEditPolicy(EditPolicyRoles.OPEN_ROLE, - new OpenDiagramEditPolicy()); installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy()); installEditPolicy(ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY, new ShowHideCompartmentEditPolicy()); // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src-gen/org/eclipse/papyrus/uml/diagram/usecase/providers/UMLViewProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src-gen/org/eclipse/papyrus/uml/diagram/usecase/providers/UMLViewProvider.java index 1b97fa34c64..92006a067d5 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src-gen/org/eclipse/papyrus/uml/diagram/usecase/providers/UMLViewProvider.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/src-gen/org/eclipse/papyrus/uml/diagram/usecase/providers/UMLViewProvider.java @@ -595,7 +595,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createPackage_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(PackageEditPartTN.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -637,7 +636,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createComment_Shape(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(CommentEditPartTN.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -777,7 +775,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createComment_Shape_CN(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(CommentEditPartCN.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); @@ -960,7 +957,6 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { public Node createPackage_Shape_CN(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); - node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(UMLVisualIDRegistry.getType(PackageEditPartCN.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); |