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

18
LINES

< > BotCompany Repo | #1027868 // Add "Reset field" 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 (7579L/37K).

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  
      MapSO map = dm_changedFieldValues(mod);
10  
      if (empty(map)) ret;
11  
      
12  
      JMenu subMenu = jmenu("Reset field");
13  
      for (S field, O originalValue : map)
14  
        addMenuItem(subMenu, field, rThread { dm_set(mod, field, originalValue) });
15  
      addSubMenu(menu, subMenu);
16  
    });
17  
  }
18  
}

Author comment

Began life as a copy of #1020952

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1027868
Snippet name: Add "Reset field" submenu to module title menus
Eternal ID of this version: #1027868/3
Text MD5: a11036454f155681e326f3ba4a4de84a
Transpilation MD5: d5b10a4bce6bf1fdfb619e9c9d1d0f89
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:16:16
Source code size: 482 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 229 / 58062
Version history: 2 change(s)
Referenced in: [show references]