Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvlorenzo2012-07-25 11:11:30 -0400
committervlorenzo2012-07-25 11:11:30 -0400
commit4b5ecde64a5083ecae5d1d8532443d9eae407f80 (patch)
treec53b57463ffeda5d773716e0ec87e21569dacc3c /plugins
parent7488310330829c036dfd84c6f5cf804cf4e0ef76 (diff)
downloadorg.eclipse.papyrus-4b5ecde64a5083ecae5d1d8532443d9eae407f80.tar.gz
org.eclipse.papyrus-4b5ecde64a5083ecae5d1d8532443d9eae407f80.tar.xz
org.eclipse.papyrus-4b5ecde64a5083ecae5d1d8532443d9eae407f80.zip
385726: [UML Compare] Add an action in the Diagram Menu to allow the comparison between to 2 UML Element
https://bugs.eclipse.org/bugs/show_bug.cgi?id=385726 Change the implementation of the AdapterFactory to avoid StackOverFlow!
Diffstat (limited to 'plugins')
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/adapter/EditPartAdapterFactory.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/adapter/EditPartAdapterFactory.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/adapter/EditPartAdapterFactory.java
index cda10c3b3e2..2a4704650ea 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/adapter/EditPartAdapterFactory.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/adapter/EditPartAdapterFactory.java
@@ -13,10 +13,9 @@
*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.common.adapter;
-import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IAdapterFactory;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.EditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
/**
*
@@ -37,6 +36,7 @@ import org.eclipse.gef.EditPart;
*/
public class EditPartAdapterFactory implements IAdapterFactory {
+
/**
*
* @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
@@ -46,8 +46,8 @@ public class EditPartAdapterFactory implements IAdapterFactory {
* @return
*/
public Object getAdapter(Object adaptableObject, Class adapterType) {
- if(adaptableObject instanceof EditPart && adaptableObject instanceof IAdaptable) {
- return ((IAdaptable)adaptableObject).getAdapter(adapterType);
+ if(adaptableObject instanceof IGraphicalEditPart) {
+ return ((IGraphicalEditPart)adaptableObject).resolveSemanticElement();
}
return null;
}

Back to the top