diff options
author | Camille Letavernier | 2014-03-14 18:41:48 +0000 |
---|---|---|
committer | Camille Letavernier | 2014-03-14 18:41:48 +0000 |
commit | 5efb25129cdd8ecbb235b7ab8fb9df7772f366a3 (patch) | |
tree | 5675df17114f44c12a8bcf563fa680a4ab1c6737 /deprecated | |
parent | 060a85b6c7afda80ccd6c983d828a6eea252c653 (diff) | |
download | org.eclipse.papyrus-5efb25129cdd8ecbb235b7ab8fb9df7772f366a3.tar.gz org.eclipse.papyrus-5efb25129cdd8ecbb235b7ab8fb9df7772f366a3.tar.xz org.eclipse.papyrus-5efb25129cdd8ecbb235b7ab8fb9df7772f366a3.zip |
[Releng] Move the oep.diagramqueryresult plug-in to the deprecated
folder
Diffstat (limited to 'deprecated')
9 files changed, 278 insertions, 0 deletions
diff --git a/deprecated/org.eclipse.papyrus.diagramqueryresult/.classpath b/deprecated/org.eclipse.papyrus.diagramqueryresult/.classpath new file mode 100644 index 00000000000..2d1a4302f04 --- /dev/null +++ b/deprecated/org.eclipse.papyrus.diagramqueryresult/.classpath @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/deprecated/org.eclipse.papyrus.diagramqueryresult/.project b/deprecated/org.eclipse.papyrus.diagramqueryresult/.project new file mode 100644 index 00000000000..f2ccb673650 --- /dev/null +++ b/deprecated/org.eclipse.papyrus.diagramqueryresult/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.diagramqueryresult</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/deprecated/org.eclipse.papyrus.diagramqueryresult/.settings/org.eclipse.jdt.core.prefs b/deprecated/org.eclipse.papyrus.diagramqueryresult/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..5f279a814d0 --- /dev/null +++ b/deprecated/org.eclipse.papyrus.diagramqueryresult/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +#Tue May 25 14:26:52 CEST 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/deprecated/org.eclipse.papyrus.diagramqueryresult/META-INF/MANIFEST.MF b/deprecated/org.eclipse.papyrus.diagramqueryresult/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..f39e39761a7 --- /dev/null +++ b/deprecated/org.eclipse.papyrus.diagramqueryresult/META-INF/MANIFEST.MF @@ -0,0 +1,20 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: org.eclipse.papyrus.diagramqueryresult;singleton:=true +Bundle-Version: 0.7.0 +Bundle-Activator: org.eclipse.papyrus.diagramqueryresult.Activator +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.uml2.uml;bundle-version="3.1.0", + org.eclipse.papyrus.core;bundle-version="0.7.0", + org.eclipse.papyrus.editor;bundle-version="0.7.0", + org.eclipse.papyrus.core.adaptor.gmf;bundle-version="0.7.0", + org.eclipse.gmt.modisco.infra.query.ui;bundle-version="0.8.0", + org.eclipse.gmt.modisco.infra.query;bundle-version="0.8.0", + org.eclipse.papyrus.diagram.clazz;bundle-version="0.7.0", + org.eclipse.papyrus.diagram.common;bundle-version="0.7.0", + org.eclipse.gmf.runtime.diagram.ui.resources.editor;bundle-version="1.4.0" +Bundle-ActivationPolicy: lazy +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Bundle-Vendor: %providerName diff --git a/deprecated/org.eclipse.papyrus.diagramqueryresult/build.properties b/deprecated/org.eclipse.papyrus.diagramqueryresult/build.properties new file mode 100644 index 00000000000..6f20375d6c7 --- /dev/null +++ b/deprecated/org.eclipse.papyrus.diagramqueryresult/build.properties @@ -0,0 +1,5 @@ +source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml
diff --git a/deprecated/org.eclipse.papyrus.diagramqueryresult/plugin.properties b/deprecated/org.eclipse.papyrus.diagramqueryresult/plugin.properties new file mode 100644 index 00000000000..d0bf9665000 --- /dev/null +++ b/deprecated/org.eclipse.papyrus.diagramqueryresult/plugin.properties @@ -0,0 +1,16 @@ +########################################################################################## +# Copyright (c) 2010 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: +# Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation +# +######################################################################################## +providerName=Eclipse.org +pluginName= org.eclipse.papyrus.diagramqueryresult (Incubation) + diff --git a/deprecated/org.eclipse.papyrus.diagramqueryresult/plugin.xml b/deprecated/org.eclipse.papyrus.diagramqueryresult/plugin.xml new file mode 100644 index 00000000000..48397355a76 --- /dev/null +++ b/deprecated/org.eclipse.papyrus.diagramqueryresult/plugin.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+
+<plugin>
+<extension
+ point="org.eclipse.gmt.modisco.infra.query.ui.queryResultDisplay">
+ <queryResultDisplayer
+ class="org.eclipse.papyrus.diagramqueryresult.DiagramQueryResultDisplayer"
+ name="Diagram">
+ </queryResultDisplayer>
+ </extension>
+</plugin>
diff --git a/deprecated/org.eclipse.papyrus.diagramqueryresult/src/org/eclipse/papyrus/diagramqueryresult/Activator.java b/deprecated/org.eclipse.papyrus.diagramqueryresult/src/org/eclipse/papyrus/diagramqueryresult/Activator.java new file mode 100644 index 00000000000..2b689b6d427 --- /dev/null +++ b/deprecated/org.eclipse.papyrus.diagramqueryresult/src/org/eclipse/papyrus/diagramqueryresult/Activator.java @@ -0,0 +1,63 @@ +/*****************************************************************************
+ * Copyright (c) 2010 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:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.diagramqueryresult;
+
+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.diagramqueryresult"; //$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;
+ }
+
+}
diff --git a/deprecated/org.eclipse.papyrus.diagramqueryresult/src/org/eclipse/papyrus/diagramqueryresult/DiagramQueryResultDisplayer.java b/deprecated/org.eclipse.papyrus.diagramqueryresult/src/org/eclipse/papyrus/diagramqueryresult/DiagramQueryResultDisplayer.java new file mode 100644 index 00000000000..1a7ebb55819 --- /dev/null +++ b/deprecated/org.eclipse.papyrus.diagramqueryresult/src/org/eclipse/papyrus/diagramqueryresult/DiagramQueryResultDisplayer.java @@ -0,0 +1,119 @@ +/*****************************************************************************
+ * Copyright (c) 2010 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:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.diagramqueryresult;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.CompoundCommand;
+import org.eclipse.gef.commands.UnexecutableCommand;
+import org.eclipse.gmf.runtime.diagram.ui.actions.ActionIds;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.requests.ArrangeRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.DropObjectsRequest;
+import org.eclipse.gmf.runtime.diagram.ui.services.layout.LayoutType;
+import org.eclipse.gmt.modisco.infra.query.runtime.ModelQueryResult;
+import org.eclipse.gmt.modisco.infra.query.ui.views.queryExecution.QueryResultDisplayer;
+import org.eclipse.papyrus.core.editor.IMultiDiagramEditor;
+import org.eclipse.papyrus.core.extension.commands.ICreationCommand;
+import org.eclipse.papyrus.core.utils.DiResourceSet;
+import org.eclipse.papyrus.core.utils.EditorUtils;
+import org.eclipse.papyrus.diagram.clazz.CreateClassDiagramCommand;
+import org.eclipse.papyrus.diagram.clazz.UmlClassDiagramForMultiEditor;
+import org.eclipse.papyrus.diagram.clazz.part.UMLDiagramEditor;
+import org.eclipse.papyrus.diagram.common.command.wrappers.GEFtoEMFCommandWrapper;
+import org.eclipse.papyrus.editor.PapyrusMultiDiagramEditor;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.Element;
+
+
+public class DiagramQueryResultDisplayer implements QueryResultDisplayer {
+
+ /** The diagram editor. */
+ protected UMLDiagramEditor diagramEditor=null;
+
+ /** The clazzdiagramedit part. */
+ protected DiagramEditPart clazzdiagrameditPart;
+
+
+
+ /** The papyrus editor. */
+ protected PapyrusMultiDiagramEditor papyrusEditor;
+
+ public DiagramQueryResultDisplayer() {
+ // TODO Auto-generated constructor stub
+ }
+
+ public void displayQueryResult(List<ModelQueryResult> result) {
+ while( !(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor()instanceof IMultiDiagramEditor)){}
+ IEditorPart editorPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ DiResourceSet diResourceSet=EditorUtils.getDiResourceSet();
+ papyrusEditor=((PapyrusMultiDiagramEditor)editorPart);
+ CreateClassDiagramCommand command= new CreateClassDiagramCommand();
+ command.createDiagram(diResourceSet, null, "result");
+
+ Iterator<ModelQueryResult> resultIterator= result.iterator();
+ while(resultIterator.hasNext()) {
+ ModelQueryResult modelQueryResult = (ModelQueryResult)resultIterator.next();
+
+ if(modelQueryResult.getValue() instanceof Collection){
+ Iterator iter= ((Collection)modelQueryResult.getValue()).iterator();
+ int i=0;
+ while(iter.hasNext()) {
+ Object object = (Object)iter.next();
+
+ if( object instanceof Element){
+ DropObjectsRequest dropObjectsRequest= new DropObjectsRequest();
+ ArrayList list = new ArrayList();
+ list.add((Element)object);
+ dropObjectsRequest.setObjects(list);
+ dropObjectsRequest.setLocation(new Point(20,100*i));
+ Command commandDrop= getDiagramEditPart().getCommand(dropObjectsRequest);
+ diagramEditor.getDiagramEditDomain().getDiagramCommandStack().execute(commandDrop);
+ i++;
+ }
+ }
+ }
+ }
+ List operationSet = getDiagramEditPart().getChildren();
+ ArrangeRequest aRequest = new ArrangeRequest(ActionIds.ACTION_ARRANGE_ALL, LayoutType.DEFAULT);
+ //aRequest.setType(ActionIds.ACTION_ARRANGE_ALL);
+ ArrayList toarrange= new ArrayList();
+ toarrange.add(getDiagramEditPart());
+ aRequest.setPartsToArrange(toarrange);
+ Command commandArrangeAll = getDiagramEditPart().getCommand(aRequest);
+ //getDiagramEditPart().getEditingDomain().getCommandStack().execute(new GEFtoEMFCommandWrapper(commandArrangeAll));
+
+
+
+
+ }
+
+ /**
+ * Gets the diagram edit part.
+ *
+ * @return the diagram edit part
+ */
+ protected DiagramEditPart getDiagramEditPart(){
+ diagramEditor= (UmlClassDiagramForMultiEditor)papyrusEditor.getActiveEditor();
+ clazzdiagrameditPart = (DiagramEditPart)diagramEditor.getGraphicalViewer().getEditPartRegistry().get(diagramEditor.getDiagram());
+ return clazzdiagrameditPart;
+ }
+
+}
|