Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortarendt2012-11-22 13:31:23 +0000
committertarendt2012-11-22 13:31:23 +0000
commit0b55defe72f6e30ebeaa25de8450b6189fea4a95 (patch)
treea188c7e8ddc7f8ebe997a381a6655966a70fe4aa /org.eclipse.emf.refactor.refactoring.henshin
parent82b0ccb76eb46d6147b3c36979a87a9fcec4289e (diff)
downloadorg.eclipse.emf.refactor.refactoring-0b55defe72f6e30ebeaa25de8450b6189fea4a95.tar.gz
org.eclipse.emf.refactor.refactoring-0b55defe72f6e30ebeaa25de8450b6189fea4a95.tar.xz
org.eclipse.emf.refactor.refactoring-0b55defe72f6e30ebeaa25de8450b6189fea4a95.zip
class HenshinRefactoringInfo added
Diffstat (limited to 'org.eclipse.emf.refactor.refactoring.henshin')
-rw-r--r--org.eclipse.emf.refactor.refactoring.henshin/META-INF/MANIFEST.MF3
-rw-r--r--org.eclipse.emf.refactor.refactoring.henshin/src/org/eclipse/emf/refactor/refactoring/henshin/core/HenshinRefactoringInfo.java125
2 files changed, 127 insertions, 1 deletions
diff --git a/org.eclipse.emf.refactor.refactoring.henshin/META-INF/MANIFEST.MF b/org.eclipse.emf.refactor.refactoring.henshin/META-INF/MANIFEST.MF
index ecf780e..88f3160 100644
--- a/org.eclipse.emf.refactor.refactoring.henshin/META-INF/MANIFEST.MF
+++ b/org.eclipse.emf.refactor.refactoring.henshin/META-INF/MANIFEST.MF
@@ -6,6 +6,7 @@ Bundle-Version: 0.7.0.qualifier
Bundle-Activator: org.eclipse.emf.refactor.refactoring.henshin.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
- org.eclipse.emf.refactor.refactoring;bundle-version="0.7.0"
+ org.eclipse.emf.refactor.refactoring;bundle-version="0.7.0",
+ org.eclipse.emf.refactor.refactoring.generator;bundle-version="0.7.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
diff --git a/org.eclipse.emf.refactor.refactoring.henshin/src/org/eclipse/emf/refactor/refactoring/henshin/core/HenshinRefactoringInfo.java b/org.eclipse.emf.refactor.refactoring.henshin/src/org/eclipse/emf/refactor/refactoring/henshin/core/HenshinRefactoringInfo.java
new file mode 100644
index 0000000..95a0411
--- /dev/null
+++ b/org.eclipse.emf.refactor.refactoring.henshin/src/org/eclipse/emf/refactor/refactoring/henshin/core/HenshinRefactoringInfo.java
@@ -0,0 +1,125 @@
+package org.eclipse.emf.refactor.refactoring.henshin.core;
+
+import org.eclipse.emf.refactor.refactoring.generator.core.RefactoringInfo;
+
+public class HenshinRefactoringInfo extends RefactoringInfo {
+
+ public static final String TRAFODIR = "/transformation/";
+ private final String TRANSFORMATIONDIRECTORY = "transformation/";
+ private final String HENSHINEXTENSION = ".henshin";
+
+ /**
+ * Name of the Henshin file used for the initial checking
+ * of the EMF model refactoring.
+ */
+ private String checkInitialFileName;
+
+ /**
+ * Name of the Henshin file used for the final checking
+ * of the EMF model refactoring.
+ */
+ private String checkFinalFileName;
+
+ /**
+ * Name of the Henshin file used for executing the EMF model
+ * refactoring.
+ */
+ private String createChangeFileName;
+
+ /**
+ * Constructor used for the new model refactoring to be generated.
+ * @param projectName Name of the project the model refactoring code
+ * has to be generated to.
+ * @param refactoringId Id of the model refactoring that has to be
+ * generated.
+ * @param menuLabel The label that shall appear before applying the
+ * model refactoring.
+ * @param namespaceURI Namespace of the models the model refactoring
+ * has to be generated for.
+ * @param createChangeFileName Name of the Henshin file used for
+ * executing the EMF model refactoring.
+ */
+ public HenshinRefactoringInfo(String projectName, String refactoringId,
+ String menuLabel, String namespaceURI, String createChangeFileName,
+ String namespacePrefix, int numberOfTests) {
+ super(projectName, refactoringId, menuLabel,
+ namespaceURI, namespacePrefix, numberOfTests);
+ this.createChangeFileName =
+ createChangeFileName.replaceAll(HENSHINEXTENSION, "");
+ this.checkInitialFileName = "";
+ this.checkFinalFileName = "";
+ }
+
+ /**
+ * Gets the name of the Henshin file used for the initial checking
+ * of the EMF model refactoring.
+ * @return Name of the Henshin file used for the initial checking
+ * of the EMF model refactoring.
+ */
+ public String getCheckInitialFileName() {
+ return checkInitialFileName;
+ }
+
+ /**
+ * Sets the name of the Henshin file used for the initial checking
+ * of the EMF model refactoring.
+ * @param checkInitialFileName Name of the Henshin file used for the
+ * initial checking of the EMF model refactoring.
+ */
+ public void setCheckInitialFileName(String checkInitialFileName) {
+ this.checkInitialFileName =
+ checkInitialFileName.replaceAll(HENSHINEXTENSION, "");
+ }
+
+ /**
+ * Gets the name of the Henshin file used for the final checking
+ * of the EMF model refactoring.
+ * @return Name of the Henshin file used for the final checking
+ * of the EMF model refactoring.
+ */
+ public String getCheckFinalFileName() {
+ return checkFinalFileName;
+ }
+
+ /**
+ * Sets the name of the Henshin file used for the final checking
+ * of the EMF model refactoring.
+ * @param checkFinalFileName Name of the Henshin file used for the final
+ * checking of the EMF model refactoring.
+ */
+ public void setCheckFinalFileName(String checkFinalFileName) {
+ this.checkFinalFileName =
+ checkFinalFileName.replaceAll(HENSHINEXTENSION, "");
+ }
+
+ /**
+ * Gets the name of the Henshin file used for executing the EMF model
+ * refactoring.
+ * @return Name of the Henshin file used for executing the EMF model
+ * refactoring.
+ */
+ public String getCreateChangeFileName() {
+ return createChangeFileName;
+ }
+
+ /**
+ * Returns the root package name to generate the code in. This is the name
+ * of the project in lower case letters.
+ * @return Package name to generate the code in. This is the name
+ * of the project in lower case letters.
+ */
+ public String getRootPackageName(){
+ return this.projectName.toLowerCase();
+ }
+
+ /**
+ * Return the name of the transformations directory inside the plugin
+ * project.
+ * @return Name of the transformations directory inside the plugin
+ * project.
+ */
+ public String getTransformationDirectory(){
+ return TRANSFORMATIONDIRECTORY;
+ }
+
+}

Back to the top