Commit 740ea39f authored by Kai-Holger Brassel's avatar Kai-Holger Brassel
Browse files

Create new catalogs with UTF-8 encoding.

parent b01e4355
......@@ -12,6 +12,7 @@ import org.eclipse.e4.ui.workbench.modeling.EPartService;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.ecore.xmi.XMLResource;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.swt.widgets.Shell;
......@@ -27,19 +28,25 @@ public class NewHandler {
if (pathToNewCatalog != null) {
// create new catalog with resource at above path
final AdapterFactoryEditingDomain domain = HandlerUtils.createEditingDomain();
final Resource energyCatalogResource = domain.createResource("file://" + pathToNewCatalog);
final EObject energyCatalog = EcoreUtil.create(BuildingPhysicsPackage.eINSTANCE.getBuildingPhysicsCatalog());
final Resource catalogResource = domain.createResource("file://" + pathToNewCatalog);
// assume default XMI factory was used to create an XML resource
if (catalogResource instanceof XMLResource) {
final EObject catalog = EcoreUtil.create(BuildingPhysicsPackage.eINSTANCE.getBuildingPhysicsCatalog());
// store new (empty) resource at selected path
try {;;
} catch (IOException e) {
// TODO Auto-generated catch block
HandlerUtils.createNewPartWithCatalog(application.getContext(), partService, energyCatalogResource);
HandlerUtils.createNewPartWithCatalog(application.getContext(), partService, catalogResource);
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment