1 | scope iPanel_renderSafeFunction. |
2 | |
3 | static Set<S> #safeTags = lithashset("safe", "awt", "mech", "variable");
|
4 | |
5 | static JComponent iPanel_renderSafeFunction(S s, final Runnable refresh) {
|
6 | if (!isStandardFunction(s)) null; |
7 | SS safetyMap = mechHashMap("JavaX Identifier Safety");
|
8 | S safety = safetyMap.get(s); |
9 | print("Safety for " + s + ": " + safety);
|
10 | fS fname = s; |
11 | if (empty(safety) || !setContainsSet(safeTags, tokSplitAtComma(safety))) |
12 | ret jfullcenter(jbutton( |
13 | "Check " + s + " for safety" + (empty(safety) ? "" : ": " + safety), |
14 | rThread(r { checkStandardFunctionForSafety(fname); callF(refresh) })));
|
15 | |
16 | Component c; |
17 | try {
|
18 | O o = callAndMake(s); |
19 | if (o instanceof JComponent) |
20 | c = o/JComponent; |
21 | else |
22 | c = jCenteredMultiLineLabel(str(o)); |
23 | } catch e {
|
24 | c = exceptionInTextArea(e); |
25 | } |
26 | ret withCenteredTitle(s + " [" + safety + "]", c); |
27 | } |
28 | |
29 | end scope |
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1015778 |
| Snippet name: | iPanel_renderSafeFunction [iPanel = "intelligent panel"] |
| Eternal ID of this version: | #1015778/5 |
| Text MD5: | 55c177dfcb47bcbfb90a4690fca07283 |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2018-05-27 18:13:01 |
| Source code size: | 931 bytes / 29 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 644 / 682 |
| Version history: | 4 change(s) |
| Referenced in: | [show references] |