import org.simantics.databoard.util.URIStringUtils;
import org.simantics.db.Resource;
import org.simantics.db.Session;
+import org.simantics.db.layer0.adapter.impl.DefaultPasteImportAdvisor;
import org.simantics.db.layer0.migration.MigratedImportResult;
import org.simantics.db.layer0.migration.MigrationState;
import org.simantics.db.layer0.migration.MigrationStateKeys;
import org.simantics.db.layer0.migration.MigrationUtils;
-import org.simantics.db.layer0.migration.ModelImportAdvisor;
import org.simantics.db.management.ISessionContext;
import org.simantics.graph.db.ImportResult;
import org.simantics.graph.db.MissingDependencyException;
import org.simantics.project.IProject;
import org.simantics.project.ProjectKeys;
import org.simantics.ui.SimanticsUI;
-import org.simantics.ui.utils.ResourceAdaptionUtils;
import org.simantics.utils.strings.EString;
import org.simantics.utils.ui.ErrorLogger;
import org.simantics.utils.ui.ExceptionUtils;
@Override
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
try {
- Resource target = ResourceAdaptionUtils.toSingleResource(importModel.selection);
+ Resource target = Simantics.getProjectResource();
importModel.sessionContext.getSession().markUndoPoint();
result[0] = doImport(monitor, importModel.importLocation, importModel.sessionContext.getSession(), target);
} catch (Exception e) {
state.setProperty(MigrationStateKeys.SESSION, session);
state.setProperty(MigrationStateKeys.PROGRESS_MONITOR, monitor);
- MigrationUtils.importMigrated(monitor, session, modelFile, state, new ModelImportAdvisor(Simantics.getProjectResource()), Simantics.getProjectResource());
+ MigrationUtils.importMigrated(monitor, session, modelFile, state, new DefaultPasteImportAdvisor(target), target);
Collection<Resource> resultRoots = state.getProperty(MigrationStateKeys.CURRENT_ROOT_RESOURCES);
ImportResult result = state.getProperty(MigrationStateKeys.IMPORT_RESULT);