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

28
LINES

< > BotCompany Repo | #1016385 // DynSingleFunction

JavaX fragment (include)

static abstract class DynSingleFunction extends DynModule {
  transient S buttonText;
  
  *() {}
  *(S *buttonText) {}
  
  // call before visualize
  void setFunctionName(S name) { buttonText = name; }
  
  visualize {
    ret jfullcenter(withMargin(makeButtons()));
  }
  
  JComponent makeButtons() {
    ret jbutton(or2(buttonText, dm_moduleName()), rThread doItWithEnter);
  }
  
  abstract void doIt();
  
  void doItWithEnter() {
    temp enter();
    try {
      doIt();
    } catch e {
      print(getStackTrace(e));
    }
  }
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1016385
Snippet name: DynSingleFunction
Eternal ID of this version: #1016385/11
Text MD5: c031690ea56fd5d32be58ea510e49c16
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-10-10 17:43:30
Source code size: 565 bytes / 28 lines
Pitched / IR pitched: No / No
Views / Downloads: 360 / 1024
Version history: 10 change(s)
Referenced in: [show references]