Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

38
LINES

< > BotCompany Repo | #1018437 // transpileOnServerWithErrorWindow

JavaX fragment (include) [tags: use-pretranspiled]

Transpiled version (11429L) is out of date.

1  
scope transpileOnServerWithErrorWindow.
2  
3  
sclass #DaClass {
4  
  S snippetID;
5  
  JFastLogView_noWrap transpilationErrorBox;
6  
  Runnable onSuccess;
7  
  O onError; // voidfunc(S) or Runnable
8  
  
9  
  void go(bool medium) {
10  
    infoBox("Transpiling " + snippetID);
11  
    final Pair<Bool, S> p = transpileOnBestServer(snippetID, medium ? "medium" : "quick");
12  
    awt {
13  
      if (p.a) {
14  
        infoBox("Transpiled OK!");
15  
        hideWindow(transpilationErrorBox);
16  
        transpilationErrorBox = null;
17  
        callFInNewThread(onSuccess);
18  
      } else {
19  
        infoBox("Transpilation error. " + p.b);
20  
        bool first = transpilationErrorBox == null;
21  
        transpilationErrorBox = maximizeFrame(scrollAllTheWayDown(showText_fast_noWrap(transpilationErrorBox, "Transpilation Error", p.b)));
22  
        if (first) {
23  
          setFrameIcon(#1101268, transpilationErrorBox);
24  
          addButtonsToWindow(transpilationErrorBox,
25  
            jbuttonWithDisable("Medium transpile", r { go(true) })
26  
          );
27  
        }
28  
        callFInNewThread(onError, p.b);
29  
      }
30  
    }
31  
  }
32  
}
33  
34  
svoid transpileOnServerWithErrorWindow(S snippetID, bool medium, final Runnable onSuccess, O... _) {
35  
  nu(DaClass, paramsPlus(_, +snippetID, +onSuccess)).go(medium);
36  
}
37  
        
38  
end scope

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1018437
Snippet name: transpileOnServerWithErrorWindow
Eternal ID of this version: #1018437/12
Text MD5: f7528b07acd1efd7c7f1011d5488bf1e
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-03-07 19:33:55
Source code size: 1281 bytes / 38 lines
Pitched / IR pitched: No / No
Views / Downloads: 409 / 591
Version history: 11 change(s)
Referenced in: [show references]