Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/command/ConnectorCreateCommand.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/policies/itemsemantic/PropertyPartItemSemanticEditPolicyCN.java6
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/src/org/eclipse/papyrus/uml/diagram/component/edit/policies/PropertyItemSemanticEditPolicy.java24
3 files changed, 29 insertions, 4 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/command/ConnectorCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/command/ConnectorCreateCommand.java
index 8b6d7dcc79c..425c09c1436 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/command/ConnectorCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/command/ConnectorCreateCommand.java
@@ -141,6 +141,7 @@ public class ConnectorCreateCommand extends org.eclipse.papyrus.uml.diagram.comp
if((target != null) && (getContainer() == null)) {
return false;
}
+
// return
// UMLBaseItemSemanticEditPolicy.LinkConstraints.canCreateConnector_4013(getContainer(),
// _getSource(),
@@ -243,7 +244,7 @@ public class ConnectorCreateCommand extends org.eclipse.papyrus.uml.diagram.comp
StructuredClassifier containerProposedBySource = proposedContainer(sourceGraphicalEditPart);
StructuredClassifier containerProposedByTarget = proposedContainer(targetGraphicalEditPart);
-
+
StructuredClassifier deducedContainer = null;
if((containerProposedBySource != null) && (containerProposedByTarget != null)) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/policies/itemsemantic/PropertyPartItemSemanticEditPolicyCN.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/policies/itemsemantic/PropertyPartItemSemanticEditPolicyCN.java
index 94dac2414e0..a911fec83c6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/policies/itemsemantic/PropertyPartItemSemanticEditPolicyCN.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/custom-src/org/eclipse/papyrus/uml/diagram/component/custom/edit/policies/itemsemantic/PropertyPartItemSemanticEditPolicyCN.java
@@ -25,7 +25,7 @@ import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipReques
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
-import org.eclipse.papyrus.uml.diagram.component.edit.commands.ConnectorCreateCommand;
+import org.eclipse.papyrus.uml.diagram.component.custom.edit.command.ConnectorCreateCommand;
import org.eclipse.papyrus.uml.diagram.component.edit.parts.ConnectorEditPart;
import org.eclipse.papyrus.uml.diagram.component.providers.UMLElementTypes;
import org.eclipse.papyrus.uml.service.types.utils.RequestParameterConstants;
@@ -87,6 +87,8 @@ public class PropertyPartItemSemanticEditPolicyCN extends org.eclipse.papyrus.um
@Override
protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
if(UMLElementTypes.Connector_4019 == req.getElementType()) {
+ req.setParameter(org.eclipse.papyrus.uml.diagram.component.custom.edit.policies.GraphicalNodeEditPolicy.CONNECTOR_CREATE_REQUEST_SOURCE_GRAPHICAL, getHost());
+
return getGEFWrapper(new ConnectorCreateCommand(req, req.getSource(), req.getTarget()));
}
return super.getStartCreateRelationshipCommand(req);
@@ -103,6 +105,8 @@ public class PropertyPartItemSemanticEditPolicyCN extends org.eclipse.papyrus.um
@Override
protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
if(UMLElementTypes.Connector_4019 == req.getElementType()) {
+ req.setParameter(org.eclipse.papyrus.uml.diagram.component.custom.edit.policies.GraphicalNodeEditPolicy.CONNECTOR_CREATE_REQUEST_TARGET_GRAPHICAL, getHost());
+
return getGEFWrapper(new ConnectorCreateCommand(req, req.getSource(), req.getTarget()));
}
return super.getCompleteCreateRelationshipCommand(req);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/src/org/eclipse/papyrus/uml/diagram/component/edit/policies/PropertyItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/src/org/eclipse/papyrus/uml/diagram/component/edit/policies/PropertyItemSemanticEditPolicy.java
index 172f026e434..904d15e34f1 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/src/org/eclipse/papyrus/uml/diagram/component/edit/policies/PropertyItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/src/org/eclipse/papyrus/uml/diagram/component/edit/policies/PropertyItemSemanticEditPolicy.java
@@ -67,6 +67,7 @@ import org.eclipse.papyrus.uml.diagram.component.edit.parts.SubstitutionEditPart
import org.eclipse.papyrus.uml.diagram.component.edit.parts.UsageEditPart;
import org.eclipse.papyrus.uml.diagram.component.part.UMLVisualIDRegistry;
import org.eclipse.papyrus.uml.diagram.component.providers.UMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.utils.RequestParameterConstants;
/**
* @generated
@@ -360,7 +361,25 @@ public class PropertyItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
* @generated
*/
protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
+ IElementEditService provider = ElementEditServiceUtils.getCommandProvider(req.getRelationship());
+ ICommand reorientCommand =null;
switch(getVisualID(req)) {
+ case org.eclipse.papyrus.uml.diagram.component.edit.parts.ConnectorEditPart.VISUAL_ID:
+ if(provider == null) {
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ // Add graphical new end View in request parameters
+ View targetView = (View)getHost().getModel();
+ req.setParameter(RequestParameterConstants.EDGE_REORIENT_REQUEST_END_VIEW, targetView);
+
+ // Retrieve re-orient command from the Element Edit service
+ reorientCommand = provider.getEditCommand(req);
+ if(reorientCommand == null) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ return getGEFWrapper(reorientCommand.reduce());
+
case UsageEditPart.VISUAL_ID:
case InterfaceRealizationEditPart.VISUAL_ID:
case SubstitutionEditPart.VISUAL_ID:
@@ -369,12 +388,12 @@ public class PropertyItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
case AbstractionEditPart.VISUAL_ID:
case DependencyEditPart.VISUAL_ID:
case DependencyBranchEditPart.VISUAL_ID:
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(req.getRelationship());
+
if(provider == null) {
return UnexecutableCommand.INSTANCE;
}
// Retrieve re-orient command from the Element Edit service
- ICommand reorientCommand = provider.getEditCommand(req);
+ reorientCommand = provider.getEditCommand(req);
if(reorientCommand == null) {
return UnexecutableCommand.INSTANCE;
}
@@ -398,4 +417,5 @@ public class PropertyItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolic
}
return super.getReorientReferenceRelationshipCommand(req);
}
+
}

Back to the top