svoid stefansOS_addDynamicModuleDialog2(fS snippetID) { stefansOS_addDynamicModuleDialog2(snippetID, false); } svoid stefansOS_addDynamicModuleDialog2(fS snippetID, final bool reuseExisting) { systemQ.add(r { if (reuseExisting) { DynamicModule dm = findConcept(DynamicModule, moduleID := snippetID); if (dm != null) ret with showModule(dm); } temp tempBusyAnimation("Loading Module"); // TODO: Merge this with code sharing? Class c = hotwireModule(snippetID); L names = (L) callOpt(c, 'myInnerClasses); if (names == null) names = nonNulls(map getClassDeclarationName(innerClassesOfMain(getServerTranspiledWithoutLibs(snippetID)))); print(+names); // only show the usable ones try { print(mcName := mainClassNameForClassLoader(c.getClassLoader())); names = shortClassNames(nonAbstractClassesInRealmWithSuperclassShortNamed(c, "DynModule", names)); print(+names); } catch print e { names = null; } if (empty(names)) stefansOS_showNewDynamicModule(snippetID, null, c); else if (l(names) == 1) stefansOS_showNewDynamicModule(snippetID, c.getName() + "$" + first(names), c); else selectFromList("Class to use", concatLists(ll("None"), names), voidfunc(S className) { stefansOS_showNewDynamicModule(snippetID, eq(className, "None") ? null : c.getName() + "$" + className, c); }); }); }