diff options
author | adaussy | 2011-10-11 14:22:44 +0000 |
---|---|---|
committer | adaussy | 2011-10-11 14:22:44 +0000 |
commit | 66eb5a4c847ce515bea152a47fd44393e90ab7df (patch) | |
tree | 7495ab4fc12fa29ba8d28122b45c6f2957083790 | |
parent | 33dd0ad19600d6e41506a32bf892674258303747 (diff) | |
download | org.eclipse.papyrus-66eb5a4c847ce515bea152a47fd44393e90ab7df.tar.gz org.eclipse.papyrus-66eb5a4c847ce515bea152a47fd44393e90ab7df.tar.xz org.eclipse.papyrus-66eb5a4c847ce515bea152a47fd44393e90ab7df.zip |
NEW - bug 271059: [Class diagram] Drag and drop of class does not show attributes
https://bugs.eclipse.org/bugs/show_bug.cgi?id=271059
-> Backport from 0.8.X
-rw-r--r-- | plugins/uml/org.eclipse.papyrus.diagram.common/src/org/eclipse/papyrus/diagram/common/commands/CommonDeferredCreateConnectionViewCommand.java | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/plugins/uml/org.eclipse.papyrus.diagram.common/src/org/eclipse/papyrus/diagram/common/commands/CommonDeferredCreateConnectionViewCommand.java b/plugins/uml/org.eclipse.papyrus.diagram.common/src/org/eclipse/papyrus/diagram/common/commands/CommonDeferredCreateConnectionViewCommand.java index bc4bab72c25..e5ef6798a5c 100644 --- a/plugins/uml/org.eclipse.papyrus.diagram.common/src/org/eclipse/papyrus/diagram/common/commands/CommonDeferredCreateConnectionViewCommand.java +++ b/plugins/uml/org.eclipse.papyrus.diagram.common/src/org/eclipse/papyrus/diagram/common/commands/CommonDeferredCreateConnectionViewCommand.java @@ -109,9 +109,26 @@ public class CommonDeferredCreateConnectionViewCommand extends DeferredCreateCon @Override
protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
Map<?, ?> epRegistry = viewer.getEditPartRegistry();
- IGraphicalEditPart sourceEP = (IGraphicalEditPart)epRegistry.get(sourceViewAdapter.getAdapter(View.class));
- IGraphicalEditPart targetEP = (IGraphicalEditPart)epRegistry.get(targetViewAdapter.getAdapter(View.class));
+
+ /**
+ * Refresh the registry
+ */
+ View sourceView = (View)sourceViewAdapter.getAdapter(View.class);
+ EObject sourceContainer = sourceView.eContainer();
+ IGraphicalEditPart sourceContainerEP = (IGraphicalEditPart)epRegistry.get(sourceContainer);
+ View targetView = (View)targetViewAdapter.getAdapter(View.class);
+ EObject targetContainer = targetView.eContainer();
+ IGraphicalEditPart targetContainerEP = (IGraphicalEditPart)epRegistry.get(targetContainer);
+
+ if (sourceContainerEP != null) {
+ sourceContainerEP.refresh();
+ }
+ if (targetContainerEP != null && !targetContainerEP.equals(sourceContainerEP)) {
+ targetContainerEP.refresh();
+ }
+ IGraphicalEditPart sourceEP = (IGraphicalEditPart)epRegistry.get(sourceView);
+ IGraphicalEditPart targetEP = (IGraphicalEditPart)epRegistry.get(targetView);
/*
* when the source or the target of a link is an other link, the
* previous method returns something like ElementNameEditPart A such
|