[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.modeling.mdt.uml2] Re: Generating Java-classes?
|
- From: skobilke@xxxxxx ( Usul)
- Date: Fri, 22 May 2009 16:59:36 +0000 (UTC)
- Newsgroups: eclipse.modeling.mdt.uml2
- Organization: Eclipse
- User-agent: NewsPortal/0.36 (http://florian-amrhein.de/newsportal)
Thank you for answering Kenn,
but I still dont understand. I need the Java-classes which represent the
metamodel. Are you saying they already exist? Where can I find them?
What I want to do is to write an eclipse-plugin which can create
uml-models. So I need the Java-classes in order to do this:
// create root of model
umlFac = UmlFactory.eINSTANCE;
Model root = umlFac .createModel();
// build model
..
// save model
ResourceSet resourceSet = new ResourceSetImpl();
IProject project = selectedFolder.getCorrespondingResource().getProject();
IFolder modelFolder = this.getModelFolder(project);
IFile file = modelFolder.getFile("themodel.uml");
String path = file.getLocation().toFile().getAbsolutePath();
URI fileURI = URI.createFileURI(path);
Resource resource = resourceSet.createResource(fileURI);
resource.getContents().add(root );
system.resource.save(Collections.EMPTY_MAP);