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.

scope transpileOnServerWithErrorWindow.

sclass #DaClass {
  S snippetID;
  JFastLogView_noWrap transpilationErrorBox;
  Runnable onSuccess;
  O onError; // voidfunc(S) or Runnable
  
  void go(bool medium) {
    infoBox("Transpiling " + snippetID);
    final Pair<Bool, S> p = transpileOnBestServer(snippetID, medium ? "medium" : "quick");
    awt {
      if (p.a) {
        infoBox("Transpiled OK!");
        hideWindow(transpilationErrorBox);
        transpilationErrorBox = null;
        callFInNewThread(onSuccess);
      } else {
        infoBox("Transpilation error. " + p.b);
        bool first = transpilationErrorBox == null;
        transpilationErrorBox = maximizeFrame(scrollAllTheWayDown(showText_fast_noWrap(transpilationErrorBox, "Transpilation Error", p.b)));
        if (first) {
          setFrameIcon(#1101268, transpilationErrorBox);
          addButtonsToWindow(transpilationErrorBox,
            jbuttonWithDisable("Medium transpile", r { go(true) })
          );
        }
        callFInNewThread(onError, p.b);
      }
    }
  }
}

svoid transpileOnServerWithErrorWindow(S snippetID, bool medium, final Runnable onSuccess, O... _) {
  nu(DaClass, paramsPlus(_, +snippetID, +onSuccess)).go(medium);
}
        
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: 410 / 591
Version history: 11 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1035543 - TranspileWithErrorWindow - successor of transpileOnServerWithErrorWindow