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]

Libraryless. Click here for Pure Java version (11429L/87K).

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, "Medium transpile", rThread {
            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/11
Text MD5: 758dc256dd1b57708ee9747a614f2297
Transpilation MD5: 9149fb516f51267c12d1671dd71eebc3
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-08-28 14:05:18
Source code size: 1266 bytes / 38 lines
Pitched / IR pitched: No / No
Views / Downloads: 209 / 318
Version history: 10 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1018437 & http://1018437.tinybrain.de