Skip to content
Snippets Groups Projects
Commit 49366bc5 authored by Fabian Wiesner's avatar Fabian Wiesner
Browse files

git-svn-id: https://se1.informatik.uni-wuerzburg.de/usvn/svn/code/code/DMM/trunk@13235 9e42b895-fcda-4063-8a3b-11be15eb1bbd
parent b6ce56ba
No related branches found
No related tags found
No related merge requests found
......@@ -99,20 +99,24 @@ public class InitCreateDiagramWizard implements IObjectActionDelegate {
Repository model = null;
if (diagramRoot instanceof Repository) {
model = (Repository) diagramRoot;
}
//TODO: If >1 Repository exists: present them to choose one
while (it.hasNext()) {
EObject possibleRepo = it.next();
if (possibleRepo instanceof Repository) {
model = (Repository) possibleRepo;
} else {
//TODO: If >1 Repository exists: present them to choose one
while (it.hasNext()) {
EObject possibleRepo = it.next();
if (possibleRepo instanceof Repository) {
model = (Repository) possibleRepo;
}
}
}
/*
* If no model found exit
*/
if (model == null) {
MessageDialog.openError(shell, "No Repository found", "Resource does not contain a 'Repository' EObject");
return;
}
/*
* Create empty diagram
*/
......@@ -124,11 +128,11 @@ public class InitCreateDiagramWizard implements IObjectActionDelegate {
diagram.setDiagramTypeId(diagramTypeId);
diagram.setName(fileName);
diagramInitializer.initialize(diagram);
// diagram.eResource().getContents().add(model);//TODO
resource.getContents().add(diagram);
//org.eclipselabs.spray.runtime.graphiti.wizard.NewDiagramWizard nutzt das folgende:
//public void run(IProgressMonitor monitor) throws InvocationTargetException
try {
resource.save(Collections.emptyMap());
} catch (IOException e) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment