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

14
LINES

< > BotCompany Repo | #1007082 // callMethodThroughForm - definitely works if all parameters are strings

JavaX fragment (include)

1  
static void callMethodThroughForm(fS methodName, S paramNames) {
2  
  final L<S> params = splitAtSpace(paramNames);
3  
  // L<Class> types = methodArgumentTypes(methodName);
4  
  final Map<S, JComponent> map = litorderedmap();
5  
  for (S p : params)
6  
    map.put(p, jtextfield());
7  
  Runnable r = r {
8  
    new L l;
9  
    for (S p : params) l.add(getText((JTextField) map.get(p)));
10  
    call(mc(), methodName, toObjectArray(l));
11  
  };
12  
  renameSubmitButton("Call", showFormTitled("Call method " + methodName,
13  
    arrayPlus(mapToObjectArray(map), r)));
14  
}

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: #1007082
Snippet name: callMethodThroughForm - definitely works if all parameters are strings
Eternal ID of this version: #1007082/2
Text MD5: 3c695a8df49c9a38a9e2c186a175716c
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-03-02 17:34:13
Source code size: 546 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 507 / 495
Version history: 1 change(s)
Referenced in: [show references]