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)

static void callMethodThroughForm(fS methodName, S paramNames) {
  final L<S> params = splitAtSpace(paramNames);
  // L<Class> types = methodArgumentTypes(methodName);
  final Map<S, JComponent> map = litorderedmap();
  for (S p : params)
    map.put(p, jtextfield());
  Runnable r = r {
    new L l;
    for (S p : params) l.add(getText((JTextField) map.get(p)));
    call(mc(), methodName, toObjectArray(l));
  };
  renameSubmitButton("Call", showFormTitled("Call method " + methodName,
    arrayPlus(mapToObjectArray(map), r)));
}

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: 425 / 417
Version history: 1 change(s)
Referenced in: [show references]