From 6253d6e2d97971b685422bd5ad59322a915714f1 Mon Sep 17 00:00:00 2001 From: Laurent Wouters Date: Fri, 4 Apr 2014 16:12:17 +0200 Subject: [clean] Retiring org.eclipse.papyrus.qvtTransformation Signed-off-by: Laurent Wouters --- .../.classpath | 7 - .../org.eclipse.papyrus.qvtTransformation/.project | 28 ---- .../.settings/org.eclipse.jdt.core.prefs | 8 - .../META-INF/MANIFEST.MF | 17 -- .../build.properties | 6 - .../icons/icon.gif | Bin 279 -> 0 bytes .../plugin.xml | 29 ---- .../papyrus/qvttransformation/Activator.java | 77 --------- .../popup/actions/SelectQVTTransformation.java | 176 --------------------- 9 files changed, 348 deletions(-) delete mode 100644 deprecated/org.eclipse.papyrus.qvtTransformation/.classpath delete mode 100644 deprecated/org.eclipse.papyrus.qvtTransformation/.project delete mode 100644 deprecated/org.eclipse.papyrus.qvtTransformation/.settings/org.eclipse.jdt.core.prefs delete mode 100644 deprecated/org.eclipse.papyrus.qvtTransformation/META-INF/MANIFEST.MF delete mode 100644 deprecated/org.eclipse.papyrus.qvtTransformation/build.properties delete mode 100644 deprecated/org.eclipse.papyrus.qvtTransformation/icons/icon.gif delete mode 100644 deprecated/org.eclipse.papyrus.qvtTransformation/plugin.xml delete mode 100644 deprecated/org.eclipse.papyrus.qvtTransformation/src/org/eclipse/papyrus/qvttransformation/Activator.java delete mode 100644 deprecated/org.eclipse.papyrus.qvtTransformation/src/org/eclipse/papyrus/qvttransformation/popup/actions/SelectQVTTransformation.java (limited to 'deprecated') diff --git a/deprecated/org.eclipse.papyrus.qvtTransformation/.classpath b/deprecated/org.eclipse.papyrus.qvtTransformation/.classpath deleted file mode 100644 index 8a8f1668cdc..00000000000 --- a/deprecated/org.eclipse.papyrus.qvtTransformation/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/deprecated/org.eclipse.papyrus.qvtTransformation/.project b/deprecated/org.eclipse.papyrus.qvtTransformation/.project deleted file mode 100644 index fc20664dbb7..00000000000 --- a/deprecated/org.eclipse.papyrus.qvtTransformation/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.papyrus.qvtTransformation - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/deprecated/org.eclipse.papyrus.qvtTransformation/.settings/org.eclipse.jdt.core.prefs b/deprecated/org.eclipse.papyrus.qvtTransformation/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index bedb6e48320..00000000000 --- a/deprecated/org.eclipse.papyrus.qvtTransformation/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,8 +0,0 @@ -#Wed Aug 25 14:15:47 CEST 2010 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.6 diff --git a/deprecated/org.eclipse.papyrus.qvtTransformation/META-INF/MANIFEST.MF b/deprecated/org.eclipse.papyrus.qvtTransformation/META-INF/MANIFEST.MF deleted file mode 100644 index 366e510fbc3..00000000000 --- a/deprecated/org.eclipse.papyrus.qvtTransformation/META-INF/MANIFEST.MF +++ /dev/null @@ -1,17 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: QvtTransformation -Bundle-SymbolicName: org.eclipse.papyrus.qvtTransformation; singleton:=true -Bundle-Version: 1.0.0.qualifier -Bundle-Activator: org.eclipse.papyrus.qvttransformation.Activator -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.eclipse.core.resources, - org.eclipse.emf.ecore;bundle-version="2.5.0", - org.eclipse.gmf.runtime.diagram.ui;bundle-version="1.4.0", - org.eclipse.m2m.qvt.oml;bundle-version="3.0.0", - org.eclipse.papyrus.core, - org.eclipse.m2m.qvt.oml.runtime;bundle-version="2.1.0", - org.eclipse.m2m.qvt.oml.common;bundle-version="2.1.0" -Bundle-ActivationPolicy: lazy -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/deprecated/org.eclipse.papyrus.qvtTransformation/build.properties b/deprecated/org.eclipse.papyrus.qvtTransformation/build.properties deleted file mode 100644 index 4b8162ab8b2..00000000000 --- a/deprecated/org.eclipse.papyrus.qvtTransformation/build.properties +++ /dev/null @@ -1,6 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = plugin.xml,\ - META-INF/,\ - .,\ - icons/ diff --git a/deprecated/org.eclipse.papyrus.qvtTransformation/icons/icon.gif b/deprecated/org.eclipse.papyrus.qvtTransformation/icons/icon.gif deleted file mode 100644 index 2c1ceaf036e..00000000000 Binary files a/deprecated/org.eclipse.papyrus.qvtTransformation/icons/icon.gif and /dev/null differ diff --git a/deprecated/org.eclipse.papyrus.qvtTransformation/plugin.xml b/deprecated/org.eclipse.papyrus.qvtTransformation/plugin.xml deleted file mode 100644 index 8294a8d4f36..00000000000 --- a/deprecated/org.eclipse.papyrus.qvtTransformation/plugin.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/deprecated/org.eclipse.papyrus.qvtTransformation/src/org/eclipse/papyrus/qvttransformation/Activator.java b/deprecated/org.eclipse.papyrus.qvtTransformation/src/org/eclipse/papyrus/qvttransformation/Activator.java deleted file mode 100644 index bed24bdc18a..00000000000 --- a/deprecated/org.eclipse.papyrus.qvtTransformation/src/org/eclipse/papyrus/qvttransformation/Activator.java +++ /dev/null @@ -1,77 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2008 CEA LIST. - * - * - * 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 - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.qvttransformation; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.papyrus.qvtTransformation"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - - /** - * Returns an image descriptor for the image file at the given - * plug-in relative path - * - * @param path - * the path - * @return the image descriptor - */ - public static ImageDescriptor getImageDescriptor(String path) { - return imageDescriptorFromPlugin(PLUGIN_ID, path); - } -} diff --git a/deprecated/org.eclipse.papyrus.qvtTransformation/src/org/eclipse/papyrus/qvttransformation/popup/actions/SelectQVTTransformation.java b/deprecated/org.eclipse.papyrus.qvtTransformation/src/org/eclipse/papyrus/qvttransformation/popup/actions/SelectQVTTransformation.java deleted file mode 100644 index 33d9fc465f1..00000000000 --- a/deprecated/org.eclipse.papyrus.qvtTransformation/src/org/eclipse/papyrus/qvttransformation/popup/actions/SelectQVTTransformation.java +++ /dev/null @@ -1,176 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2008 CEA LIST. - * - * - * 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 - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.qvttransformation.popup.actions; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.internal.resources.File; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.common.util.BasicDiagnostic; -import org.eclipse.emf.common.util.Diagnostic; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.transaction.RecordingCommand; -import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.m2m.internal.qvt.oml.common.MdaException; -import org.eclipse.m2m.internal.qvt.oml.runtime.project.QvtInterpretedTransformation; -import org.eclipse.m2m.internal.qvt.oml.runtime.project.QvtTransformation; -import org.eclipse.m2m.internal.qvt.oml.runtime.project.QvtTransformation.TransformationParameter; -import org.eclipse.m2m.internal.qvt.oml.runtime.project.QvtTransformation.TransformationParameter.DirectionKind; -import org.eclipse.m2m.qvt.oml.BasicModelExtent; -import org.eclipse.m2m.qvt.oml.ExecutionContextImpl; -import org.eclipse.m2m.qvt.oml.ExecutionDiagnostic; -import org.eclipse.m2m.qvt.oml.ModelExtent; -import org.eclipse.m2m.qvt.oml.TransformationExecutor; -import org.eclipse.papyrus.core.utils.EditorUtils; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IActionDelegate; -import org.eclipse.ui.IObjectActionDelegate; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.dialogs.ElementTreeSelectionDialog; -import org.eclipse.ui.model.BaseWorkbenchContentProvider; -import org.eclipse.ui.model.WorkbenchLabelProvider; - -/** - * - * This class implements a possible integration of QVTo in Papyrus - * - * - */ -public class SelectQVTTransformation implements IObjectActionDelegate { - - private Shell shell; - - /** - * The selected DiagramEditPart - */ - protected DiagramEditPart diagramEditPart = null; - - /** - * Constructor for SelectQVTTransformation. - */ - public SelectQVTTransformation() { - super(); - } - - /** - * @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart) - */ - public void setActivePart(IAction action, IWorkbenchPart targetPart) { - shell = targetPart.getSite().getShell(); - } - - /** - * @see IActionDelegate#run(IAction) - */ - public void run(IAction action) { - if(diagramEditPart != null) { - //Open a dialog to select the transformation to execute - ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(shell, new WorkbenchLabelProvider(), new BaseWorkbenchContentProvider()); - dialog.setTitle("Select a transformation"); - dialog.setInput(ResourcesPlugin.getWorkspace().getRoot()); - dialog.setAllowMultiple(false); - dialog.open(); - Object[] result = dialog.getResult(); - - if(result != null) { - - final File transformationFile = (File)result[0]; - if(transformationFile.getFileExtension().contains("qvt")) { - - //Reification of the transformation - QvtTransformation transfo = new QvtInterpretedTransformation(transformationFile); - //Retrieve transformation's parameters - List params; - try { - params = transfo.getParameters(); - - //The transformation must have only one parameter. - if(params.size() == 1) { - //Retrieve first parameter's metamodels - List metamodels = params.get(0).getMetamodels(); - - //The parameter must be INOUT and it only have UML as metamodel - if(params.get(0).getDirectionKind() == DirectionKind.INOUT && metamodels.size() == 1 && metamodels.get(0).getNsPrefix().compareToIgnoreCase("uml") == 0) { - - //Define the command in Papyrus' editing domain - RecordingCommand command = new RecordingCommand(EditorUtils.getTransactionalEditingDomain()) { - - @Override - protected void doExecute() { - URI uri = URI.createPlatformResourceURI(transformationFile.getFullPath().toString(), true); - - //Create a executor for the transformation - TransformationExecutor executor = new TransformationExecutor(uri); - - //Define the input as the model that contains the selected diagramEditPart - List contents = new ArrayList(); - EObject element = diagramEditPart.resolveSemanticElement(); - contents.add(element); - - ModelExtent input = new BasicModelExtent(contents); - //ModelExtent output = new BasicModelExtent(); - - ExecutionContextImpl context = new ExecutionContextImpl(); - //Execute the transformation - ExecutionDiagnostic diagnostic = executor.execute(context, input); - - //Report success or failure - if(diagnostic.getSeverity() == Diagnostic.OK) { - MessageDialog.openInformation(shell, "QvtTransformation", "Transformation was executed corretly."); - } else { - IStatus status = BasicDiagnostic.toIStatus(diagnostic); - MessageDialog.openError(shell, "QvtTransformation", "Errors occured during the transformation: " + status.getMessage()); - } - } - }; - - //Execute the command - EditorUtils.getTransactionalEditingDomain().getCommandStack().execute(command); - - } else { - MessageDialog.openError(shell, "QvtTransformation", "Transformation signature is invalid : we support only transformations with only one parameter. This parameter must be INOUT and it only have UML as metamodel"); - } - } else { - MessageDialog.openError(shell, "QvtTransformation", "Transformation signature is invalid : the transformation must have only one parameter"); - } - } catch (MdaException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - } - } - } - - /** - * @see IActionDelegate#selectionChanged(IAction, ISelection) - */ - public void selectionChanged(IAction action, ISelection selection) { - if(selection instanceof IStructuredSelection) { - Object selectedElement = ((IStructuredSelection)selection).getFirstElement(); - if(selectedElement instanceof DiagramEditPart) { - diagramEditPart = (DiagramEditPart)selectedElement; - } - } - } - -} -- cgit v1.2.3