Libraryless. Click here for Pure Java version (14573L/101K).
1 | !7 |
2 | |
3 | sclass ModuleList extends DynCalculatedList { |
4 | start { |
5 | dm_vmBus_onMessage('moduleDeleted, rstUpdate()); |
6 | } |
7 | |
8 | O getModule(S item) { |
9 | ret item == null ? null |
10 | : callCreator('getModuleByID, firstIntAsString(item)); |
11 | } |
12 | |
13 | visualize { |
14 | JList list = assertNotNull("JList", (JList) super.visualize()); |
15 | onDoubleClickOrEnter(list, voidfunc(fS s) { dm_showModule(getModule(s)) }); |
16 | for (final Pair<S, VF1<O>> p : dm_moduleMenuItems()) |
17 | listPopupMenuItem(list, |
18 | p.a, voidfunc(fS s) { thread { callF(p.b, getModule(s)); } }); |
19 | ret list; |
20 | } |
21 | |
22 | LS calc() { |
23 | ret map(func(final O m) -> S { |
24 | "[" + dm_moduleID(m) + "] " + or2(pcallF(func -> S { dm_moduleName(m) }), "?") |
25 | }, modulesToList()); |
26 | } |
27 | |
28 | L<O> modulesToList() { ret dm_listStems(); } |
29 | } |
Began life as a copy of #1016132
download show line numbers debug dex old transpilations
Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1016674 |
Snippet name: | Module List [Dyn Module] |
Eternal ID of this version: | #1016674/10 |
Text MD5: | 892439788eb022620ad340df16538be4 |
Transpilation MD5: | cd9980d0206163ce5535524d64f22e8a |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX source code (Dynamic Module) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-12-22 20:05:47 |
Source code size: | 819 bytes / 29 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 500 / 3334 |
Version history: | 9 change(s) |
Referenced in: | [show references] |