static JTextComponent looselyBindLiveValueToTextComponent(IVarWithNotify<S> lv, JTextComponent c) { onChange(c, -> lv.set(getText(c))); bindToComponent(c, -> { S value = lv!; if (value != null) setText(c, value); else lv.set(getText(c)); }); ret c; }
Began life as a copy of #1036315
download show line numbers debug dex old transpilations
Travelled to 2 computer(s): mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1036371 |
Snippet name: | looselyBindLiveValueToTextComponent - only grab once upon display, but save on every user interaction |
Eternal ID of this version: | #1036371/3 |
Text MD5: | 0151a5ef09b650ed9941a3e157080274 |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-11-28 17:14:54 |
Source code size: | 292 bytes / 11 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 116 / 130 |
Version history: | 2 change(s) |
Referenced in: | [show references] |