diff options
author | Christian W. Damus | 2013-02-06 14:50:23 +0000 |
---|---|---|
committer | Christian W. Damus | 2013-02-14 03:09:27 +0000 |
commit | 750741efc76f41ac099f1bdfde31a522180ceca7 (patch) | |
tree | 0663147c898702d32ab00d560c56295a2c2c49fe | |
parent | c57bf7e84145be55a5e4c54ed06c93203d5bf22a (diff) | |
download | cdo-750741efc76f41ac099f1bdfde31a522180ceca7.tar.gz cdo-750741efc76f41ac099f1bdfde31a522180ceca7.tar.xz cdo-750741efc76f41ac099f1bdfde31a522180ceca7.zip |
[399933] Ecore model wizard crashdrops/I20130215-0410
https://bugs.eclipse.org/bugs/show_bug.cgi?id=399933
6 files changed, 117 insertions, 87 deletions
diff --git a/plugins/org.eclipse.emf.cdo.dawn.codegen.dawngenmodel.emf/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.dawn.codegen.dawngenmodel.emf/META-INF/MANIFEST.MF index 90ea67793f..5e8c46e8ee 100644 --- a/plugins/org.eclipse.emf.cdo.dawn.codegen.dawngenmodel.emf/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.emf.cdo.dawn.codegen.dawngenmodel.emf/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.emf.cdo.dawn.codegen.dawngenmodel.emf;singleton:=true -Bundle-Version: 1.0.0.qualifier +Bundle-Version: 1.0.100.qualifier Bundle-ClassPath: . Bundle-Vendor: %providerName Bundle-Localization: plugin @@ -17,10 +17,10 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)", org.eclipse.xpand;bundle-version="[1.1.0,2.0.0)", org.eclipse.xtend;bundle-version="[1.1.0,2.0.0)" Bundle-ActivationPolicy: lazy -Export-Package: org.eclipse.emf.cdo.dawn.codegen.dawngenmodel.emf;version="1.0.0", - org.eclipse.emf.cdo.dawn.codegen.dawngenmodel.emf.dawnEmfGenmodel;version="1.0.0", - org.eclipse.emf.cdo.dawn.codegen.dawngenmodel.emf.dawnEmfGenmodel.impl;version="1.0.0", - org.eclipse.emf.cdo.dawn.codegen.dawngenmodel.emf.dawnEmfGenmodel.util;version="1.0.0", - org.eclipse.emf.cdo.dawn.codegen.dawngenmodel.emf.util;version="1.0.0", - templates;version="1.0.0", - workflow;version="1.0.0" +Export-Package: org.eclipse.emf.cdo.dawn.codegen.dawngenmodel.emf;version="1.0.100", + org.eclipse.emf.cdo.dawn.codegen.dawngenmodel.emf.dawnEmfGenmodel;version="1.0.100", + org.eclipse.emf.cdo.dawn.codegen.dawngenmodel.emf.dawnEmfGenmodel.impl;version="1.0.100", + org.eclipse.emf.cdo.dawn.codegen.dawngenmodel.emf.dawnEmfGenmodel.util;version="1.0.100", + org.eclipse.emf.cdo.dawn.codegen.dawngenmodel.emf.util;version="1.0.100", + templates;version="1.0.100", + workflow;version="1.0.100" diff --git a/plugins/org.eclipse.emf.cdo.dawn.codegen.dawngenmodel.emf/src/templates/EMFFragmentTemplate.xpt b/plugins/org.eclipse.emf.cdo.dawn.codegen.dawngenmodel.emf/src/templates/EMFFragmentTemplate.xpt index e88b13f78f..88989c23e6 100644 --- a/plugins/org.eclipse.emf.cdo.dawn.codegen.dawngenmodel.emf/src/templates/EMFFragmentTemplate.xpt +++ b/plugins/org.eclipse.emf.cdo.dawn.codegen.dawngenmodel.emf/src/templates/EMFFragmentTemplate.xpt @@ -1,4 +1,4 @@ -«REM» +«REM» Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 @@ -7,35 +7,37 @@ Contributors: Martin Fluegge - initial API and implementation + Christian W. Damus (CEA) - bug 399933 NPE in editor when finishing Ecore wizard + -«ENDREM» +«ENDREM» -«IMPORT emf» -«IMPORT genmodel» -«IMPORT ecore» -«IMPORT dawngenmodel» -«IMPORT dawnEmfGenmodel» +«IMPORT emf» +«IMPORT genmodel» +«IMPORT ecore» +«IMPORT dawngenmodel» +«IMPORT dawnEmfGenmodel» -«EXTENSION org::eclipse::emf::cdo::dawn::codegen::util::Utils» +«EXTENSION org::eclipse::emf::cdo::dawn::codegen::util::Utils» -«DEFINE main FOR DawnEMFGenerator» +«DEFINE main FOR DawnEMFGenerator» - «setDiagramPackage(this.emfGenModel.modelPluginID)» + «setDiagramPackage(this.emfGenModel.modelPluginID)» - «EXPAND dawnEditor FOR this» - «EXPAND dawnWizard FOR this» - «EXPAND fragmentXML FOR this» - «EXPAND manifestMF FOR this» - «EXPAND buildPROPERTIES FOR this» - «EXPAND classpath FOR this» -«ENDDEFINE» + «EXPAND dawnEditor FOR this» + «EXPAND dawnWizard FOR this» + «EXPAND fragmentXML FOR this» + «EXPAND manifestMF FOR this» + «EXPAND buildPROPERTIES FOR this» + «EXPAND classpath FOR this» +«ENDDEFINE» -«REM»############################################ Extended Editor ##################################################################«ENDREM» -«DEFINE dawnEditor FOR DawnEMFGenerator» -«FILE "src/"+getDiagramPackagePath()+"/presentation/"+this.dawnEditorClassName+".java"» -package «this.emfGenModel.modelPluginID».presentation; +«REM»############################################ Extended Editor ##################################################################«ENDREM» +«DEFINE dawnEditor FOR DawnEMFGenerator» +«FILE "src/"+getDiagramPackagePath()+"/presentation/"+this.dawnEditorClassName+".java"» +package «this.emfGenModel.modelPluginID».presentation; -import «this.emfGenModel.modelPluginID».presentation.«this.emfGenModel.modelName»Editor; +import «this.emfGenModel.modelPluginID».presentation.«this.emfGenModel.modelName»Editor; import org.eclipse.emf.cdo.dawn.editors.IDawnEditor; import org.eclipse.emf.cdo.dawn.editors.IDawnEditorSupport; @@ -57,13 +59,13 @@ import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.swt.widgets.Display; import org.eclipse.ui.IEditorInput; -public class «this.dawnEditorClassName» extends «this.emfGenModel.modelName»Editor implements IDawnEditor +public class «this.dawnEditorClassName» extends «this.emfGenModel.modelName»Editor implements IDawnEditor { private IDawnEditorSupport dawnEditorSupport; - public static String ID = "«this.emfGenModel.modelPluginID».presentation.«this.dawnEditorClassName»ID"; + public static String ID = "«this.emfGenModel.modelPluginID».presentation.«this.dawnEditorClassName»ID"; - public «this.dawnEditorClassName»() + public «this.dawnEditorClassName»() { super(); dawnEditorSupport = new DawnEMFEditorSupport(this); @@ -113,6 +115,11 @@ public class «this.dawnEditorClassName» extends «this.emfGenModel.modelName»Edit { super.createPages(); + if (!(getEditorInput() instanceof DawnEditorInput)) + { + return; + } + selectionViewer.setContentProvider(new DawnSelectionViewerAdapterFactoryContentProvider(adapterFactory, ((DawnEditorInput)getEditorInput()).getResource())); selectionViewer @@ -148,6 +155,10 @@ public class «this.dawnEditorClassName» extends «this.emfGenModel.modelName»Edit super.doSave(progressMonitor); } } + else + { + super.doSave(progressMonitor); + } } public String getContributorID() @@ -188,12 +199,12 @@ public class «this.dawnEditorClassName» extends «this.emfGenModel.modelName»Edit return dawnEditorSupport; } } -«ENDFILE» -«ENDDEFINE» -«REM»############################################ Extended Wizard ##################################################################«ENDREM» -«DEFINE dawnWizard FOR DawnEMFGenerator» -«FILE "src/"+getDiagramPackagePath()+"/presentation/"+"Dawn"+this.emfGenModel.modelName+"ModelWizard.java"» -package «this.emfGenModel.modelPluginID».presentation; +«ENDFILE» +«ENDDEFINE» +«REM»############################################ Extended Wizard ##################################################################«ENDREM» +«DEFINE dawnWizard FOR DawnEMFGenerator» +«FILE "src/"+getDiagramPackagePath()+"/presentation/"+"Dawn"+this.emfGenModel.modelName+"ModelWizard.java"» +package «this.emfGenModel.modelPluginID».presentation; import org.eclipse.emf.cdo.dawn.preferences.PreferenceConstants; import org.eclipse.emf.cdo.dawn.ui.DawnEditorInput; @@ -219,7 +230,7 @@ import org.eclipse.ui.actions.WorkspaceModifyOperation; import java.util.Collections; -public class Dawn«this.emfGenModel.modelName»ModelWizard extends «this.emfGenModel.modelName»ModelWizard implements INewWizard +public class Dawn«this.emfGenModel.modelName»ModelWizard extends «this.emfGenModel.modelName»ModelWizard implements INewWizard { private DawnCreateNewResourceWizardPage newResourceCreationPage; @@ -227,7 +238,7 @@ public class Dawn«this.emfGenModel.modelName»ModelWizard extends «this.emfGenMod private CDOResource resource; - public Dawn«this.emfGenModel.modelName»ModelWizard() + public Dawn«this.emfGenModel.modelName»ModelWizard() { super(); CDOConnectionUtil.instance.init(PreferenceConstants.getRepositoryName(), PreferenceConstants.getProtocol(), @@ -239,12 +250,12 @@ public class Dawn«this.emfGenModel.modelName»ModelWizard extends «this.emfGenMod @Override public void addPages() { - newResourceCreationPage = new DawnCreateNewResourceWizardPage("«getEMFFileName(this.emfGenModel.genPackages)»", true, view); + newResourceCreationPage = new DawnCreateNewResourceWizardPage("«getEMFFileName(this.emfGenModel.genPackages)»", true, view); addPage(newResourceCreationPage); - initialObjectCreationPage = new «this.emfGenModel.modelName»ModelWizardInitialObjectCreationPage("Whatever2"); - initialObjectCreationPage.setTitle(«this.emfGenModel.modelName»EditorPlugin.INSTANCE.getString("_UI_«this.emfGenModel.modelName»ModelWizard_label")); - initialObjectCreationPage.setDescription(«this.emfGenModel.modelName»EditorPlugin.INSTANCE + initialObjectCreationPage = new «this.emfGenModel.modelName»ModelWizardInitialObjectCreationPage("Whatever2"); + initialObjectCreationPage.setTitle(«this.emfGenModel.modelName»EditorPlugin.INSTANCE.getString("_UI_«this.emfGenModel.modelName»ModelWizard_label")); + initialObjectCreationPage.setDescription(«this.emfGenModel.modelName»EditorPlugin.INSTANCE .getString("_UI_Wizard_initial_object_description")); addPage(initialObjectCreationPage); } @@ -284,7 +295,7 @@ public class Dawn«this.emfGenModel.modelName»ModelWizard extends «this.emfGenMod } catch (Exception exception) { - «this.emfGenModel.modelName»EditorPlugin.INSTANCE.log(exception); + «this.emfGenModel.modelName»EditorPlugin.INSTANCE.log(exception); throw new RuntimeException(exception); } finally @@ -302,7 +313,7 @@ public class Dawn«this.emfGenModel.modelName»ModelWizard extends «this.emfGenMod } catch (Exception exception) { - «this.emfGenModel.modelName»EditorPlugin.INSTANCE.log(exception); + «this.emfGenModel.modelName»EditorPlugin.INSTANCE.log(exception); return false; } } @@ -314,85 +325,85 @@ public class Dawn«this.emfGenModel.modelName»ModelWizard extends «this.emfGenMod DawnEditorInput dawnEditorInput = new DawnEditorInput(uri); try { - page.openEditor(dawnEditorInput, «this.dawnEditorClassName».ID); + page.openEditor(dawnEditorInput, «this.dawnEditorClassName».ID); } catch (PartInitException exception) { MessageDialog.openError(workbenchWindow.getShell(), - «this.emfGenModel.modelName»EditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), exception.getMessage()); + «this.emfGenModel.modelName»EditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), exception.getMessage()); throw new RuntimeException(exception); } } } -«ENDFILE» -«ENDDEFINE» -«REM»########################################## fragment.xml ####################################################################«ENDREM» -«DEFINE fragmentXML FOR DawnEMFGenerator» -«FILE "fragment.xml"»<?xml version="1.0" encoding="UTF-8"?> +«ENDFILE» +«ENDDEFINE» +«REM»########################################## fragment.xml ####################################################################«ENDREM» +«DEFINE fragmentXML FOR DawnEMFGenerator» +«FILE "fragment.xml"»<?xml version="1.0" encoding="UTF-8"?> <?eclipse version="3.4"?> <fragment> <extension point="org.eclipse.ui.newWizards"> <wizard - id="«this.emfGenModel.modelPluginID».presentation.Dawn«this.emfGenModel.modelName»ModelWizardID" - name="Dawn «this.emfGenModel.modelName» Model" - class="«this.emfGenModel.modelPluginID».presentation.Dawn«this.emfGenModel.modelName»ModelWizard" + id="«this.emfGenModel.modelPluginID».presentation.Dawn«this.emfGenModel.modelName»ModelWizardID" + name="Dawn «this.emfGenModel.modelName» Model" + class="«this.emfGenModel.modelPluginID».presentation.Dawn«this.emfGenModel.modelName»ModelWizard" category="org.eclipse.emf.cdo.dawn.ui.category.examples" - icon="platform:/plugin/«this.emfGenModel.editPluginID»/icons/full/obj16/«this.emfGenModel.modelName»ModelFile.gif"> - <description>A Dawn editor for «this.emfGenModel.modelName» models</description> + icon="platform:/plugin/«this.emfGenModel.editPluginID»/icons/full/obj16/«this.emfGenModel.modelName»ModelFile.gif"> + <description>A Dawn editor for «this.emfGenModel.modelName» models</description> <selection class="org.eclipse.core.resources.IResource"/> </wizard> </extension> <extension point="org.eclipse.ui.editors"> <editor - id="«this.emfGenModel.modelPluginID».presentation.«this.dawnEditorClassName»ID" - name="Dawn «this.emfGenModel.modelName» model Editor" - icon="platform:/plugin/«this.emfGenModel.editPluginID»/icons/full/obj16/«this.emfGenModel.modelName»ModelFile.gif" - extensions="«getEMFFileName(this.emfGenModel.genPackages)»" - class="«this.emfGenModel.modelPluginID».presentation.«this.dawnEditorClassName»" - contributorClass="«this.emfGenModel.modelPluginID».presentation.«this.emfGenModel.modelName»ActionBarContributor"> + id="«this.emfGenModel.modelPluginID».presentation.«this.dawnEditorClassName»ID" + name="Dawn «this.emfGenModel.modelName» model Editor" + icon="platform:/plugin/«this.emfGenModel.editPluginID»/icons/full/obj16/«this.emfGenModel.modelName»ModelFile.gif" + extensions="«getEMFFileName(this.emfGenModel.genPackages)»" + class="«this.emfGenModel.modelPluginID».presentation.«this.dawnEditorClassName»" + contributorClass="«this.emfGenModel.modelPluginID».presentation.«this.emfGenModel.modelName»ActionBarContributor"> </editor> </extension> </fragment> -«ENDFILE» -«ENDDEFINE» -«REM»##############################################################################################################«ENDREM» -«DEFINE manifestMF FOR DawnEMFGenerator» -«FILE "META-INF/MANIFEST.MF"»Manifest-Version: 1.0 +«ENDFILE» +«ENDDEFINE» +«REM»##############################################################################################################«ENDREM» +«DEFINE manifestMF FOR DawnEMFGenerator» +«FILE "META-INF/MANIFEST.MF"»Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Dawn -Bundle-SymbolicName: «this.fragmentName»;singleton:=true +Bundle-SymbolicName: «this.fragmentName»;singleton:=true Bundle-Version: 1.0.0.qualifier -Fragment-Host: «this.emfGenModel.editorPluginID» +Fragment-Host: «this.emfGenModel.editorPluginID» Bundle-RequiredExecutionEnvironment: J2SE-1.5 Require-Bundle: org.eclipse.emf.cdo.dawn;bundle-version="[2.0.0,3.0.0)", org.eclipse.emf.cdo.dawn.ui;bundle-version="[2.0.0,3.0.0)", org.eclipse.emf.cdo.dawn.util;bundle-version="[2.0.0,3.0.0)", org.eclipse.emf.cdo.ui;bundle-version="[4.0.0,5.0.0)", org.eclipse.emf.cdo.dawn.emf;bundle-version="[2.0.0,3.0.0)" -«ENDFILE» -«ENDDEFINE» +«ENDFILE» +«ENDDEFINE» -«DEFINE buildPROPERTIES FOR DawnEMFGenerator» -«FILE "build.properties"»source.. = src/ +«DEFINE buildPROPERTIES FOR DawnEMFGenerator» +«FILE "build.properties"»source.. = src/ output.. = bin/ bin.includes = META-INF/,\ .,\ fragment.xml -«ENDFILE» -«ENDDEFINE» -«REM»################################### . classpath ###########################################################################«ENDREM» +«ENDFILE» +«ENDDEFINE» +«REM»################################### . classpath ###########################################################################«ENDREM» -«DEFINE classpath FOR DawnEMFGenerator» -«FILE ".classpath"»<?xml version="1.0" encoding="UTF-8"?> +«DEFINE classpath FOR DawnEMFGenerator» +«FILE ".classpath"»<?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="src" path="src"/> <classpathentry kind="output" path="bin"/> </classpath> -«ENDFILE» -«ENDDEFINE» +«ENDFILE» +«ENDDEFINE» diff --git a/plugins/org.eclipse.emf.cdo.dawn.ecore.editor.dawn/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.dawn.ecore.editor.dawn/META-INF/MANIFEST.MF index 4f21a9cb0e..5fe0631b9e 100644 --- a/plugins/org.eclipse.emf.cdo.dawn.ecore.editor.dawn/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.emf.cdo.dawn.ecore.editor.dawn/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.emf.cdo.dawn.ecore.editor.dawn;singleton:=true -Bundle-Version: 1.0.0.qualifier +Bundle-Version: 1.0.100.qualifier Fragment-Host: org.eclipse.emf.ecore.editor Bundle-RequiredExecutionEnvironment: J2SE-1.5 Require-Bundle: org.eclipse.emf.cdo.dawn;bundle-version="[2.0.0,3.0.0)", @@ -12,4 +12,4 @@ Require-Bundle: org.eclipse.emf.cdo.dawn;bundle-version="[2.0.0,3.0.0)", org.eclipse.emf.cdo.dawn.emf;bundle-version="[2.0.0,3.0.0)" Bundle-Vendor: %providerName Bundle-Localization: fragment -Export-Package: org.eclipse.emf.cdo.dawn.ecore.presentation;version="1.0.0";x-internal:=true +Export-Package: org.eclipse.emf.cdo.dawn.ecore.presentation;version="1.0.100";x-internal:=true diff --git a/plugins/org.eclipse.emf.cdo.dawn.ecore.editor.dawn/src/org/eclipse/emf/cdo/dawn/ecore/presentation/DawnEcoreEditor.java b/plugins/org.eclipse.emf.cdo.dawn.ecore.editor.dawn/src/org/eclipse/emf/cdo/dawn/ecore/presentation/DawnEcoreEditor.java index addb486d55..45592a6842 100644 --- a/plugins/org.eclipse.emf.cdo.dawn.ecore.editor.dawn/src/org/eclipse/emf/cdo/dawn/ecore/presentation/DawnEcoreEditor.java +++ b/plugins/org.eclipse.emf.cdo.dawn.ecore.editor.dawn/src/org/eclipse/emf/cdo/dawn/ecore/presentation/DawnEcoreEditor.java @@ -7,6 +7,7 @@ * * Contributors: * Martin Fluegge - initial API and implementation + * Christian W. Damus (CEA) - bug 399933 NPE in editor when finishing Ecore wizard */ package org.eclipse.emf.cdo.dawn.ecore.presentation; @@ -87,6 +88,11 @@ public class DawnEcoreEditor extends EcoreEditor implements IDawnEditor { super.createPages(); + if (!(getEditorInput() instanceof DawnEditorInput)) + { + return; + } + selectionViewer.setContentProvider(new DawnSelectionViewerAdapterFactoryContentProvider(adapterFactory, ((DawnEditorInput)getEditorInput()).getResource())); selectionViewer @@ -128,6 +134,10 @@ public class DawnEcoreEditor extends EcoreEditor implements IDawnEditor super.doSave(progressMonitor); } } + else + { + super.doSave(progressMonitor); + } } public String getContributorID() diff --git a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.editor.dawn/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.editor.dawn/META-INF/MANIFEST.MF index 2e4b49801c..03a6277e99 100644 --- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.editor.dawn/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.editor.dawn/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.eclipse.emf.cdo.dawn.examples.acore.editor.dawn;singleton:=true -Bundle-Version: 1.0.100.qualifier +Bundle-Version: 1.0.200.qualifier Bundle-Localization: fragment Bundle-Name: %pluginName Bundle-Vendor: %providerName @@ -12,4 +12,4 @@ Require-Bundle: org.eclipse.emf.cdo.dawn;bundle-version="[2.0.0,3.0.0)", org.eclipse.emf.cdo.dawn.util;bundle-version="[2.0.0,3.0.0)", org.eclipse.emf.cdo.ui;bundle-version="[4.0.0,5.0.0)", org.eclipse.emf.cdo.dawn.emf;bundle-version="[2.0.0,3.0.0)" -Export-Package: org.eclipse.emf.cdo.dawn.examples.acore.presentation;version="1.0.0" +Export-Package: org.eclipse.emf.cdo.dawn.examples.acore.presentation;version="1.0.200" diff --git a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.editor.dawn/src/org/eclipse/emf/cdo/dawn/examples/acore/presentation/DawnAcoreEditor.java b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.editor.dawn/src/org/eclipse/emf/cdo/dawn/examples/acore/presentation/DawnAcoreEditor.java index 8057d8e05f..925207f33f 100644 --- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.editor.dawn/src/org/eclipse/emf/cdo/dawn/examples/acore/presentation/DawnAcoreEditor.java +++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.editor.dawn/src/org/eclipse/emf/cdo/dawn/examples/acore/presentation/DawnAcoreEditor.java @@ -7,6 +7,7 @@ * * Contributors: * Martin Fluegge - initial API and implementation + * Christian W. Damus (CEA) - bug 399933 NPE in editor when finishing Ecore wizard * */ package org.eclipse.emf.cdo.dawn.examples.acore.presentation; @@ -92,6 +93,11 @@ public class DawnAcoreEditor extends AcoreEditor implements IDawnEditor { super.createPages(); + if (!(getEditorInput() instanceof DawnEditorInput)) + { + return; + } + selectionViewer.setContentProvider(new DawnSelectionViewerAdapterFactoryContentProvider(adapterFactory, ((DawnEditorInput)getEditorInput()).getResource())); selectionViewer @@ -128,6 +134,9 @@ public class DawnAcoreEditor extends AcoreEditor implements IDawnEditor super.doSave(progressMonitor); } } + { + super.doSave(progressMonitor); + } } public String getContributorID() |