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

24
LINES

< > BotCompany Repo | #1030711 // Add "Call function" submenu to module title menus

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Uses 1113K of libraries. Click here for Pure Java version (16021L/76K).

1  
!7
2  
3  
cmodule2 Bla > DynPrintLogAndEnabled {
4  
  start {
5  
    dm_onAnyModulePopupMenu(voidfunc(JPopupMenu menu, S mod) {
6  
      if (!enabled) ret;
7  
      temp enter();
8  
      
9  
      L<Method> methods = zeroArgumentMethods(allLiveMethods(dm_mod(mod)));
10  
      if (empty(methods)) ret;
11  
      
12  
      addSubMenu(menu, jDynamicScrollingMenu("Call function", voidfunc(JPopupMenu subMenu) {
13  
        for (Method m : methods)
14  
          addMenuItem(subMenu, m.getName(), rThread {
15  
            time("Done: " + m.getName(), r {
16  
              O result = dm_call(mod, m.getName());
17  
              if (result != null)
18  
                infoBox(shorten(str(result)));
19  
            });
20  
          });
21  
      }));
22  
    });
23  
  }
24  
}

Author comment

Began life as a copy of #1027868

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1030711
Snippet name: Add "Call function" submenu to module title menus
Eternal ID of this version: #1030711/6
Text MD5: cbf31f7436b136171c0c846aaaf975fd
Transpilation MD5: 8bf4a8bc2ef747dc09277b4a30b4ea9c
Author: stefan
Category: javax / stefan's os
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-06-19 15:15:43
Source code size: 717 bytes / 24 lines
Pitched / IR pitched: No / No
Views / Downloads: 133 / 271117
Version history: 5 change(s)
Referenced in: [show references]