diff options
Diffstat (limited to 'extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/AbstractLayersCommand.java')
-rw-r--r-- | extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/AbstractLayersCommand.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/AbstractLayersCommand.java b/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/AbstractLayersCommand.java index ee1cb7d9ae4..967aa5e65a5 100644 --- a/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/AbstractLayersCommand.java +++ b/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/AbstractLayersCommand.java @@ -1,5 +1,6 @@ /******************************************************************************* - * Copyright (c) 2013 CEA LIST. + * Copyright (c) 2013, 2016 CEA LIST, Christian W. Damus, and others. + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -7,6 +8,8 @@ * * Contributors: * Cedric Dumoulin - cedric.dumoulin@lifl.fr + * Christian W. Damus - bug 485220 + * ******************************************************************************/ package org.eclipse.papyrus.layers3.ui.commands; @@ -26,6 +29,7 @@ import org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocument import org.eclipse.gmf.runtime.notation.Diagram; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.papyrus.infra.core.resource.ModelSet; +import org.eclipse.papyrus.infra.core.sasheditor.editor.ISashWindowsContainer; import org.eclipse.papyrus.infra.core.services.ServiceException; import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForIEvaluationContext; import org.eclipse.papyrus.layers.runtime.NotationDiagramHelper; @@ -277,7 +281,7 @@ public abstract class AbstractLayersCommand extends AbstractHandler { // Get page from the event ! // IWorkbenchPage page = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage(); - IEditorPart editor = ServiceUtilsForIEvaluationContext.getInstance().getNestedActiveIEditorPart(context); + IEditorPart editor = ServiceUtilsForIEvaluationContext.getInstance().getService(ISashWindowsContainer.class, context).getActiveEditor(); if (!(editor instanceof DiagramDocumentEditor)) { throw new NotFoundException("Selected editor do not contains Diagram"); @@ -333,7 +337,7 @@ public abstract class AbstractLayersCommand extends AbstractHandler { */ protected Diagram lookupNotationDiagramChecked(IEvaluationContext context) throws NotFoundException, ServiceException { - IEditorPart editor = ServiceUtilsForIEvaluationContext.getInstance().getNestedActiveIEditorPart(context); + IEditorPart editor = ServiceUtilsForIEvaluationContext.getInstance().getService(ISashWindowsContainer.class, context).getActiveEditor(); if (!(editor instanceof DiagramDocumentEditor)) { throw new NotFoundException("Selected editor do not contains Diagram"); //$NON-NLS-1$ |