Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoradaussy2012-03-20 14:16:28 +0000
committeradaussy2012-03-20 14:16:28 +0000
commit16223ff09528eb55ce35bc2ed34d007e781f0fd6 (patch)
tree0cc7090cef8ef95173833487bcb5326a732e019f
parent3b46d5da46cb107a895e859a496d9f2fca93c287 (diff)
downloadorg.eclipse.papyrus-16223ff09528eb55ce35bc2ed34d007e781f0fd6.tar.gz
org.eclipse.papyrus-16223ff09528eb55ce35bc2ed34d007e781f0fd6.tar.xz
org.eclipse.papyrus-16223ff09528eb55ce35bc2ed34d007e781f0fd6.zip
NEW - bug 374607: [model explorer] moving a model element in another model does not move associated diagrams
https://bugs.eclipse.org/bugs/show_bug.cgi?id=374607 374608: [model explorer] moving a model element in another model does not move associated stereotypes https://bugs.eclipse.org/bugs/show_bug.cgi?id=374608 Diagram has been regenerated
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/CommentBodyLabelEditPart.java24
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/SysmlBaseItemSemanticEditPolicy.java15
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlNavigatorContentProvider.java18
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlNavigatorLabelProvider.java24
4 files changed, 47 insertions, 34 deletions
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/CommentBodyLabelEditPart.java b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/CommentBodyLabelEditPart.java
index f3de8538ba1..4ed9975935c 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/CommentBodyLabelEditPart.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/CommentBodyLabelEditPart.java
@@ -128,8 +128,8 @@ public class CommentBodyLabelEditPart extends CompartmentEditPart implements ITe
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) {
- return ((org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel)figure).getText();
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getText();
} else if(figure instanceof ILabelFigure) {
return ((ILabelFigure)figure).getText();
} else {
@@ -141,8 +141,8 @@ public class CommentBodyLabelEditPart extends CompartmentEditPart implements ITe
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) {
- ((org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel)figure).setText(text);
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setText(text);
} else if(figure instanceof ILabelFigure) {
((ILabelFigure)figure).setText(text);
} else {
@@ -154,8 +154,8 @@ public class CommentBodyLabelEditPart extends CompartmentEditPart implements ITe
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) {
- return ((org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel)figure).getIcon();
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getIcon();
} else if(figure instanceof ILabelFigure) {
return ((ILabelFigure)figure).getIcon();
} else {
@@ -167,8 +167,8 @@ public class CommentBodyLabelEditPart extends CompartmentEditPart implements ITe
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) {
- ((org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel)figure).setIcon(icon);
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setIcon(icon);
} else if(figure instanceof ILabelFigure) {
((ILabelFigure)figure).setIcon(icon);
} else {
@@ -469,8 +469,8 @@ public class CommentBodyLabelEditPart extends CompartmentEditPart implements ITe
*/
protected void refreshUnderline() {
FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) {
- ((org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
}
if(resolveSemanticElement() instanceof Feature) {
if(((Feature)resolveSemanticElement()).isStatic()) {
@@ -486,8 +486,8 @@ public class CommentBodyLabelEditPart extends CompartmentEditPart implements ITe
*/
protected void refreshStrikeThrough() {
FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel) {
- ((org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
}
}
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/SysmlBaseItemSemanticEditPolicy.java b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/SysmlBaseItemSemanticEditPolicy.java
index 64470d152af..f8280f9bb1c 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/SysmlBaseItemSemanticEditPolicy.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/SysmlBaseItemSemanticEditPolicy.java
@@ -15,6 +15,7 @@ package org.eclipse.papyrus.sysml.diagram.parametric.edit.policies;
import java.util.Iterator;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.gef.Request;
import org.eclipse.gef.commands.Command;
@@ -275,7 +276,19 @@ public class SysmlBaseItemSemanticEditPolicy extends SemanticEditPolicy {
* @generated
*/
protected Command getMoveCommand(MoveRequest req) {
- return getGEFWrapper(new MoveElementsCommand(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));
+ }
}
/**
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlNavigatorContentProvider.java b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlNavigatorContentProvider.java
index 47d8cc44be8..091a6ef4456 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlNavigatorContentProvider.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlNavigatorContentProvider.java
@@ -324,31 +324,31 @@ public class SysmlNavigatorContentProvider implements ICommonContentProvider {
*/
private Object[] getViewChildren(View view, Object parentElement) {
switch(SysmlVisualIDRegistry.getVisualID(view)) {
- case ParametricEditPart.VISUAL_ID:
- {
- //modification of the template to avoid mistake of 65kb.
- return getViewChildrenForParametricEditPart(view, parentElement);
- }
- case ConstraintPropertyEditPart.VISUAL_ID:
+ case ConnectorEditPart.VISUAL_ID:
{
//modification of the template to avoid mistake of 65kb.
- return getViewChildrenForConstraintPropertyEditPart(view, parentElement);
+ return getViewChildrenForConnectorEditPart(view, parentElement);
}
case Property2EditPart.VISUAL_ID:
{
//modification of the template to avoid mistake of 65kb.
return getViewChildrenForProperty2EditPart(view, parentElement);
}
- case ConnectorEditPart.VISUAL_ID:
+ case ParametricEditPart.VISUAL_ID:
{
//modification of the template to avoid mistake of 65kb.
- return getViewChildrenForConnectorEditPart(view, parentElement);
+ return getViewChildrenForParametricEditPart(view, parentElement);
}
case PropertyEditPart.VISUAL_ID:
{
//modification of the template to avoid mistake of 65kb.
return getViewChildrenForPropertyEditPart(view, parentElement);
}
+ case ConstraintPropertyEditPart.VISUAL_ID:
+ {
+ //modification of the template to avoid mistake of 65kb.
+ return getViewChildrenForConstraintPropertyEditPart(view, parentElement);
+ }
}
return EMPTY_ARRAY;
}
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlNavigatorLabelProvider.java b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlNavigatorLabelProvider.java
index e0f787fb8f6..d6097bcc4b4 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlNavigatorLabelProvider.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlNavigatorLabelProvider.java
@@ -90,16 +90,16 @@ public class SysmlNavigatorLabelProvider extends LabelProvider implements ICommo
*/
public Image getImage(View view) {
switch(SysmlVisualIDRegistry.getVisualID(view)) {
- case ParametricEditPart.VISUAL_ID:
- return getImage("Navigator?Diagram?http://www.eclipse.org/papyurs/0.7.0/Resource?Resource", SysmlElementTypes.Resource_1000); //$NON-NLS-1$
- case ConstraintPropertyEditPart.VISUAL_ID:
- return getImage("Navigator?TopLevelNode?http://www.eclipse.org/papyrus/0.7.0/SysML/Constraints?ConstraintProperty", SysmlElementTypes.ConstraintProperty_2003); //$NON-NLS-1$
- case Property2EditPart.VISUAL_ID:
- return getImage("Navigator?Node?http://www.eclipse.org/uml2/3.0.0/UML?Property", SysmlElementTypes.Property_3002); //$NON-NLS-1$
case ConnectorEditPart.VISUAL_ID:
return getImage("Navigator?Link?http://www.eclipse.org/uml2/3.0.0/UML?Connector", SysmlElementTypes.Connector_4001); //$NON-NLS-1$
+ case Property2EditPart.VISUAL_ID:
+ return getImage("Navigator?Node?http://www.eclipse.org/uml2/3.0.0/UML?Property", SysmlElementTypes.Property_3002); //$NON-NLS-1$
+ case ParametricEditPart.VISUAL_ID:
+ return getImage("Navigator?Diagram?http://www.eclipse.org/papyurs/0.7.0/Resource?Resource", SysmlElementTypes.Resource_1000); //$NON-NLS-1$
case PropertyEditPart.VISUAL_ID:
return getImage("Navigator?TopLevelNode?http://www.eclipse.org/uml2/3.0.0/UML?Property", SysmlElementTypes.Property_2005); //$NON-NLS-1$
+ case ConstraintPropertyEditPart.VISUAL_ID:
+ return getImage("Navigator?TopLevelNode?http://www.eclipse.org/papyrus/0.7.0/SysML/Constraints?ConstraintProperty", SysmlElementTypes.ConstraintProperty_2003); //$NON-NLS-1$
}
return getImage("Navigator?UnknownElement", null); //$NON-NLS-1$
}
@@ -147,16 +147,16 @@ public class SysmlNavigatorLabelProvider extends LabelProvider implements ICommo
return getUnresolvedDomainElementProxyText(view);
}
switch(SysmlVisualIDRegistry.getVisualID(view)) {
- case ParametricEditPart.VISUAL_ID:
- return getResource_1000Text(view);
- case ConstraintPropertyEditPart.VISUAL_ID:
- return getConstraintProperty_2003Text(view);
- case Property2EditPart.VISUAL_ID:
- return getProperty_3002Text(view);
case ConnectorEditPart.VISUAL_ID:
return getConnector_4001Text(view);
+ case Property2EditPart.VISUAL_ID:
+ return getProperty_3002Text(view);
+ case ParametricEditPart.VISUAL_ID:
+ return getResource_1000Text(view);
case PropertyEditPart.VISUAL_ID:
return getProperty_2005Text(view);
+ case ConstraintPropertyEditPart.VISUAL_ID:
+ return getConstraintProperty_2003Text(view);
}
return getUnknownElementText(view);
}

Back to the top