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

!7

cmodule2 Bla > DynPrintLogAndEnabled {
  start {
    dm_onAnyModulePopupMenu(voidfunc(JPopupMenu menu, S mod) {
      if (!enabled) ret;
      temp enter();
      
      MapSO map = dm_changedFieldValues(mod);
      if (empty(map)) ret;
      
      JMenu subMenu = jmenu("Reset field");
      for (S field, O originalValue : map)
        addMenuItem(subMenu, field, rThread { dm_set(mod, field, originalValue) });
      addSubMenu(menu, subMenu);
    });
  }
}

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: 228 / 58061
Version history: 2 change(s)
Referenced in: [show references]