From 0dfe4ea2175a61a41ffa1e32b64a143076a7d362 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Hannu=20Niemist=C3=B6?= Date: Tue, 13 Mar 2018 09:33:21 +0200 Subject: [PATCH] Added a handler for data format sharedLibrary:1 refs #7806 Change-Id: I2994b32318d665aed3f84077da8ce89286e3b3bc --- .../project/management/PlatformUtil.java | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) 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 -- 2.47.1