Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortarendt2012-11-22 09:04:10 -0500
committertarendt2012-11-22 09:04:10 -0500
commitc2a057199734bb6d49994b09e01198d6dcca23f8 (patch)
treecabcb7143e70034793f5a424f36b45569919ff1c
parent93db73d34c6b9dd2e182c8f8d34bd7b255bffa4f (diff)
downloadorg.eclipse.emf.refactor.refactoring-c2a057199734bb6d49994b09e01198d6dcca23f8.tar.gz
org.eclipse.emf.refactor.refactoring-c2a057199734bb6d49994b09e01198d6dcca23f8.tar.xz
org.eclipse.emf.refactor.refactoring-c2a057199734bb6d49994b09e01198d6dcca23f8.zip
class HenshinLtkEmfRefactoringProcessorAdapter and dependencies added
-rw-r--r--org.eclipse.emf.refactor.refactoring.henshin/META-INF/MANIFEST.MF4
-rw-r--r--org.eclipse.emf.refactor.refactoring.henshin/src/org/eclipse/emf/refactor/refactoring/henshin/runtime/HenshinLtkEmfRefactoringProcessorAdapter.java94
2 files changed, 97 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 4e32df7..a71c687 100644
--- a/org.eclipse.emf.refactor.refactoring.henshin/META-INF/MANIFEST.MF
+++ b/org.eclipse.emf.refactor.refactoring.henshin/META-INF/MANIFEST.MF
@@ -9,6 +9,8 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.emf.refactor.refactoring;bundle-version="0.7.0",
org.eclipse.emf.refactor.refactoring.generator;bundle-version="0.7.0",
org.eclipse.emf.refactor.refactoring.runtime;bundle-version="0.7.0",
- org.eclipse.emf.henshin.interpreter;bundle-version="0.9.4"
+ org.eclipse.emf.henshin.interpreter;bundle-version="0.9.4",
+ org.eclipse.ltk.core.refactoring;bundle-version="3.6.0",
+ org.eclipse.emf.edit;bundle-version="2.8.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/runtime/HenshinLtkEmfRefactoringProcessorAdapter.java b/org.eclipse.emf.refactor.refactoring.henshin/src/org/eclipse/emf/refactor/refactoring/henshin/runtime/HenshinLtkEmfRefactoringProcessorAdapter.java
new file mode 100644
index 0000000..0229877
--- /dev/null
+++ b/org.eclipse.emf.refactor.refactoring.henshin/src/org/eclipse/emf/refactor/refactoring/henshin/runtime/HenshinLtkEmfRefactoringProcessorAdapter.java
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) Philipps University of Marburg. 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:
+ * Philipps University of Marburg - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.refactor.refactoring.henshin.runtime;
+
+import java.util.List;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.refactor.refactoring.core.Refactoring;
+import org.eclipse.emf.refactor.refactoring.henshin.interfaces.IHenshinDataManagement;
+import org.eclipse.emf.refactor.refactoring.runtime.ltk.LtkEmfRefactoringProcessorAdapter;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+
+/**
+ * Adapter class of a LTK RefactoringProcessor used for
+ * EMF model refactorings using Henshin transformations.
+ * @generated NOT
+ * @author Thorsten Arendt
+ */
+public abstract class HenshinLtkEmfRefactoringProcessorAdapter extends
+ LtkEmfRefactoringProcessorAdapter {
+
+ /**
+ * Corresponding EMF model refactoring.
+ */
+ private Refactoring refactoring;
+
+ /**
+ * Default constructor using the corresponding EMF model
+ * refactoring, a selection objects the model refactoring
+ * shall be executed on, and a Runnable that executes the model
+ * refactoring.
+ * @param refactoring Corresponding EMF model refactoring.
+ * @param selection Given selection objects the model refactoring
+ * shall be executed on.
+ * @param refactoringAction Runnable that executes the model refactoring.
+ */
+ public HenshinLtkEmfRefactoringProcessorAdapter(Refactoring refactoring,
+ List<EObject> selection, Runnable refactoringAction) {
+ super(refactoring, selection, refactoringAction);
+ this.refactoring = refactoring;
+ }
+
+ /**
+ *
+ * @param c
+ * @return
+ */
+ private RefactoringStatus doCheck(CheckConditionsCommand c) {
+ this.editingDomain.getCommandStack().execute(c);
+ RefactoringStatus result = new RefactoringStatus();
+ for(String s:c.getMessages()){
+ result.addFatalError(s);
+ }
+ return result;
+ }
+
+ /**
+ * @see org.eclipse.emf.refactor.runtime.ltk.
+ * LtkEmfRefactoringProcessorAdapter#
+ * checkFinalConditions(org.eclipse.core.runtime.IProgressMonitor,
+ * org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
+ */
+ @Override
+ public RefactoringStatus checkFinalConditions() {
+ return doCheck(new CheckConditionsCommand(
+ ((IHenshinDataManagement)this.refactoring.getController()
+ .getDataManagementObject())
+ .getFinalConditionsHenshinInformation(),
+ this.root));
+ }
+
+ /**
+ * @see org.eclipse.emf.refactor.runtime.ltk.
+ * LtkEmfRefactoringProcessorAdapter#
+ * checkInitialConditions(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public RefactoringStatus checkInitialConditions() {
+ return doCheck(new CheckConditionsCommand(
+ ((IHenshinDataManagement)this.refactoring.getController()
+ .getDataManagementObject())
+ .getInitialConditionsHenshinInformation(),
+ this.root));
+ }
+
+}

Back to the top