From: Hannu Niemistö Date: Tue, 13 Mar 2018 07:33:21 +0000 (+0200) Subject: Added a handler for data format sharedLibrary:1 X-Git-Tag: v1.43.0~136^2~544 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F63%2F1563%2F1;p=simantics%2Fplatform.git Added a handler for data format sharedLibrary:1 refs #7806 Change-Id: I2994b32318d665aed3f84077da8ce89286e3b3bc --- diff --git a/bundles/org.simantics.project/src/org/simantics/project/management/PlatformUtil.java b/bundles/org.simantics.project/src/org/simantics/project/management/PlatformUtil.java index 206480fa2..ac08db001 100644 --- a/bundles/org.simantics.project/src/org/simantics/project/management/PlatformUtil.java +++ b/bundles/org.simantics.project/src/org/simantics/project/management/PlatformUtil.java @@ -414,22 +414,26 @@ public class PlatformUtil { throw new IOException("Problem loading graph.tg from bundle " + bundle.getSymbolicName(), e); } } + + private static FormatHandler FORMAT_HANDLER = new FormatHandler() { + @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> handlers = ArrayMap.make( new String[] { - "graph:1" + "graph:1", + "sharedLibrary:1" }, - new FormatHandler() { - @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