Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcletavernie2013-05-31 07:42:24 -0400
committercletavernie2013-05-31 07:42:24 -0400
commit0d9fab3507fc12e53f6aac95652ee637e43059f1 (patch)
tree4dac36511bd5e613d80114624d6d58a0d1cb2d1d
parent186e434e304e7a5ca338874eaa532b267ec2518a (diff)
downloadorg.eclipse.papyrus-0d9fab3507fc12e53f6aac95652ee637e43059f1.tar.gz
org.eclipse.papyrus-0d9fab3507fc12e53f6aac95652ee637e43059f1.tar.xz
org.eclipse.papyrus-0d9fab3507fc12e53f6aac95652ee637e43059f1.zip
335332: [Property View] Papyrus shall provide an extensible property view runtime
https://bugs.eclipse.org/bugs/show_bug.cgi?id=335332 Improve robustness of the generation wizard
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/CreateContextWizard.java16
1 files changed, 13 insertions, 3 deletions
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/CreateContextWizard.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/CreateContextWizard.java
index a892b2db7c0..09f93767ded 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/CreateContextWizard.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/CreateContextWizard.java
@@ -14,13 +14,15 @@ package org.eclipse.papyrus.customization.properties.generation.wizard;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.Collection;
-import java.util.Collections;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.xmi.XMIResource;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
@@ -154,6 +156,10 @@ public class CreateContextWizard extends Wizard implements INewWizard {
try {
setNeedsProgressMonitor(true);
final Context currentContext = context;
+
+ final Map<String, Object> saveOptions = new HashMap<String, Object>();
+ saveOptions.put(XMIResource.OPTION_PROCESS_DANGLING_HREF, XMIResource.OPTION_PROCESS_DANGLING_HREF_RECORD);
+
getContainer().run(true, true, new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
@@ -161,7 +167,7 @@ public class CreateContextWizard extends Wizard implements INewWizard {
monitor.worked(1);
try {
- currentContext.eResource().save(Collections.EMPTY_MAP);
+ currentContext.eResource().save(saveOptions);
monitor.worked(1);
for(Tab tab : currentContext.getTabs()) {
@@ -169,7 +175,7 @@ public class CreateContextWizard extends Wizard implements INewWizard {
if(monitor.isCanceled()) {
return;
}
- section.getWidget().eResource().save(Collections.EMPTY_MAP);
+ section.getWidget().eResource().save(saveOptions);
monitor.worked(1);
}
}
@@ -234,6 +240,10 @@ public class CreateContextWizard extends Wizard implements INewWizard {
currentElement = findByName(currentElement, name);
}
+ if(currentElement == null) {
+ return null;
+ }
+
for(PropertyDefinition definition : currentElement.getProperties()) {
if(definition.getName().equals(property.getName())) {
return definition;

Back to the top