X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.document.server.io%2Fsrc%2Forg%2Fsimantics%2Fdocument%2Fserver%2Fio%2FJSONObjectUtils.java;fp=bundles%2Forg.simantics.document.server.io%2Fsrc%2Forg%2Fsimantics%2Fdocument%2Fserver%2Fio%2FJSONObjectUtils.java;h=004166dc0c39bf387dd471b9b8617bb8c8853885;hp=558ee320459e519823852eac43d654763e90906f;hb=8360fe5756f40b0f43f673394f1fef098d31627e;hpb=97872f96afc18f4cd5b959d869fed80cd92f6aa1 diff --git a/bundles/org.simantics.document.server.io/src/org/simantics/document/server/io/JSONObjectUtils.java b/bundles/org.simantics.document.server.io/src/org/simantics/document/server/io/JSONObjectUtils.java index 558ee3204..004166dc0 100644 --- a/bundles/org.simantics.document.server.io/src/org/simantics/document/server/io/JSONObjectUtils.java +++ b/bundles/org.simantics.document.server.io/src/org/simantics/document/server/io/JSONObjectUtils.java @@ -314,6 +314,26 @@ public class JSONObjectUtils { return Collections.emptyList(); } + @SuppressWarnings("unchecked") + public static Collection getTreeTableCells(IJSONObject object) { + try { + Object tableCells = object.getValue("tableCells"); + if (tableCells instanceof String) { + String tableCellsS = (String) tableCells; + if (tableCellsS.length() == 0) + return Collections.emptyList(); + } + if (tableCells != null) { + return (List) tableCells; + } else { + return Collections.emptyList(); + } + } catch (ClassCastException e) { + e.printStackTrace(); + } + return Collections.emptyList(); + } + public static Collection getFiles(IJSONObject object) { try { @SuppressWarnings("unchecked")