Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

39
LINES

< > BotCompany Repo | #1016593 // stefansOS_addDynamicModuleDialog2

JavaX fragment (include) [tags: use-pretranspiled]

1  
svoid stefansOS_addDynamicModuleDialog2(fS snippetID) {
2  
  stefansOS_addDynamicModuleDialog2(snippetID, false);
3  
}
4  
5  
svoid stefansOS_addDynamicModuleDialog2(fS snippetID, final bool reuseExisting) {
6  
  systemQ.add(r {
7  
    if (reuseExisting) {
8  
      DynamicModule dm = findConcept(DynamicModule, moduleID := snippetID);
9  
      if (dm != null) ret with showModule(dm);
10  
    }
11  
12  
    temp tempBusyAnimation("Loading Module");
13  
14  
    // TODO: Merge this with code sharing?
15  
    Class c = hotwireModule(snippetID);
16  
    L<S> names = (L) callOpt(c, 'myInnerClasses);
17  
    if (names == null)
18  
      names = nonNulls(map getClassDeclarationName(innerClassesOfMain(getServerTranspiledWithoutLibs(snippetID))));
19  
      
20  
    print(+names);
21  
    // only show the usable ones
22  
    try {
23  
      print(mcName := mainClassNameForClassLoader(c.getClassLoader()));
24  
      names = shortClassNames(nonAbstractClassesInRealmWithSuperclassShortNamed(c, "DynModule", names));
25  
      print(+names);
26  
    } catch print e {
27  
      names = null;
28  
    }
29  
    
30  
    if (empty(names))
31  
      stefansOS_showNewDynamicModule(snippetID, null, c);
32  
    else if (l(names) == 1)
33  
      stefansOS_showNewDynamicModule(snippetID, c.getName() + "$" + first(names), c);
34  
    else
35  
      selectFromList("Class to use", concatLists(ll("None"), names), voidfunc(S className) {
36  
        stefansOS_showNewDynamicModule(snippetID, eq(className, "None") ? null : c.getName() + "$" + className, c);
37  
      });
38  
  });
39  
}

Author comment

Began life as a copy of #1016267

download  show line numbers  debug dex  old transpilations   

Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1016593
Snippet name: stefansOS_addDynamicModuleDialog2
Eternal ID of this version: #1016593/10
Text MD5: 17d8dcd051390027c8590843b8dfebb1
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-06-05 01:16:14
Source code size: 1475 bytes / 39 lines
Pitched / IR pitched: No / No
Views / Downloads: 365 / 435
Version history: 9 change(s)
Referenced in: [show references]