Libraryless. Click here for Pure Java version (5726L/32K).
svoid persistSelectedTabAsLiveValue(JTabbedPane tabs, SimpleLiveValue<S> lv) { S value = lv!; if (value != null) { int idx = indexOfTabName(tabs, value); printVars ifdef persistSelectedTabAsLiveValue_debug("persistSelectedTabAsLiveValue", +value, +idx); if (idx >= 0) selectTab(tabs, idx); } onChangeAndNow(tabs, -> { S name = getTabTitle(tabs, selectedTabIndex(tabs)); lv.set(name); printVars ifdef persistSelectedTabAsLiveValue_debug("persistSelectedTabAsLiveValue", +name); }); }
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1034039 |
Snippet name: | persistSelectedTabAsLiveValue (only grabs live value once) |
Eternal ID of this version: | #1034039/5 |
Text MD5: | bf51db8e7659d2c656a9c6bca5fbe52b |
Transpilation MD5: | d3b70dfd5c72715ec8604e15f4bba926 |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-01-28 19:46:39 |
Source code size: | 539 bytes / 15 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 131 / 209 |
Version history: | 4 change(s) |
Referenced in: | [show references] |