Author: b00__1
Date: 2007-07-15 23:14:18-0700
New Revision: 13086
Modified:
branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/XmiWriterEUMLImpl.java
Log:
Use the editing domain
Modified: branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/XmiWriterEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/XmiWriterEUMLImpl.java?view=diff&rev=13086&p1=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/XmiWriterEUMLImpl.java&p2=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/XmiWriterEUMLImpl.java&r1=13085&r2=13086
==============================================================================
--- branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/XmiWriterEUMLImpl.java (original)
+++ branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/XmiWriterEUMLImpl.java 2007-07-15 23:14:18-0700
@@ -36,11 +36,7 @@
import org.argouml.model.UmlException;
import org.argouml.model.XmiExtensionWriter;
import org.argouml.model.XmiWriter;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.ecore.xmi.XMLResource;
/**
@@ -84,7 +80,6 @@
*/
public XmiWriterEUMLImpl(EUMLModelImplementation implementation,
Object theModel, OutputStream stream, String version) {
- modelImpl = implementation;
if (stream == null) {
throw new IllegalArgumentException("An OutputStream must be provided");
}
@@ -102,11 +97,8 @@
public void write() throws UmlException {
// This URI is a dummy. We're going to write to our OutputStream
- Resource resource =
- new ResourceSetImpl().createResource(URI
- .createFileURI("foo.xmi"));
- EList<EObject> contents = resource.getContents();
- contents.add(model);
+ Resource resource = modelImpl.getEditingDomain().createResource("foo.xmi");
+ resource.getContents().add(model);
// Do we need to get stereotype applications for each element? - tfm
// for (Iterator allContents = UMLUtil.getAllContents(model, true,
@@ -116,7 +108,6 @@
// contents.addAll(((Element) eObject).getStereotypeApplications());
// }
// }
-
Map options = new HashMap();
options.put(XMLResource.OPTION_LINE_WIDTH, 100);
@@ -134,5 +125,4 @@
throw new NotYetImplementedException();
}
-
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.