Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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/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
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.wizards/messages.properties9
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.wizards/plugin.xml7
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.wizards/src/org/eclipse/papyrus/uml/diagram/wizards/Messages.java9
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.wizards/src/org/eclipse/papyrus/uml/diagram/wizards/ModelCopyWizard.java (renamed from extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/ModelCopyWizard.java)72
13 files changed, 106 insertions, 35 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/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$
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.wizards/messages.properties b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.wizards/messages.properties
index ca8c79a3c2b..76c5b04a24e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.wizards/messages.properties
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.wizards/messages.properties
@@ -50,3 +50,12 @@ SelectDiagramKindPage_remember_current_selection_tooltip=The current selection w
SelectDiagramKindPage_select_kind_group=Select a Diagram Kind:
SelectRootElementPage_select_root_element_desc=Select the root element
SelectRootElementPage_select_root_element_title=Select the root element
+
+ModelCopyWizard_AlreadyyExists=already exists.
+ModelCopyWizard_CannotCreateCopy=Cannot create copy
+ModelCopyWizard_CannotOpenFIle=Cannot open file "%s"
+ModelCopyWizard_ChooseOtherParentFolder=Choose another parent folder or delete existing model first.
+ModelCopyWizard_CopyModel=Copy model
+ModelCopyWizard_CreatePapyrusExample=Create Papyrus example
+ModelCopyWizard_DoNotChangeFileName=Do not change file name (will be ignored)
+ModelCopyWizard_SelectParentFolder=Select parent folder for example "%s"
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.wizards/plugin.xml b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.wizards/plugin.xml
index 5827b02b22d..1bb7319d284 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.wizards/plugin.xml
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.wizards/plugin.xml
@@ -9,6 +9,11 @@
id="org.eclipse.papyrus.wizards.category"
name="Papyrus">
</category>
+ <category
+ id="org.eclipse.papyrus.examples"
+ parentCategory="org.eclipse.ui.Examples"
+ name="Papyrus examples">
+ </category>
<wizard
category="org.eclipse.papyrus.wizards.category"
class="org.eclipse.papyrus.uml.diagram.wizards.NewPapyrusProjectWizard"
@@ -45,5 +50,5 @@
</enablement>
</provider>
</extension>
-
+
</plugin>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.wizards/src/org/eclipse/papyrus/uml/diagram/wizards/Messages.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.wizards/src/org/eclipse/papyrus/uml/diagram/wizards/Messages.java
index 550ec9ac44b..735c2677cb9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.wizards/src/org/eclipse/papyrus/uml/diagram/wizards/Messages.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.wizards/src/org/eclipse/papyrus/uml/diagram/wizards/Messages.java
@@ -116,6 +116,15 @@ public class Messages extends NLS {
/** The Select root element page_select_root_element_title. */
public static String SelectRootElementPage_select_root_element_title;
+ public static String ModelCopyWizard_AlreadyyExists;
+ public static String ModelCopyWizard_CannotCreateCopy;
+ public static String ModelCopyWizard_CannotOpenFIle;
+ public static String ModelCopyWizard_ChooseOtherParentFolder;
+ public static String ModelCopyWizard_CopyModel;
+ public static String ModelCopyWizard_CreatePapyrusExample;
+ public static String ModelCopyWizard_DoNotChangeFileName;
+ public static String ModelCopyWizard_SelectParentFolder;
+
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/ModelCopyWizard.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.wizards/src/org/eclipse/papyrus/uml/diagram/wizards/ModelCopyWizard.java
index 022a9eb592d..8559677fa6e 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/ModelCopyWizard.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.wizards/src/org/eclipse/papyrus/uml/diagram/wizards/ModelCopyWizard.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
+ * Copyright (c) 2014 CEA LIST.
*
*
* All rights reserved. This program and the accompanying materials
@@ -13,7 +13,7 @@
*****************************************************************************/
-package org.eclipse.papyrus.qompass.modellibs.core;
+package org.eclipse.papyrus.uml.diagram.wizards;
import java.io.InputStream;
@@ -36,15 +36,52 @@ import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
import org.eclipse.ui.part.FileEditorInput;
+/**
+ * An abstract wizard that can be used for copying model pages. Concrete examples need to
+ * inherit from this class and specify model name and location.
+ *
+ */
abstract public class ModelCopyWizard extends Wizard implements INewWizard {
+ private static final String EXT_DI = ".di"; //$NON-NLS-1$
+
+ private static final String EXT_NOTATION = ".notation"; //$NON-NLS-1$
+
+ private static final String EXT_UML = ".uml"; //$NON-NLS-1$
+
private IStructuredSelection selection;
+ /**
+ * The model name (without extension)
+ */
protected String modelName;
- WizardNewFileCreationPage selectionPage;
+ /**
+ * The model location
+ */
+ protected String modelLocation;
+
+ /**
+ * Constructor taking modelName as parameter. Default location in
+ * models/examples is used
+ * @param modelName the name of the example (without extension)
+ */
+ protected ModelCopyWizard(String modelName) {
+ this.modelName = modelName;
+ this.modelLocation = "/models/examples/"; //$NON-NLS-1$
+ }
- public static final String modelLocation = "/models/examples/";
+ /**
+ * Constructor taking modelName (without extension) and location as parameters
+ * @param modelName the name of the example (without extension)
+ * @param modelLocation location of the model relative to the plug-in in which it is contained
+ */
+ protected ModelCopyWizard(String modelName, String modelLocation) {
+ this.modelName = modelName;
+ this.modelLocation = modelLocation;
+ }
+
+ protected WizardNewFileCreationPage selectionPage;
@Override
public boolean performFinish() {
@@ -58,7 +95,7 @@ abstract public class ModelCopyWizard extends Wizard implements INewWizard {
IWorkbench wb = PlatformUI.getWorkbench();
IWorkbenchPage page = wb.getActiveWorkbenchWindow().getActivePage();
try {
- IEditorDescriptor desc = wb.getEditorRegistry().getDefaultEditor(modelName + ".di");
+ IEditorDescriptor desc = wb.getEditorRegistry().getDefaultEditor(modelName + EXT_DI);
IEditorInput input = new FileEditorInput(model);
page.openEditor(input, desc.getId(), false);
} catch (PartInitException e) {
@@ -75,18 +112,18 @@ abstract public class ModelCopyWizard extends Wizard implements INewWizard {
*/
public IFile copyModel(String sourceModelName) {
try {
- IFile model = copyFile(sourceModelName + ".di");
- copyFile(sourceModelName + ".notation");
- copyFile(sourceModelName + ".uml");
-
+ IFile model = copyFile(sourceModelName + EXT_DI);
+ copyFile(sourceModelName + EXT_NOTATION);
+ copyFile(sourceModelName + EXT_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.";
+ if(reason.endsWith(Messages.ModelCopyWizard_AlreadyyExists)) {
+ reason += "\n" + //$NON-NLS-1$
+ Messages.ModelCopyWizard_ChooseOtherParentFolder;
}
- MessageDialog.openError(shell, "Cannot create copy", reason);
+ MessageDialog.openError(shell, Messages.ModelCopyWizard_CannotCreateCopy, reason);
return null;
}
}
@@ -106,14 +143,15 @@ abstract public class ModelCopyWizard extends Wizard implements INewWizard {
return destFile;
}
else {
- throw new CoreException(new Status(0, Activator.PLUGIN_ID, "Cannot open file <" + modelLocation + sourceFileName + ">"));
+ throw new CoreException(new Status(0, Activator.PLUGIN_ID,
+ String.format(Messages.ModelCopyWizard_CannotOpenFIle, modelLocation + sourceFileName)));
}
}
public void init(IWorkbench workbench, IStructuredSelection selection) {
// this.workbench = workbench;
this.selection = selection;
- setWindowTitle("Create Qompass example");
+ setWindowTitle(Messages.ModelCopyWizard_CreatePapyrusExample);
setNeedsProgressMonitor(true);
}
@@ -123,9 +161,9 @@ abstract public class ModelCopyWizard extends Wizard implements INewWizard {
*/
@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 = new WizardNewFileCreationPage(Messages.ModelCopyWizard_CopyModel, selection);
+ selectionPage.setTitle(String.format(Messages.ModelCopyWizard_SelectParentFolder, modelName));
+ selectionPage.setDescription(Messages.ModelCopyWizard_DoNotChangeFileName);
selectionPage.setFileName(modelName);
addPage(selectionPage);
}

Back to the top