Require-Bundle: org.eclipse.core.runtime,
org.simantics.fileimport,
org.simantics.r;bundle-version="0.1.0",
- org.simantics.db
+ org.simantics.db,
+ org.simantics
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Service-Component: OSGI-INF/component.xml
-package org.simantics.r.fileimport;\r
-\r
-import java.nio.file.Path;\r
-import java.util.Collections;\r
-import java.util.Map;\r
-import java.util.Optional;\r
-\r
-import org.simantics.db.Resource;\r
-import org.simantics.fileimport.SimanticsResourceFileImport;\r
-import org.simantics.r.RModelUtils;\r
-\r
-public class RFileImport extends SimanticsResourceFileImport {\r
-\r
- private static final Map<String, String> ALLOWED_EXTENSIONS = Collections.singletonMap("*.r", "R-file (*.r)");\r
- \r
- @Override\r
- public Optional<Resource> perform(Resource parent, Path file) {\r
- return Optional.ofNullable(RModelUtils.createRModel(parent, file));\r
- }\r
-\r
- @Override\r
- public Map<String, String> allowedExtensionsWithFilters() {\r
- return ALLOWED_EXTENSIONS;\r
- }\r
-\r
-}\r
+package org.simantics.r.fileimport;
+
+import java.nio.file.Path;
+import java.util.Collections;
+import java.util.Map;
+import java.util.Optional;
+
+import org.simantics.Simantics;
+import org.simantics.db.Resource;
+import org.simantics.fileimport.SimanticsResourceFileImport;
+import org.simantics.r.RModelUtils;
+
+public class RFileImport extends SimanticsResourceFileImport {
+
+ private static final Map<String, String> ALLOWED_EXTENSIONS = Collections.singletonMap("*.r", "R-file (*.r)");
+
+ @Override
+ public Optional<Resource> perform(Resource parent, Path file) {
+ return Optional.ofNullable(RModelUtils.createRModel(parent, file));
+ }
+
+ @Override
+ public Map<String, String> allowedExtensionsWithFilters() {
+ return ALLOWED_EXTENSIONS;
+ }
+
+ @Override
+ public Resource defaultParentResource() {
+ return Simantics.getProjectResource();
+ }
+
+}