Libraryless. Click here for Pure Java version (11267L/62K).
1 | static <A extends JCheckBox> A looselyBindLiveValueToCheckBox(A cb, IVarWithNotify<Bool> lv) { |
2 | onChange(cb, (Runnable) () -> lv.set(isChecked(cb))); |
3 | bindToComponent(cb, -> { |
4 | var value = lv!; |
5 | if (value != null) |
6 | setChecked(cb, value); |
7 | else |
8 | lv.set(isChecked(cb)); |
9 | }); |
10 | ret cb; |
11 | } |
12 | |
13 | static <A extends JCheckBox> A looselyBindLiveValueToCheckBox(IVarWithNotify<Bool> lv, A cb) { |
14 | ret looselyBindLiveValueToCheckBox(cb, lv); |
15 | } |
Began life as a copy of #1017125
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): elmgxqgtpvxh, mqqgnosmbjvj, wnsclhtenguj
No comments. add comment
Snippet ID: | #1035934 |
Snippet name: | looselyBindLiveValueToCheckBox |
Eternal ID of this version: | #1035934/7 |
Text MD5: | a6f775625a2c95d9cb602931d1d95e81 |
Transpilation MD5: | 2d769ba59f65a21d344fc546cb02d51e |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2023-05-13 02:16:35 |
Source code size: | 464 bytes / 15 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 151 / 227 |
Version history: | 6 change(s) |
Referenced in: | [show references] |