1 | abstract sclass DynTextSplitter > DynModule { |
2 | S text, function; |
3 | LS actualOutput; |
4 | LS output; |
5 | switchable bool showQuoted; |
6 | |
7 | transient JList outputList; |
8 | |
9 | visualize { |
10 | LiveValue<S> lvOutputTitle = mapLiveValue(dm_fieldLiveValue('output), S, func(LS l) -> S { "OUTPUT" + (empty(l) ? "" : " (" + upper(n2(l, "item")) + ")") }); |
11 | ret withMargin(jvsplit( |
12 | jSection("INPUT", dm_fieldTextArea('text)), |
13 | northAndCenterWithMargin( |
14 | centerAndEastEastWithMargin( |
15 | withLabel("Split function:", standardFunctionLiveValueComboBox(dm_fieldLiveValue('function))), |
16 | dm_checkBox('showQuoted), |
17 | jbutton("Do it", rThread compute)), |
18 | jLiveValueSection(lvOutputTitle, jLiveValueList(dm_fieldLiveValue('output)))))); |
19 | } |
20 | |
21 | void compute enter { |
22 | setField(actualOutput := assertStringList(callAndMake(function, text))); |
23 | setField(output := showQuoted ? quoteAll(output) : actualOutput); |
24 | } |
25 | } |
Began life as a copy of #1020148
download show line numbers debug dex old transpilations
Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1023912 |
Snippet name: | DynTextSplitter |
Eternal ID of this version: | #1023912/1 |
Text MD5: | c8ad16496ad82444f9430a7616f7902b |
Author: | stefan |
Category: | javax / text processing |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-07-12 12:05:42 |
Source code size: | 969 bytes / 25 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 253 / 622 |
Referenced in: | [show references] |