]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Added a handler for data format sharedLibrary:1 63/1563/1
authorHannu Niemistö <hannu.niemisto@semantum.fi>
Tue, 13 Mar 2018 07:33:21 +0000 (09:33 +0200)
committerHannu Niemistö <hannu.niemisto@semantum.fi>
Tue, 13 Mar 2018 07:33:21 +0000 (09:33 +0200)
refs #7806

Change-Id: I2994b32318d665aed3f84077da8ce89286e3b3bc

bundles/org.simantics.project/src/org/simantics/project/management/PlatformUtil.java

index 206480fa2ec3bf7d81f37e3c0902eeace06a09ce..ac08db001142e0b7b8b4131f101bb7e3c0f90d69 100644 (file)
@@ -414,22 +414,26 @@ public class PlatformUtil {
                        throw new IOException("Problem loading graph.tg from bundle " + bundle.getSymbolicName(), e);
                }
        }
+       
+       private static FormatHandler<TransferableGraph1> FORMAT_HANDLER = new FormatHandler<TransferableGraph1>() {
+        @Override
+        public Binding getBinding() {
+            return TransferableGraph1.BINDING;
+        }
+        @Override
+        public TransferableGraph1 process(DataContainer container) throws Exception {
+            return (TransferableGraph1) container.content.getValue(TransferableGraph1.BINDING);
+        }
+    };
 
        @SuppressWarnings("unchecked")
        private static Map<String, FormatHandler<TransferableGraph1>> handlers = ArrayMap.make(
                        new String[] {
-                                       "graph:1"
+                                       "graph:1",
+                                       "sharedLibrary:1"
                        },
-                       new FormatHandler<TransferableGraph1>() {
-                               @Override
-                               public Binding getBinding() {
-                                       return TransferableGraph1.BINDING;
-                               }
-                               @Override
-                               public TransferableGraph1 process(DataContainer container) throws Exception {
-                                       return (TransferableGraph1) container.content.getValue(TransferableGraph1.BINDING);
-                               }
-                       });
+                       FORMAT_HANDLER,
+                       FORMAT_HANDLER);
 
        private static TransferableGraph1 readTG(InputStream is) throws Exception {
                // For an unknown reason this is totally broken when running the TestSCLOsgi