Libraryless. Click here for Pure Java version (15473L/108K).
1 | !7 |
2 | |
3 | set flag DynModule. |
4 | |
5 | sclass Result {
|
6 | S function, result; |
7 | |
8 | *() {}
|
9 | *(S *function, O result) { this.result = str(result); }
|
10 | } |
11 | |
12 | sclass MultiAnalysis extends DynObjectTable<Result> {
|
13 | S input; |
14 | transient JTextArea taInput; |
15 | transient bool calculating; |
16 | |
17 | visualize {
|
18 | ret withMargin(jvsplit( |
19 | centerAndEastWithMarginInbetween( |
20 | onCtrlEnter(taInput = jEnableUndoRedo(typeWriterTextArea(input)), rThread evalIt), |
21 | vstackWithSpacing( |
22 | jbutton("Analyze", rThread evalIt))),
|
23 | super.visualize())); |
24 | } |
25 | |
26 | void evalIt {
|
27 | if (calculating) ret; |
28 | temp tempSetField(this, calculating := true); |
29 | setField(input := getText(taInput)); |
30 | setData(ll( |
31 | Result("isMultiLine", yesno(isMultiLine(input))),
|
32 | Result("Lines", countLines(input))));
|
33 | } |
34 | } |
Began life as a copy of #1018152
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1018174 |
| Snippet name: | Text Multi-Analysis [dev.] |
| Eternal ID of this version: | #1018174/4 |
| Text MD5: | 645e8d1cfceb90558fb08d97649a5503 |
| Transpilation MD5: | d9980dc1cb3cb3e1e060325e459937f0 |
| Author: | stefan |
| Category: | javax / a.i. |
| Type: | JavaX source code (Dynamic Module) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2018-09-07 14:52:47 |
| Source code size: | 834 bytes / 34 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 576 / 1428 |
| Version history: | 3 change(s) |
| Referenced in: | [show references] |