1 | static abstract class DynSingleFunction extends DynModule { |
2 | transient S buttonText; |
3 | |
4 | *() {} |
5 | *(S *buttonText) {} |
6 | |
7 | // call before visualize |
8 | void setFunctionName(S name) { buttonText = name; } |
9 | |
10 | visualize { |
11 | ret jfullcenter(withMargin(makeButtons())); |
12 | } |
13 | |
14 | JComponent makeButtons() { |
15 | ret jbutton(or2(buttonText, dm_moduleName()), rThread doItWithEnter); |
16 | } |
17 | |
18 | abstract void doIt(); |
19 | |
20 | void doItWithEnter() { |
21 | temp enter(); |
22 | try { |
23 | doIt(); |
24 | } catch e { |
25 | print(getStackTrace(e)); |
26 | } |
27 | } |
28 | } |
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1016385 |
Snippet name: | DynSingleFunction |
Eternal ID of this version: | #1016385/11 |
Text MD5: | c031690ea56fd5d32be58ea510e49c16 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-10-10 17:43:30 |
Source code size: | 565 bytes / 28 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 485 / 1134 |
Version history: | 10 change(s) |
Referenced in: | [show references] |