Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortarendt2012-11-26 06:49:12 -0500
committertarendt2012-11-26 06:49:12 -0500
commitddc31c54fe6d7d5a323e11177644ac1496b00fa7 (patch)
tree7804a016587854a9ff82ca7123a3eefe08884c8c
parent1c6bfe6c31363a7866661e758b0540e855c3b55a (diff)
downloadorg.eclipse.emf.refactor.refactoring-ddc31c54fe6d7d5a323e11177644ac1496b00fa7.tar.gz
org.eclipse.emf.refactor.refactoring-ddc31c54fe6d7d5a323e11177644ac1496b00fa7.tar.xz
org.eclipse.emf.refactor.refactoring-ddc31c54fe6d7d5a323e11177644ac1496b00fa7.zip
templates added
-rw-r--r--org.eclipse.emf.refactor.refactoring.henshin/templates/ConfigHenshin.javajet12
-rw-r--r--org.eclipse.emf.refactor.refactoring.henshin/templates/RefactoringControllerHenshin.javajet176
-rw-r--r--org.eclipse.emf.refactor.refactoring.henshin/templates/RefactoringDataManagementHenshin.javajet137
-rw-r--r--org.eclipse.emf.refactor.refactoring.henshin/templates/RefactoringGuiHandlerHenshin.javajet77
-rw-r--r--org.eclipse.emf.refactor.refactoring.henshin/templates/RefactoringInformationHenshin.javajet82
-rw-r--r--org.eclipse.emf.refactor.refactoring.henshin/templates/RefactoringTestHenshin.javajet106
-rw-r--r--org.eclipse.emf.refactor.refactoring.henshin/templates/RefactoringWizardHenshin.javajet43
-rw-r--r--org.eclipse.emf.refactor.refactoring.henshin/templates/RefactoringWizardPageHenshin.javajet124
8 files changed, 757 insertions, 0 deletions
diff --git a/org.eclipse.emf.refactor.refactoring.henshin/templates/ConfigHenshin.javajet b/org.eclipse.emf.refactor.refactoring.henshin/templates/ConfigHenshin.javajet
new file mode 100644
index 0000000..7058ac1
--- /dev/null
+++ b/org.eclipse.emf.refactor.refactoring.henshin/templates/ConfigHenshin.javajet
@@ -0,0 +1,12 @@
+<%@ jet package="org.eclipse.emf.refactor.refactoring" class="RefactoringController"
+imports="org.eclipse.emf.refactor.refactoring.generator.core.*"%>
+<%RefactoringInfo info = (RefactoringInfo) argument; %>
+<?xml version="1.0" encoding="UTF-8"?>
+<config>
+ <% for (ParameterInfo pi : info.getParameters()) { %>
+ <param>
+ <name><%=pi.getName()%></name>
+ <value>enter value here</value>
+ </param>
+ <% } %>
+</config> \ No newline at end of file
diff --git a/org.eclipse.emf.refactor.refactoring.henshin/templates/RefactoringControllerHenshin.javajet b/org.eclipse.emf.refactor.refactoring.henshin/templates/RefactoringControllerHenshin.javajet
new file mode 100644
index 0000000..04a41f6
--- /dev/null
+++ b/org.eclipse.emf.refactor.refactoring.henshin/templates/RefactoringControllerHenshin.javajet
@@ -0,0 +1,176 @@
+<%@ jet package="org.eclipse.emf.refactor" class="RefactoringController"
+imports="org.eclipse.emf.refactor.henshin.generator.*"%>
+<%RefactoringConfigHenshin refactoringConfig = (RefactoringConfigHenshin) argument; %>
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: RefactoringControllerHenshin.javajet,v 1.1 2012/11/26 11:49:12 tarendt Exp $
+ */
+ package <%=refactoringConfig.getPackageName()%>;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.refactor.henshin.runtime.HenshinLtkEmfRefactoringProcessorAdapter;
+import org.eclipse.emf.refactor.henshin.runtime.HenshinRunner;
+import org.eclipse.emf.refactor.henshin.core.IHenshinController;
+import org.eclipse.emf.refactor.henshin.core.IHenshinDataManagement;
+import org.eclipse.emf.refactor.common.core.EmfRefactoring;
+import org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor;
+
+/**
+ * Concrete EMF model refactoring class implementing IHenshinController.
+ * @generated
+ */
+public final class RefactoringController implements IHenshinController{
+
+ /**
+ * EmfRefactoring supported by the controller.
+ * @generated
+ */
+ private EmfRefactoring parent;
+
+ /**
+ * DataManagement object of the model refactoring.
+ * @generated
+ */
+ private RefactoringDataManagement dataManagement =
+ new RefactoringDataManagement();
+
+ /**
+ * Invocation context of the model refactoring.
+ * @generated
+ */
+ private List<EObject> selection = new ArrayList<EObject>();
+
+ /**
+ * HenshinRunner that executes Henshin transformations using
+ * the Henshin interpreter.
+ * @generated
+ */
+ private HenshinRunner henshinRunner =
+ new HenshinRunner(new ArrayList<EObject>(0), dataManagement);
+
+ /**
+ * Ltk RefactoringProcessor of the model refactoring.
+ * @generated
+ */
+ private InternalRefactoringProcessor refactoringProcessor = null;
+
+ /**
+ * Gets the EmfRefactoring supported by the controller.
+ * @return EmfRefactoring supported by the controller.
+ * @see org.eclipse.emf.refactor.common.core.IController#getParent()
+ * @generated
+ */
+ @Override
+ public EmfRefactoring getParent() {
+ return this.parent;
+ }
+
+ /**
+ * Sets the EmfRefactoring supported by the controller.
+ * @param emfRefactoring EmfRefactoring supported by the controller.
+ * @see org.eclipse.emf.refactor.common.core.IController#
+ * setParent(org.eclipse.emf.refactor.common.core.EmfRefactoring)
+ * @generated
+ */
+ @Override
+ public void setParent(EmfRefactoring emfRefactoring) {
+ this.parent = emfRefactoring;
+ }
+
+ /**
+ * Returns the DataManagement object of the model refactoring.
+ * @return DataManagement object of the model refactoring.
+ * @see org.eclipse.emf.refactor.henshin.core.IHenshinController#
+ * getDataManagementObject()
+ * @generated
+ */
+ @Override
+ public IHenshinDataManagement getDataManagementObject() {
+ return this.dataManagement;
+ }
+
+ /**
+ * Gets a HenshinRunner that executes Henshin transformations using
+ * the Henshin interpreter.
+ * @return HenshinRunner that executes Henshin transformations using
+ * the Henshin interpreter.
+ * @see org.eclipse.emf.refactor.henshin.core.IHenshinController#
+ * getHenshinRunner()
+ * @generated
+ */
+ @Override
+ public HenshinRunner getHenshinRunner() {
+ return this.henshinRunner;
+ }
+
+ /**
+ * Returns the ltk RefactoringProcessor of the model refactoring.
+ * @return Ltk RefactoringProcessor of the model refactoring.
+ * @see org.eclipse.emf.refactor.common.core.IController#
+ * getLtkRefactoringProcessor()
+ * @generated
+ */
+ @Override
+ public RefactoringProcessor getLtkRefactoringProcessor() {
+ return this.refactoringProcessor;
+ }
+
+ /**
+ * Sets the selected EObject (invocation context of the model refactoring).
+ * @param selection Invocation context of the model refactoring.
+ * @see org.eclipse.emf.refactor.common.core.IController#
+ * setSelection(java.util.List)
+ * @generated
+ */
+ @Override
+ public void setSelection(List<EObject> selection) {
+ this.selection = selection;
+ this.henshinRunner = new HenshinRunner(this.selection, this.dataManagement);
+ this.refactoringProcessor =
+ new InternalRefactoringProcessor(this.selection);
+ }
+
+ /**
+ * Returns a Runnable object that executes the model refactoring.
+ * @return Runnable object that executes the model refactoring.
+ * @generated
+ */
+ private Runnable applyRefactoring() {
+ return new Runnable() {
+ /**
+ * @see java.lang.Runnable#run()
+ * @generated
+ */
+ @Override
+ public void run() {
+ henshinRunner = new HenshinRunner(selection, dataManagement);
+ henshinRunner.run();
+ }
+ };
+ }
+
+ /**
+ * Internal class for providing an instance of a LTK RefactoringProcessor
+ * used for EMF model refactorings using Henshin transformations.
+ * @generated
+ */
+ public final class InternalRefactoringProcessor extends
+ HenshinLtkEmfRefactoringProcessorAdapter {
+
+ /**
+ * Constructor using the invocation context of the model refactoring.
+ * @param selection Invocation context of the model refactoring.
+ * @generated
+ */
+ private InternalRefactoringProcessor(List<EObject> selection){
+ super(getParent(), selection, applyRefactoring());
+ }
+
+ }
+
+} \ No newline at end of file
diff --git a/org.eclipse.emf.refactor.refactoring.henshin/templates/RefactoringDataManagementHenshin.javajet b/org.eclipse.emf.refactor.refactoring.henshin/templates/RefactoringDataManagementHenshin.javajet
new file mode 100644
index 0000000..3347108
--- /dev/null
+++ b/org.eclipse.emf.refactor.refactoring.henshin/templates/RefactoringDataManagementHenshin.javajet
@@ -0,0 +1,137 @@
+<%@ jet package="org.eclipse.emf.refactor" class="RefactoringDataManagement"
+imports="org.eclipse.emf.refactor.generator.* org.eclipse.emf.refactor.henshin.generator.*"%>
+<%RefactoringConfigHenshin refactoringConfig = (RefactoringConfigHenshin) argument; %>
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: RefactoringDataManagementHenshin.javajet,v 1.1 2012/11/26 11:49:12 tarendt Exp $
+ */
+ package <%=refactoringConfig.getPackageName()%>;
+
+import java.util.List;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.refactor.henshin.core.IHenshinDataManagement;
+import org.eclipse.emf.refactor.henshin.core.IHenshinInformation;
+import org.eclipse.emf.refactor.runtime.DataManagementAdapter;
+import org.eclipse.emf.refactor.common.core.Port;
+
+/**
+ * Class for specific data concerning a model refactoring.
+ * @generated
+ */
+public class RefactoringDataManagement extends DataManagementAdapter
+ implements IHenshinDataManagement {
+
+ private final String SELECTEDEOBJECT = "selectedEObject";
+
+ /**
+ * HenshinInformation object used for checking the initial
+ * conditions of the EMF model refactoring.
+ * @generated
+ */
+ private RefactoringInformation initialConditionsInformation =
+ new RefactoringInformation(this);
+
+ /**
+ * HenshinInformation object used for checking the final
+ * conditions of the EMF model refactoring.
+ * @generated
+ */
+ private RefactoringInformation finalConditionsInformation =
+ new RefactoringInformation(this);
+
+ /**
+ * HenshinInformation object used for executing the EMF
+ * model refactoring.
+ * @generated
+ */
+ private RefactoringInformation createChangeInformation =
+ new RefactoringInformation(this);
+
+ /**
+ * Default constructor.
+ * @generated
+ */
+ public RefactoringDataManagement() {
+ this.addPorts();
+ this.addInformation();
+ }
+
+ /**
+ * Adds the ports to the data management used for parameter passing.
+ * @generated
+ */
+ private void addPorts(){
+ this.inPorts.add
+ (new Port<<%=refactoringConfig.getSelectedEObjectClass()%>>
+ (SELECTEDEOBJECT, <%=refactoringConfig.getSelectedEObjectClass()%>.class));
+<% for (ParameterConfig pc : refactoringConfig.getParameters()) { %>
+ this.inPorts.add
+ (new Port<String>
+ ("<%=pc.getName()%>", String.class, "unspecified"));
+<% } %>
+ }
+
+ /**
+ * Adds the Henshin informations to the data management.
+ * @generated
+ */
+ private void addInformation() {
+<% if (! refactoringConfig.getCheckInitialFileName().isEmpty()) { %>
+ this.initialConditionsInformation.
+ setTransformationFileName("<%=refactoringConfig.getCheckInitialFileName()%>");
+<% } %>
+<% if (! refactoringConfig.getCheckFinalFileName().isEmpty()) { %>
+ this.finalConditionsInformation.
+ setTransformationFileName("<%=refactoringConfig.getCheckFinalFileName()%>");
+<% } %>
+ this.createChangeInformation.
+ setTransformationFileName("<%=refactoringConfig.getCreateChangeFileName()%>");
+ }
+
+ /**
+ * @see org.eclipse.emf.refactor.henshin.core.IHenshinDataManagement#
+ * getCreateChangeHenshinInformation()
+ * @generated
+ */
+ @Override
+ public IHenshinInformation getCreateChangeHenshinInformation() {
+ return this.createChangeInformation;
+ }
+
+ /**
+ * @see org.eclipse.emf.refactor.henshin.core.IHenshinDataManagement#
+ * getFinalConditionsHenshinInformation()
+ * @generated
+ */
+ @Override
+ public IHenshinInformation getFinalConditionsHenshinInformation() {
+ return this.finalConditionsInformation;
+ }
+
+ /**
+ * @see org.eclipse.emf.refactor.henshin.core.IHenshinDataManagement#
+ * getInitialConditionsHenshinInformation()
+ * @generated
+ */
+ @Override
+ public IHenshinInformation getInitialConditionsHenshinInformation() {
+ return this.initialConditionsInformation;
+ }
+
+ /**
+ * @see org.eclipse.emf.refactor.common.core.IDataManagement#
+ * preselect(java.util.List)
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void preselect(List<EObject> selection) {
+ getInPortByName(SELECTEDEOBJECT).
+ setValue((<%=refactoringConfig.getSelectedEObjectClass()%>) selection.get(0));
+ }
+
+}
+ \ No newline at end of file
diff --git a/org.eclipse.emf.refactor.refactoring.henshin/templates/RefactoringGuiHandlerHenshin.javajet b/org.eclipse.emf.refactor.refactoring.henshin/templates/RefactoringGuiHandlerHenshin.javajet
new file mode 100644
index 0000000..df4f148
--- /dev/null
+++ b/org.eclipse.emf.refactor.refactoring.henshin/templates/RefactoringGuiHandlerHenshin.javajet
@@ -0,0 +1,77 @@
+<%@ jet package="org.eclipse.emf.refactor" class="RefactoringGuiHandler"
+imports="org.eclipse.emf.refactor.henshin.generator.*"%>
+<%RefactoringConfigHenshin refactoringConfig = (RefactoringConfigHenshin) argument; %>
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: RefactoringGuiHandlerHenshin.javajet,v 1.1 2012/11/26 11:49:12 tarendt Exp $
+ */
+ package <%=refactoringConfig.getPackageName()%>;
+
+import java.util.List;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.refactor.common.core.EmfRefactoring;
+import org.eclipse.emf.refactor.common.core.ui.IGuiHandler;
+import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
+
+/**
+ * Class used for specifying gui topics of a specific model refactoring.
+ * @generated
+ */
+public class RefactoringGuiHandler implements IGuiHandler {
+
+ /**
+ * EmfRefactoring supported by the GuiHandler.
+ * @generated
+ */
+ EmfRefactoring parent;
+
+ /**
+ * @see org.eclipse.emf.refactor.common.core.ui.IGuiHandler#getParent()
+ * @generated
+ */
+ @Override
+ public EmfRefactoring getParent() {
+ return parent;
+ }
+
+ /**
+ * @see org.eclipse.emf.refactor.common.core.ui.IGuiHandler#
+ * setParent(org.eclipse.emf.refactor.common.core.EmfRefactoring)
+ * @generated
+ */
+ @Override
+ public void setParent(EmfRefactoring emfRefactoring) {
+ this.parent = emfRefactoring;
+ }
+
+ /**
+ * @see org.eclipse.emf.refactor.common.core.ui.IGuiHandler#show()
+ * @generated
+ */
+ @Override
+ public RefactoringWizard show() {
+ return new <%=refactoringConfig.getPackageName()%>.RefactoringWizard
+ ((RefactoringController)this.parent.getController());
+ }
+
+ /**
+ * @see org.eclipse.emf.refactor.common.core.ui.IGuiHandler#
+ * showInMenu(java.util.List)
+ * @generated
+ */
+ @Override
+ public boolean showInMenu(List<EObject> selection) {
+ for(EObject o:selection){
+ if(null != o){
+ if (o instanceof <%=refactoringConfig.getSelectedEObjectClass()%>) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+}
+ \ No newline at end of file
diff --git a/org.eclipse.emf.refactor.refactoring.henshin/templates/RefactoringInformationHenshin.javajet b/org.eclipse.emf.refactor.refactoring.henshin/templates/RefactoringInformationHenshin.javajet
new file mode 100644
index 0000000..53e7145
--- /dev/null
+++ b/org.eclipse.emf.refactor.refactoring.henshin/templates/RefactoringInformationHenshin.javajet
@@ -0,0 +1,82 @@
+<%@ jet package="org.eclipse.emf.refactor" class="RefactoringInformation"
+imports="org.eclipse.emf.refactor.henshin.generator.*"%>
+<%RefactoringConfigHenshin refactoringConfig = (RefactoringConfigHenshin) argument; %>
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: RefactoringInformationHenshin.javajet,v 1.1 2012/11/26 11:49:12 tarendt Exp $
+ */
+ package <%=refactoringConfig.getPackageName()%>;
+
+import java.io.File;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.emf.refactor.henshin.runtime.HenshinInformationAdapter;
+import org.eclipse.emf.refactor.henshin.core.IHenshinDataManagement;
+import org.osgi.framework.Bundle;
+
+import <%=refactoringConfig.getRootPackageName()%>.Activator;
+
+/**
+ * Class used for specifying a Henshin file that shall be used by
+ * a specific EMF model refactoring.
+ * @generated
+ */
+public class RefactoringInformation extends HenshinInformationAdapter {
+
+ /**
+ * HenshinDataManagement object of the specific EMF model refactoring.
+ * @generated
+ */
+ private RefactoringDataManagement dataManagement;
+
+ /**
+ * Default constructor using a RefactoringDataManagement object.
+ * @param dataManagement HenshinDataManagement object of the specific
+ * EMF model refactoring.
+ * @generated
+ */
+ public RefactoringInformation
+ (RefactoringDataManagement dataManagement) {
+ super();
+ this.dataManagement = dataManagement;
+ }
+
+ /**
+ * @see org.eclipse.emf.refactor.henshin.core.IHenshinInformation#
+ * getHenshinDataManagement()
+ * @generated
+ */
+ @Override
+ public IHenshinDataManagement getHenshinDataManagement() {
+ return this.dataManagement;
+ }
+
+ /**
+ * @see org.eclipse.emf.refactor.henshin.runtime.
+ * HenshinInformationAdapter#getTransformationFileName()
+ * @generated
+ */
+ @Override
+ public String getTransformationFileName() {
+ String emtPath = "";
+ final Bundle bundle = Platform.getBundle(Activator.PLUGIN_ID);
+ try {
+ if (bundle != null) {
+ emtPath = FileLocator.toFileURL
+ (bundle.getEntry("transformation")).getFile();
+ emtPath += this.transformationFileName;
+ } else {
+ emtPath = new File(".").getCanonicalPath()
+ + "\\transformation\\"
+ + this.transformationFileName;
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ System.out.println(emtPath);
+ return emtPath;
+ }
+
+} \ No newline at end of file
diff --git a/org.eclipse.emf.refactor.refactoring.henshin/templates/RefactoringTestHenshin.javajet b/org.eclipse.emf.refactor.refactoring.henshin/templates/RefactoringTestHenshin.javajet
new file mode 100644
index 0000000..4760b15
--- /dev/null
+++ b/org.eclipse.emf.refactor.refactoring.henshin/templates/RefactoringTestHenshin.javajet
@@ -0,0 +1,106 @@
+<%@ jet package="org.eclipse.emf.refactor" class="RefactoringTest"
+imports="org.eclipse.emf.refactor.generator.*"%>
+<%RefactoringConfig refactoringConfig = (RefactoringConfig) argument; %>
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: RefactoringTestHenshin.javajet,v 1.1 2012/11/26 11:49:12 tarendt Exp $
+ */
+
+package <%=refactoringConfig.getPackageName()%>;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
+import org.eclipse.emf.henshin.model.HenshinPackage;
+import org.eclipse.emf.refactor.common.core.EmfRefactoring;
+import <%=refactoringConfig.getPackageName()%>.RefactoringController;
+import <%=refactoringConfig.getPackageName()%>.RefactoringGuiHandler;
+import org.eclipse.emf.refactor.runtime.test.JUnitTestCaseAdapter;
+import <%=refactoringConfig.getSelectedEObjectJar()%>.<%=refactoringConfig.getMetaModelName()%>Package;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+/**
+ * Class used for running individual JUnit test cases
+ * of the specific model refactoring.
+ * @generated
+ */
+@RunWith(value = Parameterized.class)
+public class RefactoringTest extends JUnitTestCaseAdapter {
+
+ /**
+ * Number of test cases.
+ * @generated
+ */
+ private String number;
+
+ /**
+ * Constructor implementation.
+ * @param number Number of test cases.
+ * @generated
+ */
+ public RefactoringTest(String number) throws IOException {
+ super("<%=refactoringConfig.getRefactoringId()%>",
+ "<%=refactoringConfig.getNamespacePrefix()%>",
+ new File(".").getCanonicalPath(),
+ new EmfRefactoring(null, "", "<%=refactoringConfig.getNamespaceUri()%>", new RefactoringGuiHandler(), new RefactoringController()));
+ register(<%=refactoringConfig.getMetaModelName()%>Package.eINSTANCE);
+ register(HenshinPackage.eINSTANCE);
+ Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put("henshin", new XMIResourceFactoryImpl());
+ this.number = number;
+ }
+
+ @Parameters
+ public static Collection<Object[]> data() {
+ List<String> testNumbers = getTestNumbers();
+ Object[][] data = new Object[testNumbers.size()][1];
+ for (int i = 0; i < testNumbers.size(); i++) {
+ data[i][0] = testNumbers.get(i);
+ }
+ return Arrays.asList(data);
+ }
+
+ private static List<String> getTestNumbers() {
+ List<String> numbers = new ArrayList<String>();
+ try {
+ String pathPrefix = new File(".").getCanonicalPath() + "/tests/" + "<%=refactoringConfig.getRefactoringId()%>";
+ File testCaseDir = new File(pathPrefix,"/");
+ FilenameFilter filter = new FilenameFilter() {
+ public boolean accept(File dir, String name) {
+ return name.startsWith("test_");
+ }
+ };
+ String[] children = testCaseDir.list(filter);
+ if (children != null) {
+ for (String child : children) {
+ numbers.add(
+ child.substring(
+ child.indexOf('_') + 1));
+ }
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ return numbers;
+ }
+
+ /**
+ * Runs the test.
+ */
+ @Test
+ public void test(){
+ System.out.println("running test test_" + number);
+ executeTestCase(number);
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.emf.refactor.refactoring.henshin/templates/RefactoringWizardHenshin.javajet b/org.eclipse.emf.refactor.refactoring.henshin/templates/RefactoringWizardHenshin.javajet
new file mode 100644
index 0000000..a00bfba
--- /dev/null
+++ b/org.eclipse.emf.refactor.refactoring.henshin/templates/RefactoringWizardHenshin.javajet
@@ -0,0 +1,43 @@
+<%@ jet package="org.eclipse.emf.refactor" class="RefactoringWizard"
+imports="org.eclipse.emf.refactor.henshin.generator.*"%>
+<%RefactoringConfigHenshin refactoringConfig = (RefactoringConfigHenshin) argument; %>
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: RefactoringWizardHenshin.javajet,v 1.1 2012/11/26 11:49:12 tarendt Exp $
+ */
+ package <%=refactoringConfig.getPackageName()%>;
+
+import org.eclipse.emf.refactor.common.core.IController;
+import org.eclipse.emf.refactor.runtime.ltk.ui.AbstractRefactoringWizard;
+
+/**
+ * Class used for providing an implementation of an LTK
+ * RefactoringWizard in EMF Refactor.
+ * @generated
+ */
+public class RefactoringWizard
+ extends AbstractRefactoringWizard {
+
+ /**
+ * Default constructor implementation.
+ * @param controller Controller of the EMF model refactoring.
+ * @generated
+ */
+ public RefactoringWizard(IController controller) {
+ super(controller);
+ }
+
+ /**
+ * @see org.eclipse.ltk.ui.refactoring.RefactoringWizard#
+ * addUserInputPages()
+ * @generated
+ */
+ @Override
+ protected void addUserInputPages() {
+ addPage(new RefactoringWizardPage
+ (controller.getParent().getName(), (RefactoringController)controller));
+ }
+
+} \ No newline at end of file
diff --git a/org.eclipse.emf.refactor.refactoring.henshin/templates/RefactoringWizardPageHenshin.javajet b/org.eclipse.emf.refactor.refactoring.henshin/templates/RefactoringWizardPageHenshin.javajet
new file mode 100644
index 0000000..0a42d1c
--- /dev/null
+++ b/org.eclipse.emf.refactor.refactoring.henshin/templates/RefactoringWizardPageHenshin.javajet
@@ -0,0 +1,124 @@
+<%@ jet package="org.eclipse.emf.refactor" class="RefactoringWizardPage"
+imports="org.eclipse.emf.refactor.generator.* org.eclipse.emf.refactor.henshin.generator.*"%>
+<%RefactoringConfigHenshin refactoringConfig = (RefactoringConfigHenshin) argument; %>
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: RefactoringWizardPageHenshin.javajet,v 1.1 2012/11/26 11:49:12 tarendt Exp $
+ */
+ package <%=refactoringConfig.getPackageName()%>;
+
+import org.eclipse.ltk.ui.refactoring.UserInputWizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * Class for setting model refactoring specific parameters
+ * by the user.
+ * @generated
+ */
+public class RefactoringWizardPage extends
+ UserInputWizardPage implements Listener {
+
+ /**
+ * Controller of the EMF model refactoring.
+ * @generated
+ */
+ private final RefactoringController controller;
+
+<% for (ParameterConfig pc : refactoringConfig.getParameters()) { %>
+ /**
+ * Label for each parameter.
+ * @generated
+ */
+ private Label <%=pc.getName()%>Label;
+
+ /**
+ * TextField for each parameter.
+ * @generated
+ */
+ private Text <%=pc.getName()%>Widget;
+<% } %>
+
+ /**
+ * Default constructor using a name and the controller of the
+ * EMF model refactoring.
+ * @param name Name of the WizardPage.
+ * @param controller Controller of the EMF model refactoring.
+ * @generated
+ */
+ public RefactoringWizardPage
+ (String name, RefactoringController controller) {
+ super(name);
+ this.controller = controller;
+ }
+
+ /**
+ * @see org.eclipse.swt.widgets.Listener#
+ * handleEvent(org.eclipse.swt.widgets.Event)
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void handleEvent(Event event) {
+ getWizard().getContainer().updateButtons();
+
+<% for (ParameterConfig pc : refactoringConfig.getParameters()) { %>
+ if (<%=pc.getName()%>Widget != null) {
+ String <%=pc.getName()%> = <%=pc.getName()%>Widget.getText();
+ if (!<%=pc.getName()%>.isEmpty()){
+ ((RefactoringDataManagement)
+ this.controller.getDataManagementObject()).
+ getInPortByName("<%=pc.getName()%>").
+ setValue(<%=pc.getName()%>);
+ } else {
+ ((RefactoringDataManagement)
+ this.controller.getDataManagementObject()).
+ getInPortByName("<%=pc.getName()%>").
+ setValue("unspecified");
+ }
+ }
+<% } %>
+
+ }
+
+ /**
+ * @see org.eclipse.jface.dialogs.IDialogPage#
+ * createControl(org.eclipse.swt.widgets.Composite)
+ * @generated
+ */
+ @Override
+ public void createControl(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout gl = new GridLayout();
+ gl.numColumns = 2;
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ composite.setLayout(gl);
+
+<% for (ParameterConfig pc : refactoringConfig.getParameters()) { %>
+
+ <%=pc.getName()%>Label = new Label(composite, SWT.NONE);
+ <%=pc.getName()%>Label.setText("<%=pc.getDescription()%>: ");
+ <%=pc.getName()%>Label.setEnabled(true);
+
+ <%=pc.getName()%>Widget = new Text(composite, SWT.BORDER);
+ <%=pc.getName()%>Widget.setToolTipText
+ ("value of variable '<%=pc.getName()%>'");
+ <%=pc.getName()%>Widget.setEnabled(true);
+ <%=pc.getName()%>Widget.setLayoutData(gd);
+ <%=pc.getName()%>Widget.addListener(SWT.Modify, this);
+
+<% } %>
+
+ setControl(composite);
+ }
+
+}
+ \ No newline at end of file

Back to the top