Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortarendt2012-11-28 09:00:49 -0500
committertarendt2012-11-28 09:00:49 -0500
commitf4dfbd6cfe5f74886fcd236c8ae29f43e1b8944e (patch)
treeda85186d1ff9ae40c09c9c0c773cd6ee5fb6de66
parent4fe9bad993080618b5d2adfd51f4b75b82dbb1b1 (diff)
downloadorg.eclipse.emf.refactor.refactoring-f4dfbd6cfe5f74886fcd236c8ae29f43e1b8944e.tar.gz
org.eclipse.emf.refactor.refactoring-f4dfbd6cfe5f74886fcd236c8ae29f43e1b8944e.tar.xz
org.eclipse.emf.refactor.refactoring-f4dfbd6cfe5f74886fcd236c8ae29f43e1b8944e.zip
bugs fixed
-rw-r--r--org.eclipse.emf.refactor.refactoring.henshin/src/org/eclipse/emf/refactor/refactoring/henshin/ui/NewRefactoringWizardHenshin.java7
-rw-r--r--org.eclipse.emf.refactor.refactoring.henshin/src/org/eclipse/emf/refactor/refactoring/henshin/ui/ParameterWizardPage.java20
2 files changed, 24 insertions, 3 deletions
diff --git a/org.eclipse.emf.refactor.refactoring.henshin/src/org/eclipse/emf/refactor/refactoring/henshin/ui/NewRefactoringWizardHenshin.java b/org.eclipse.emf.refactor.refactoring.henshin/src/org/eclipse/emf/refactor/refactoring/henshin/ui/NewRefactoringWizardHenshin.java
index 7c20069..79d5901 100644
--- a/org.eclipse.emf.refactor.refactoring.henshin/src/org/eclipse/emf/refactor/refactoring/henshin/ui/NewRefactoringWizardHenshin.java
+++ b/org.eclipse.emf.refactor.refactoring.henshin/src/org/eclipse/emf/refactor/refactoring/henshin/ui/NewRefactoringWizardHenshin.java
@@ -72,6 +72,10 @@ public class NewRefactoringWizardHenshin extends Wizard implements INewWizard, I
this.className = contextType;
}
+ public String getNamespaceUri() {
+ return namespaceUri;
+ }
+
@Override
public void init(IWorkbench workbench, IStructuredSelection selection) {
initProjects();
@@ -122,7 +126,8 @@ public class NewRefactoringWizardHenshin extends Wizard implements INewWizard, I
@Override
public boolean canFinish() {
return (basicWizardPage.isPageComplete()
- && transformationWizardPage.isPageComplete());
+ && transformationWizardPage.isPageComplete()
+ && parameterWizardPage.isPageComplete());
}
@Override
diff --git a/org.eclipse.emf.refactor.refactoring.henshin/src/org/eclipse/emf/refactor/refactoring/henshin/ui/ParameterWizardPage.java b/org.eclipse.emf.refactor.refactoring.henshin/src/org/eclipse/emf/refactor/refactoring/henshin/ui/ParameterWizardPage.java
index a69d15a..ee8e0a3 100644
--- a/org.eclipse.emf.refactor.refactoring.henshin/src/org/eclipse/emf/refactor/refactoring/henshin/ui/ParameterWizardPage.java
+++ b/org.eclipse.emf.refactor.refactoring.henshin/src/org/eclipse/emf/refactor/refactoring/henshin/ui/ParameterWizardPage.java
@@ -15,6 +15,8 @@ import java.util.List;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.henshin.model.Module;
import org.eclipse.emf.henshin.model.Parameter;
import org.eclipse.emf.henshin.model.Unit;
@@ -251,8 +253,22 @@ public class ParameterWizardPage extends WizardPage implements Listener {
private void checkIsPageComplete() {
setTransformationSystem();
if (this.module == null){
- setMessage("Cannot load henshin transformation system.",
- SWT.ERROR);
+ setMessage("Cannot load henshin module.", SWT.ERROR);
+ setPageComplete(false);
+ return;
+ }
+ EList<EPackage> imports = this.module.getImports();
+ String nsUri = ((NewRefactoringWizardHenshin) getWizard()).getNamespaceUri();
+ boolean hasImport = false;
+ for (EPackage ePackage : imports) {
+ if (ePackage.getNsURI().equals(nsUri)) {
+ hasImport = true;
+ break;
+ }
+ }
+ if (! hasImport) {
+ setMessage("The henshin module does not import model '"
+ + nsUri + "'.", SWT.ERROR);
setPageComplete(false);
return;
}

Back to the top