Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Faltermeier2015-04-02 10:58:15 +0000
committerJohannes Faltermeier2015-04-02 10:58:15 +0000
commit900c1f66f51d5a6aaf07ed6e9d6bc690cbb6adf0 (patch)
tree67a080e8d073be9864095816b0660a42681cffc2
parent28586dbe8e6730868ac0e2fd38d1be81e64a901d (diff)
downloadorg.eclipse.emf.edapt-900c1f66f51d5a6aaf07ed6e9d6bc690cbb6adf0.tar.gz
org.eclipse.emf.edapt-900c1f66f51d5a6aaf07ed6e9d6bc690cbb6adf0.tar.xz
org.eclipse.emf.edapt-900c1f66f51d5a6aaf07ed6e9d6bc690cbb6adf0.zip
Bug 458817 - Avoid unnecessary increase of version numbers when dealing with metamodel references
https://bugs.eclipse.org/bugs/show_bug.cgi?id=458817
-rw-r--r--plugins/org.eclipse.emf.edapt.history.editor/src/org/eclipse/emf/edapt/history/instantiation/ui/ReleaseWizard.java30
-rw-r--r--plugins/org.eclipse.emf.edapt.history.editor/src/org/eclipse/emf/edapt/history/instantiation/ui/ReleaseWizardPage.java8
2 files changed, 38 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.edapt.history.editor/src/org/eclipse/emf/edapt/history/instantiation/ui/ReleaseWizard.java b/plugins/org.eclipse.emf.edapt.history.editor/src/org/eclipse/emf/edapt/history/instantiation/ui/ReleaseWizard.java
index 936e665..dc66a07 100644
--- a/plugins/org.eclipse.emf.edapt.history.editor/src/org/eclipse/emf/edapt/history/instantiation/ui/ReleaseWizard.java
+++ b/plugins/org.eclipse.emf.edapt.history.editor/src/org/eclipse/emf/edapt/history/instantiation/ui/ReleaseWizard.java
@@ -17,6 +17,7 @@ import java.util.Map;
import java.util.Map.Entry;
import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.Wizard;
/**
@@ -33,6 +34,12 @@ public class ReleaseWizard extends Wizard {
private final Map<EPackage, String> sourceMap = new LinkedHashMap<EPackage, String>();
private final Map<EPackage, String> targetMap = new LinkedHashMap<EPackage, String>();
+ /**
+ * This map holds values entered by the user for the given key. Used to set a default string in a target textbox by
+ * default.
+ */
+ private final Map<String, String> sourceToTargetMap = new LinkedHashMap<String, String>();
+
private final List<EPackage> rootPackages;
public ReleaseWizard(List<EPackage> rootPackages) {
@@ -110,6 +117,29 @@ public class ReleaseWizard extends Wizard {
/**
* {@inheritDoc}
*
+ * @see org.eclipse.jface.wizard.Wizard#getNextPage(org.eclipse.jface.wizard.IWizardPage)
+ */
+ @Override
+ public IWizardPage getNextPage(IWizardPage page) {
+ final ReleaseWizardPage next = ReleaseWizardPage.class.cast(super.getNextPage(page));
+ if (next == null) {
+ return next;
+ }
+ final ReleaseWizardPage current = ReleaseWizardPage.class.cast(page);
+ if (!current.isUpdate()) {
+ return next;
+ }
+ sourceToTargetMap.put(current.getSource(), current.getTarget());
+ if (!sourceToTargetMap.containsKey(next.getSource())) {
+ return next;
+ }
+ next.setTarget(sourceToTargetMap.get(next.getSource()));
+ return next;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
* @see org.eclipse.jface.wizard.Wizard#performFinish()
*/
@Override
diff --git a/plugins/org.eclipse.emf.edapt.history.editor/src/org/eclipse/emf/edapt/history/instantiation/ui/ReleaseWizardPage.java b/plugins/org.eclipse.emf.edapt.history.editor/src/org/eclipse/emf/edapt/history/instantiation/ui/ReleaseWizardPage.java
index a0322d5..d6715ca 100644
--- a/plugins/org.eclipse.emf.edapt.history.editor/src/org/eclipse/emf/edapt/history/instantiation/ui/ReleaseWizardPage.java
+++ b/plugins/org.eclipse.emf.edapt.history.editor/src/org/eclipse/emf/edapt/history/instantiation/ui/ReleaseWizardPage.java
@@ -187,4 +187,12 @@ public class ReleaseWizardPage extends WizardPage {
}
}
+ /**
+ * Allows to set the target text that is visible.
+ */
+ public void setTarget(String target) {
+ targetText.setText(target);
+ checkIfPageComplete();
+ }
+
}

Back to the top