static ThreadLocal dataToTable_useStruct = threadLocalWithDefault(true); static void dataToTable_dynSet(L l, int i, O s) { while (i >= l.size()) l.add(""); l.set(i, s); } static L dataToTable_makeRow(O x, L cols) { if (instanceOf(x, "DynamicObject")) x = get_raw(x, "fieldValues"); if (x instanceof Map) { Map m = cast x; new L row; for (O _field : keysWithoutHidden(m)) { S field = cast _field; O value = m.get(field); int col = cols.indexOf(field); if (col < 0) { cols.add(field); col = cols.size()-1; } dataToTable_dynSet(row, col, dataToTable_wrapValue(value)); } ret row; } // XXX new if (x cast L) ret allToString(x); ret litlist(structureOrText(x)); } static O dataToTable_wrapValue(O o) { if (o instanceof BufferedImage) ret o; if (o cast MakesBufferedImage) ret o.getBufferedImage(); ifclass RGBImage if (o instanceof RGBImage) ret o; // huh? endif if (o instanceof Bool) ret o; ret dataToTable_useStruct! ? structureOrTextForUser(o) : strOrNull(o); }