diff options
Diffstat (limited to 'extraplugins/layers')
11 files changed, 52 insertions, 25 deletions
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.runtime/plugin.xml b/extraplugins/layers/org.eclipse.papyrus.layers.runtime/plugin.xml index ca048cf167d..32045824c04 100644 --- a/extraplugins/layers/org.eclipse.papyrus.layers.runtime/plugin.xml +++ b/extraplugins/layers/org.eclipse.papyrus.layers.runtime/plugin.xml @@ -22,7 +22,7 @@ serviceKeyRef="org.eclipse.papyrus.infra.core.resource.ModelSet"> </dependsOn> <dependsOn - serviceKeyRef="org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor"> + serviceKeyRef="org.eclipse.papyrus.infra.ui.editor.IMultiDiagramEditor"> </dependsOn> </service> </extension> diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel.diagram/META-INF/MANIFEST.MF b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel.diagram/META-INF/MANIFEST.MF index 5d9f0e07ce1..d694738bda1 100644 --- a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel.diagram/META-INF/MANIFEST.MF +++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel.diagram/META-INF/MANIFEST.MF @@ -13,7 +13,9 @@ Require-Bundle: org.eclipse.ui, org.eclipse.gmf.runtime.diagram.ui.resources.editor,
org.eclipse.papyrus.layers.runtime;bundle-version="1.2.0",
org.eclipse.gmf.runtime.diagram.ui;bundle-version="1.7.0",
- org.eclipse.ui.ide;bundle-version="3.10.0"
+ org.eclipse.ui.ide;bundle-version="3.10.0",
+ org.eclipse.papyrus.infra.ui;bundle-version="1.2.0",
+ org.eclipse.papyrus.infra.core.sasheditor;bundle-version="1.2.0"
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-Version: 1.2.0.qualifier
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel.diagram/plugin.xml b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel.diagram/plugin.xml index a4f04ed27ce..27d41b758c3 100644 --- a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel.diagram/plugin.xml +++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel.diagram/plugin.xml @@ -2,7 +2,7 @@ <?eclipse version="3.4"?> <plugin> <extension - point="org.eclipse.papyrus.infra.core.papyrusDiagram"> + point="org.eclipse.papyrus.infra.ui.papyrusDiagram"> <editorDiagram actionBarContributorId="org.eclipse.papyrus.uml.diagram.common.part.UMLDiagramActionBarContributor" contextId="defaultContext" diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel.diagram/src/org/eclipse/papyrus/layers/stackmodel/diagram/LayersTreeDiagramEditorFactory.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel.diagram/src/org/eclipse/papyrus/layers/stackmodel/diagram/LayersTreeDiagramEditorFactory.java index b5dbd4e2f73..6e9bf121f1d 100644 --- a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel.diagram/src/org/eclipse/papyrus/layers/stackmodel/diagram/LayersTreeDiagramEditorFactory.java +++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel.diagram/src/org/eclipse/papyrus/layers/stackmodel/diagram/LayersTreeDiagramEditorFactory.java @@ -15,13 +15,13 @@ package org.eclipse.papyrus.layers.stackmodel.diagram; import org.eclipse.gmf.runtime.notation.Diagram; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.papyrus.infra.core.editor.BackboneException; -import org.eclipse.papyrus.infra.core.extension.diagrameditor.EditorDescriptor; -import org.eclipse.papyrus.infra.core.extension.diagrameditor.IPluggableEditorFactory; -import org.eclipse.papyrus.infra.core.multidiagram.actionbarcontributor.ActionBarContributorRegistry; import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IEditorModel; import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; import org.eclipse.papyrus.infra.core.services.ServiceException; import org.eclipse.papyrus.infra.core.services.ServicesRegistry; +import org.eclipse.papyrus.infra.ui.extension.diagrameditor.EditorDescriptor; +import org.eclipse.papyrus.infra.ui.extension.diagrameditor.IPluggableEditorFactory; +import org.eclipse.papyrus.infra.ui.multidiagram.actionbarcontributor.ActionBarContributorRegistry; import org.eclipse.swt.graphics.Image; import org.eclipse.ui.IEditorPart; import org.eclipse.ui.PartInitException; @@ -71,7 +71,7 @@ public class LayersTreeDiagramEditorFactory implements IPluggableEditorFactory { /** * TODO Implements next methods * - * @see org.eclipse.papyrus.infra.core.extension.diagrameditor.IPluggableEditorFactory#createIPageModel(java.lang.Object) + * @see org.eclipse.papyrus.infra.ui.extension.diagrameditor.IPluggableEditorFactory#createIPageModel(java.lang.Object) * @param pageIdentifier * @return * @@ -83,7 +83,7 @@ public class LayersTreeDiagramEditorFactory implements IPluggableEditorFactory { /** * - * @see org.eclipse.papyrus.infra.core.extension.diagrameditor.IPluggableEditorFactory#isPageModelFactoryFor(java.lang.Object) + * @see org.eclipse.papyrus.infra.ui.extension.diagrameditor.IPluggableEditorFactory#isPageModelFactoryFor(java.lang.Object) * @param pageIdentifier * @return * diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel.diagram/src/org/eclipse/papyrus/layers/stackmodel/diagram/ui/handlers/AbstractLayerCommand.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel.diagram/src/org/eclipse/papyrus/layers/stackmodel/diagram/ui/handlers/AbstractLayerCommand.java index 99044e3a409..1a9b80dc549 100644 --- a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel.diagram/src/org/eclipse/papyrus/layers/stackmodel/diagram/ui/handlers/AbstractLayerCommand.java +++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel.diagram/src/org/eclipse/papyrus/layers/stackmodel/diagram/ui/handlers/AbstractLayerCommand.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.layers.stackmodel.diagram.ui.handlers; @@ -21,6 +24,7 @@ import org.eclipse.emf.transaction.RecordingCommand; import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor; import org.eclipse.gmf.runtime.notation.Diagram; +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; @@ -220,7 +224,7 @@ public abstract class AbstractLayerCommand 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"); diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.ui/META-INF/MANIFEST.MF b/extraplugins/layers/org.eclipse.papyrus.layers.ui/META-INF/MANIFEST.MF index b8865fb8b5d..d2c4761141a 100644 --- a/extraplugins/layers/org.eclipse.papyrus.layers.ui/META-INF/MANIFEST.MF +++ b/extraplugins/layers/org.eclipse.papyrus.layers.ui/META-INF/MANIFEST.MF @@ -31,7 +31,8 @@ Require-Bundle: org.eclipse.ui, org.eclipse.papyrus.infra.services.labelprovider;bundle-version="1.2.0",
org.eclipse.papyrus.infra.gmfdiag.hyperlink;bundle-version="1.2.0",
org.eclipse.papyrus.infra.core.log;bundle-version="1.2.0",
- org.eclipse.papyrus.layers.stackmodel.edit;bundle-version="1.2.0"
+ org.eclipse.papyrus.layers.stackmodel.edit;bundle-version="1.2.0",
+ org.eclipse.papyrus.infra.ui;bundle-version="1.2.0"
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-Version: 1.2.0.qualifier
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/AbstractLayerStackCommand.java b/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/AbstractLayerStackCommand.java index 53d7d29ae5d..0abe0660f4a 100644 --- a/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/AbstractLayerStackCommand.java +++ b/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/commands/AbstractLayerStackCommand.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; @@ -21,6 +24,7 @@ import org.eclipse.emf.transaction.RecordingCommand; import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor; import org.eclipse.gmf.runtime.notation.Diagram; +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; @@ -222,7 +226,7 @@ public abstract class AbstractLayerStackCommand 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"); 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$ diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/handlers/AttachDiagramSelectedItemsToCurrentLayer.java b/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/handlers/AttachDiagramSelectedItemsToCurrentLayer.java index e261438ce65..85ef692b7a3 100644 --- a/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/handlers/AttachDiagramSelectedItemsToCurrentLayer.java +++ b/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/handlers/AttachDiagramSelectedItemsToCurrentLayer.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 + * ******************************************************************************/ /** * @@ -27,6 +30,7 @@ import org.eclipse.gmf.runtime.notation.View; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.ITreeSelection; +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.stackmodel.NotFoundException; @@ -141,7 +145,7 @@ public class AttachDiagramSelectedItemsToCurrentLayer extends AbstractLayersComm // } for (Object obj : structuredSelection.toList()) { // Adapt the selected object to a View. - View view = (View) Platform.getAdapterManager().getAdapter(obj, View.class); + View view = Platform.getAdapterManager().getAdapter(obj, View.class); if (view != null) { result.add(view); } @@ -162,7 +166,7 @@ public class AttachDiagramSelectedItemsToCurrentLayer extends AbstractLayersComm IEditorPart editor; try { - editor = ServiceUtilsForIEvaluationContext.getInstance().getNestedActiveIEditorPart(context); + editor = ServiceUtilsForIEvaluationContext.getInstance().getService(ISashWindowsContainer.class, context).getActiveEditor(); } catch (ServiceException e) { throw new NotFoundException("Selected editor do not provides ServiceRegistry", e); //$NON-NLS-1$ } diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/handlers/RemoveDiagramSelectedItemsFromCurrentLayer.java b/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/handlers/RemoveDiagramSelectedItemsFromCurrentLayer.java index 7d6d2763e3d..decec23faec 100644 --- a/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/handlers/RemoveDiagramSelectedItemsFromCurrentLayer.java +++ b/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/handlers/RemoveDiagramSelectedItemsFromCurrentLayer.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 + * ******************************************************************************/ /** * @@ -27,6 +30,7 @@ import org.eclipse.gmf.runtime.notation.View; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.ITreeSelection; +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.stackmodel.NotFoundException; @@ -144,7 +148,7 @@ public class RemoveDiagramSelectedItemsFromCurrentLayer extends AbstractLayersCo // } for (Object obj : structuredSelection.toList()) { // Adapt the selected object to a View. - View view = (View) Platform.getAdapterManager().getAdapter(obj, View.class); + View view = Platform.getAdapterManager().getAdapter(obj, View.class); if (view != null) { result.add(view); } @@ -165,7 +169,7 @@ public class RemoveDiagramSelectedItemsFromCurrentLayer extends AbstractLayersCo IEditorPart editor; try { - editor = ServiceUtilsForIEvaluationContext.getInstance().getNestedActiveIEditorPart(context); + editor = ServiceUtilsForIEvaluationContext.getInstance().getService(ISashWindowsContainer.class, context).getActiveEditor(); } catch (ServiceException e) { throw new NotFoundException("Selected editor do not provides ServiceRegistry", e); //$NON-NLS-1$ } diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/utils/HandlersUtils.java b/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/utils/HandlersUtils.java index c135d2cedaa..12d9f01daee 100644 --- a/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/utils/HandlersUtils.java +++ b/extraplugins/layers/org.eclipse.papyrus.layers.ui/src/org/eclipse/papyrus/layers3/ui/utils/HandlersUtils.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,14 +8,17 @@ * * Contributors: * Cedric Dumoulin - cedric.dumoulin@lifl.fr + * Christian W. Damus - bug 485220 + * ******************************************************************************/ package org.eclipse.papyrus.layers3.ui.utils; import org.eclipse.core.commands.AbstractHandler; import org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor; import org.eclipse.gmf.runtime.notation.Diagram; +import org.eclipse.papyrus.infra.core.sasheditor.editor.ISashWindowsContainer; import org.eclipse.papyrus.infra.core.services.ServiceException; -import org.eclipse.papyrus.infra.core.utils.ServiceUtilsForWorkbenchPage; +import org.eclipse.papyrus.infra.ui.util.ServiceUtilsForWorkbenchPage; import org.eclipse.papyrus.layers.stackmodel.NotFoundException; import org.eclipse.ui.IEditorPart; import org.eclipse.ui.IWorkbenchPage; @@ -53,7 +57,7 @@ public class HandlersUtils { throw new NotFoundException("No active IWorkbenchPage"); } - IEditorPart editor = ServiceUtilsForWorkbenchPage.getInstance().getNestedActiveIEditorPart(page); + IEditorPart editor = ServiceUtilsForWorkbenchPage.getInstance().getService(ISashWindowsContainer.class, page).getActiveEditor(); if (!(editor instanceof DiagramDocumentEditor)) { throw new NotFoundException("Selected editor do not contains Diagram"); |