1 | static SimpleLiveValue dm_fieldLiveValue(S fieldName) { |
2 | ret dm_fieldLiveValue(dm_current_mandatory(), fieldName); |
3 | } |
4 | |
5 | static SimpleLiveValue dm_fieldLiveValue(final DynModule module, fS fieldName) { |
6 | lock module.lock; |
7 | Class type = getFieldType(module, fieldName); |
8 | final SimpleLiveValue value = new(type, get(module, fieldName)); |
9 | module.onChange(r { |
10 | ifdef dm_fieldLiveValue_debug |
11 | print("dm_fieldLiveValue: setting " + fieldName); |
12 | endifdef |
13 | O o = get(module, fieldName); |
14 | ifdef dm_fieldLiveValue_debug |
15 | print("dm_fieldLiveValue: setting " + fieldName + " = " + o); |
16 | endifdef |
17 | value.set(o); |
18 | ifdef dm_fieldLiveValue_debug |
19 | print("dm_fieldLiveValue: setting " + fieldName + " done"); |
20 | printStackTrace(); |
21 | endifdef |
22 | }); |
23 | value.onChange(r { |
24 | ifdef dm_fieldLiveValue_debug |
25 | print("dm_fieldLiveValue: setting 2 " + fieldName + " = " + value!); |
26 | endifdef |
27 | module.setField(fieldName, value!); |
28 | ifdef dm_fieldLiveValue_debug |
29 | print("dm_fieldLiveValue: setting 2 " + fieldName + " done"); |
30 | endifdef |
31 | }); |
32 | ret value; |
33 | } |
Began life as a copy of #1015971
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1026955 |
Snippet name: | OLD version for persistent fields only. dm_fieldLiveValue - live-value for a field in DynModule |
Eternal ID of this version: | #1026955/1 |
Text MD5: | 611c82031d850f75a1562b4b52d042d7 |
Author: | stefan |
Category: | javax / stefan's os |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-02-03 17:58:21 |
Source code size: | 1121 bytes / 33 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 194 / 214 |
Referenced in: | [show references] |