Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/CreateViewCommand.java')
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/CreateViewCommand.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/CreateViewCommand.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/CreateViewCommand.java
index c6a468f8cf9..38622685327 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/CreateViewCommand.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/CreateViewCommand.java
@@ -20,6 +20,7 @@ import org.eclipse.gmf.runtime.diagram.ui.commands.CreateCommand;
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
/**
* A replacement for CreateCommand that avoids that takes into account the incorrect
@@ -46,7 +47,7 @@ public class CreateViewCommand extends CreateCommand {
}
// Try to adapt the descriptor ElementAdapter in EObject
- EObject element = (EObject)viewDescriptor.getElementAdapter().getAdapter(EObject.class);
+ EObject element = EMFHelper.getEObject((EObject)viewDescriptor.getElementAdapter());
IElementType elementType = (IElementType)viewDescriptor.getElementAdapter().getAdapter(IElementType.class);
SemanticElementAdapter semanticAdapter = new SemanticElementAdapter(element, elementType);

Back to the top