Libraryless. Click here for Pure Java version (10167L/56K).
1 | static new ThreadLocal<Bool> bindComboBoxToLiveValue_debug; |
2 | |
3 | static <A extends JComboBox> A bindComboBoxToLiveValue(final A cb, IVarWithNotify<S> lv) { |
4 | bool debug = isTrue(bindComboBoxToLiveValue_debug!); |
5 | bindLiveValueListenerToComponent(cb, lv, r { selectItem(cb, lv!) }); |
6 | onChange(cb, r { |
7 | S s = getText(cb); // also works on editable combo boxes |
8 | if (debug) |
9 | print("ComboBox: " + s); |
10 | lv.set(s); |
11 | }); |
12 | ret cb; |
13 | } |
Began life as a copy of #1015821
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: | #1016619 |
Snippet name: | bindComboBoxToLiveValue |
Eternal ID of this version: | #1016619/5 |
Text MD5: | 56a00772fb2e147a6e55d7cf97365d3f |
Transpilation MD5: | 42438f4a4d3a9923437b961e4a536e6b |
Author: | stefan |
Category: | javax / a.i. |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-11-07 11:04:46 |
Source code size: | 448 bytes / 13 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 396 / 490 |
Version history: | 4 change(s) |
Referenced in: | [show references] |