Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnsgar Radermacher2014-05-07 03:24:33 -0400
committerAnsgar Radermacher2014-05-07 05:26:32 -0400
commitc14c58734e1a4c26e8070f0f927f62ba17e5cf09 (patch)
tree648076c8b985c8a0caf76645cf4738b352700ff9 /extraplugins/qompass-designer
parentdc8b78be4965366334f44d67a79fc90f2c0b8455 (diff)
downloadorg.eclipse.papyrus-c14c58734e1a4c26e8070f0f927f62ba17e5cf09.tar.gz
org.eclipse.papyrus-c14c58734e1a4c26e8070f0f927f62ba17e5cf09.tar.xz
org.eclipse.papyrus-c14c58734e1a4c26e8070f0f927f62ba17e5cf09.zip
434263 - [QDesginer] Refactoring - move model copier wizard to org.eclipse.papyrus.uml.diagram.wizards
Diffstat (limited to 'extraplugins/qompass-designer')
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/META-INF/MANIFEST.MF3
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/build.acceleo2
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/plugin.xml9
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/HelloWorldModelWizard.java9
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/ModelCopyWizard.java132
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/ProducerConsumerModelWizard.java7
-rw-r--r--extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/META-INF/MANIFEST.MF3
-rw-r--r--extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/build.acceleo2
-rw-r--r--extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/plugin.xml2
-rw-r--r--extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/ClientServerTraceTestModelWizard.java7
10 files changed, 27 insertions, 149 deletions
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/META-INF/MANIFEST.MF b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/META-INF/MANIFEST.MF
index f9f44be146c..9b43f1e107f 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/META-INF/MANIFEST.MF
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/META-INF/MANIFEST.MF
@@ -11,7 +11,8 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.papyrus.uml.tools.utils;bundle-version="1.0.0",
org.eclipse.papyrus.infra.core.log;bundle-version="1.0.0",
org.eclipse.core.resources,
- org.eclipse.papyrus.cpp.profile;bundle-version="1.0.0"
+ org.eclipse.papyrus.cpp.profile;bundle-version="1.0.0",
+ org.eclipse.papyrus.uml.diagram.wizards;bundle-version="1.0.0"
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-Version: 1.0.0.qualifier
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/build.acceleo b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/build.acceleo
index d700f3d8e97..07516ccd68d 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/build.acceleo
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/build.acceleo
@@ -18,7 +18,7 @@
<acceleoCompiler
sourceFolder="${target.folder}"
outputFolder="${target.folder}"
- dependencies="${target.folder}/../../org.eclipse.papyrus.fcm.profile;${target.folder}/../../org.eclipse.papyrus.qompass.designer.core;${target.folder}/../../org.eclipse.papyrus.qompass.designer.vsl;${target.folder}/../../org.eclipse.papyrus.cpp.profile;${target.folder}/../../org.eclipse.papyrus.infra.widgets;${target.folder}/../../org.eclipse.papyrus.acceleo;"
+ dependencies="${target.folder}/../../org.eclipse.papyrus.fcm.profile;${target.folder}/../../org.eclipse.papyrus.qompass.designer.core;${target.folder}/../../org.eclipse.papyrus.qompass.designer.vsl;${target.folder}/../../org.eclipse.papyrus.cpp.profile;${target.folder}/../../org.eclipse.papyrus.infra.widgets;${target.folder}/../../org.eclipse.papyrus.acceleo;${target.folder}/../../org.eclipse.papyrus.uml.tools.utils;${target.folder}/../../org.eclipse.papyrus.codegen.extensionpoints;${target.folder}/../../org.eclipse.papyrus.uml.diagram.wizards;${target.folder}/../../org.eclipse.papyrus.infra.gmfdiag.common;${target.folder}/../../org.eclipse.gmf.tooling.runtime;"
binaryResource="false"
packagesToRegister="">
</acceleoCompiler>
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/plugin.xml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/plugin.xml
index 16db2ded696..910cdd8b2f5 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/plugin.xml
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/plugin.xml
@@ -105,13 +105,8 @@
</client>
</extension>
<extension point="org.eclipse.ui.newWizards">
- <category
- id = "org.eclipse.papyrus.qompass.designer.examples"
- parentCategory="org.eclipse.ui.Examples"
- name="Qompass examples">
- </category>
<wizard
- category="org.eclipse.ui.Examples/org.eclipse.papyrus.qompass.designer.examples"
+ category="org.eclipse.ui.Examples/org.eclipse.papyrus.examples"
class="org.eclipse.papyrus.qompass.modellibs.core.HelloWorldModelWizard"
finalPerspective="org.eclipse.papyrus.infra.core.perspective"
icon="platform:/plugin/org.eclipse.papyrus.qompass.designer.ui/icons/Qompass-16x16.gif"
@@ -120,7 +115,7 @@
<selection class="org.eclipse.core.resources.IResource"/>
</wizard>
<wizard
- category="org.eclipse.ui.Examples/org.eclipse.papyrus.qompass.designer.examples"
+ category="org.eclipse.ui.Examples/org.eclipse.papyrus.examples"
class="org.eclipse.papyrus.qompass.modellibs.core.ProducerConsumerModelWizard"
finalPerspective="org.eclipse.papyrus.infra.core.perspective"
icon="platform:/plugin/org.eclipse.papyrus.qompass.designer.ui/icons/Qompass-16x16.gif"
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/HelloWorldModelWizard.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/HelloWorldModelWizard.java
index 6328d7eee46..ac269c2f4d8 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/HelloWorldModelWizard.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/HelloWorldModelWizard.java
@@ -14,9 +14,14 @@
package org.eclipse.papyrus.qompass.modellibs.core;
+import org.eclipse.papyrus.uml.diagram.wizards.ModelCopyWizard;
+
+/**
+ * Copy wizard for the HelloWorld example
+ */
public class HelloWorldModelWizard extends ModelCopyWizard {
- public HelloWorldModelWizard () {
- modelName = "HelloWorld";
+ public HelloWorldModelWizard() {
+ super("HelloWorld"); //$NON-NLS-1$
}
}
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/ModelCopyWizard.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/ModelCopyWizard.java
deleted file mode 100644
index 022a9eb592d..00000000000
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/ModelCopyWizard.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2013 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:
- * Ansgar Radermacher ansgar.radermacher@cea.fr
- *
- *****************************************************************************/
-
-
-package org.eclipse.papyrus.qompass.modellibs.core;
-
-import java.io.InputStream;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorDescriptor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
-import org.eclipse.ui.part.FileEditorInput;
-
-abstract public class ModelCopyWizard extends Wizard implements INewWizard {
-
- private IStructuredSelection selection;
-
- protected String modelName;
-
- WizardNewFileCreationPage selectionPage;
-
- public static final String modelLocation = "/models/examples/";
-
- @Override
- public boolean performFinish() {
- // String fileName = diagramModelFilePage.getFileName();
- IFile model = copyModel(modelName);
-
- if(model == null) {
- return false;
- }
-
- IWorkbench wb = PlatformUI.getWorkbench();
- IWorkbenchPage page = wb.getActiveWorkbenchWindow().getActivePage();
- try {
- IEditorDescriptor desc = wb.getEditorRegistry().getDefaultEditor(modelName + ".di");
- IEditorInput input = new FileEditorInput(model);
- page.openEditor(input, desc.getId(), false);
- } catch (PartInitException e) {
- // log.error(e);
- return false;
- }
- return true;
- }
-
- /**
- * Copy a model (.di/.notation/.uml) into the selected destination folder
- *
- * @param sourceModelName
- */
- public IFile copyModel(String sourceModelName) {
- try {
- IFile model = copyFile(sourceModelName + ".di");
- copyFile(sourceModelName + ".notation");
- copyFile(sourceModelName + ".uml");
-
- return model;
- } catch (CoreException e) {
- Shell shell = new Shell();
- String reason = e.getMessage();
- if(reason.endsWith("already exists.")) {
- reason += "\nChoose another parent folder or delete existing model first.";
- }
- MessageDialog.openError(shell, "Cannot create copy", reason);
- return null;
- }
- }
-
- /**
- * copy a source file into the selected destination folder
- *
- * @param sourceFileName
- */
- public IFile copyFile(String sourceFileName) throws CoreException {
- IPath destPath = selectionPage.getContainerFullPath();
- InputStream is = getClass().getResourceAsStream(modelLocation + sourceFileName);
- if(is != null) {
- destPath = destPath.append(sourceFileName);
- IFile destFile = ResourcesPlugin.getWorkspace().getRoot().getFile(destPath);
- destFile.create(is, false, null);
- return destFile;
- }
- else {
- throw new CoreException(new Status(0, Activator.PLUGIN_ID, "Cannot open file <" + modelLocation + sourceFileName + ">"));
- }
- }
-
- public void init(IWorkbench workbench, IStructuredSelection selection) {
- // this.workbench = workbench;
- this.selection = selection;
- setWindowTitle("Create Qompass example");
- setNeedsProgressMonitor(true);
- }
-
-
- /**
- * @generated
- */
- @Override
- public void addPages() {
- selectionPage = new WizardNewFileCreationPage("Copy model", selection);
- selectionPage.setTitle("Select parent folder for example " + modelName);
- selectionPage.setDescription("Do not change file name (will be ignored)");
- selectionPage.setFileName(modelName);
- addPage(selectionPage);
- }
-}
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/ProducerConsumerModelWizard.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/ProducerConsumerModelWizard.java
index eceb42d8859..b27d9463dd2 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/ProducerConsumerModelWizard.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/ProducerConsumerModelWizard.java
@@ -14,9 +14,14 @@
package org.eclipse.papyrus.qompass.modellibs.core;
+import org.eclipse.papyrus.uml.diagram.wizards.ModelCopyWizard;
+
+/**
+ * Copy wizard for the ProducerConsumer example
+ */
public class ProducerConsumerModelWizard extends ModelCopyWizard {
public ProducerConsumerModelWizard () {
- modelName = "ProducerConsumer";
+ super("ProducerConsumer"); //$NON-NLS-1$
}
}
diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/META-INF/MANIFEST.MF b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/META-INF/MANIFEST.MF
index 8dc38ac166c..1bdaddd75c9 100644
--- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/META-INF/MANIFEST.MF
+++ b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/META-INF/MANIFEST.MF
@@ -11,7 +11,8 @@ Require-Bundle: org.eclipse.papyrus.fcm.profile;bundle-version="1.0.0",
org.eclipse.emf.workspace;bundle-version="1.5.0",
org.eclipse.uml2.uml;bundle-version="4.0.0",
org.eclipse.papyrus.uml.tools.utils;bundle-version="1.0.0",
- org.eclipse.papyrus.qompass.designer.ui;bundle-version="1.0.0"
+ org.eclipse.papyrus.qompass.designer.ui;bundle-version="1.0.0",
+ org.eclipse.papyrus.uml.diagram.wizards;bundle-version="1.0.0"
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-Version: 1.0.0.qualifier
diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/build.acceleo b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/build.acceleo
index ef3bae852b7..9ce34a99746 100644
--- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/build.acceleo
+++ b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/build.acceleo
@@ -18,7 +18,7 @@
<acceleoCompiler
sourceFolder="${target.folder}"
outputFolder="${target.folder}"
- dependencies="${target.folder}/../../org.eclipse.papyrus.fcm.profile;${target.folder}/../../org.eclipse.papyrus.qompass.modellibs.core;${target.folder}/../../org.eclipse.papyrus.qompass.designer.core;${target.folder}/../../org.eclipse.papyrus.qompass.designer.vsl;${target.folder}/../../org.eclipse.papyrus.cpp.profile;${target.folder}/../../org.eclipse.papyrus.infra.widgets;${target.folder}/../../org.eclipse.papyrus.acceleo;${target.folder}/../../org.eclipse.papyrus.infra.services.tracepoints;${target.folder}/../../org.eclipse.papyrus.qompass.designer.ui;${target.folder}/../../org.eclipse.papyrus.uml.properties;${target.folder}/../../org.eclipse.papyrus.views.properties;${target.folder}/../../org.eclipse.papyrus.infra.gmfdiag.common;${target.folder}/../../org.eclipse.gmf.tooling.runtime;"
+ dependencies="${target.folder}/../../org.eclipse.papyrus.fcm.profile;${target.folder}/../../org.eclipse.papyrus.qompass.modellibs.core;${target.folder}/../../org.eclipse.papyrus.qompass.designer.core;${target.folder}/../../org.eclipse.papyrus.qompass.designer.vsl;${target.folder}/../../org.eclipse.papyrus.cpp.profile;${target.folder}/../../org.eclipse.papyrus.infra.widgets;${target.folder}/../../org.eclipse.papyrus.acceleo;${target.folder}/../../org.eclipse.papyrus.uml.tools.utils;${target.folder}/../../org.eclipse.papyrus.codegen.extensionpoints;${target.folder}/../../org.eclipse.papyrus.uml.diagram.wizards;${target.folder}/../../org.eclipse.papyrus.infra.gmfdiag.common;${target.folder}/../../org.eclipse.gmf.tooling.runtime;${target.folder}/../../org.eclipse.papyrus.infra.services.tracepoints;${target.folder}/../../org.eclipse.papyrus.qompass.designer.ui;${target.folder}/../../org.eclipse.papyrus.uml.properties;${target.folder}/../../org.eclipse.papyrus.views.properties;"
binaryResource="false"
packagesToRegister="">
</acceleoCompiler>
diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/plugin.xml b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/plugin.xml
index 97a573d0cf9..dda90ebebf7 100644
--- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/plugin.xml
+++ b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/plugin.xml
@@ -38,7 +38,7 @@
</extension>
<extension point="org.eclipse.ui.newWizards">
<wizard
- category="org.eclipse.ui.Examples/org.eclipse.papyrus.qompass.designer.examples"
+ category="org.eclipse.ui.Examples/org.eclipse.papyrus.examples"
class="org.eclipse.papyrus.qompass.modellibs.tracing.ClientServerTraceTestModelWizard"
finalPerspective="org.eclipse.papyrus.infra.core.perspective"
icon="platform:/plugin/org.eclipse.papyrus.qompass.designer.ui/icons/Qompass-16x16.gif"
diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/ClientServerTraceTestModelWizard.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/ClientServerTraceTestModelWizard.java
index c3274d24415..92faae26a08 100644
--- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/ClientServerTraceTestModelWizard.java
+++ b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/ClientServerTraceTestModelWizard.java
@@ -1,11 +1,14 @@
package org.eclipse.papyrus.qompass.modellibs.tracing;
-import org.eclipse.papyrus.qompass.modellibs.core.ModelCopyWizard;
+import org.eclipse.papyrus.uml.diagram.wizards.ModelCopyWizard;
+/**
+ * Copy wizard for the ClientServerTraceTest example
+ */
public class ClientServerTraceTestModelWizard extends ModelCopyWizard {
public ClientServerTraceTestModelWizard () {
- modelName = "ClientServerTraceTest"; //$NON-NLS-1$
+ super("ClientServerTraceTest"); //$NON-NLS-1$
}
}

Back to the top