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).

!7

cmodule2 Bla > DynPrintLogAndEnabled {
  start {
    dm_onAnyModulePopupMenu(voidfunc(JPopupMenu menu, S mod) {
      if (!enabled) ret;
      temp enter();
      
      L<Method> methods = zeroArgumentMethods(allLiveMethods(dm_mod(mod)));
      if (empty(methods)) ret;
      
      addSubMenu(menu, jDynamicScrollingMenu("Call function", voidfunc(JPopupMenu subMenu) {
        for (Method m : methods)
          addMenuItem(subMenu, m.getName(), rThread {
            time("Done: " + m.getName(), r {
              O result = dm_call(mod, m.getName());
              if (result != null)
                infoBox(shorten(str(result)));
            });
          });
      }));
    });
  }
}

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: 190 / 333264
Version history: 5 change(s)
Referenced in: [show references]