diff --git a/src/main/java/org/gecko/viewmodel/ViewModelFactory.java b/src/main/java/org/gecko/viewmodel/ViewModelFactory.java index 44cdec55..d5551225 100644 --- a/src/main/java/org/gecko/viewmodel/ViewModelFactory.java +++ b/src/main/java/org/gecko/viewmodel/ViewModelFactory.java @@ -140,6 +140,15 @@ public SystemConnectionViewModel createSystemConnectionViewModelFrom( return result; } + /** + * Expects the source and destination of the system connection to be in the view model. + */ + public SystemConnectionViewModel createSystemConnectionViewModelFrom( + SystemConnection systemConnection) throws MissingViewModelElementException { + return createSystemConnectionViewModelFrom(geckoViewModel.getCurrentEditor().getCurrentSystem().getTarget(), + systemConnection); + } + public SystemViewModel createSystemViewModelIn(SystemViewModel parentSystem) throws ModelException { System system = modelFactory.createSystem(parentSystem.getTarget()); SystemViewModel result = new SystemViewModel(getNewViewModelElementId(), system);