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

31
LINES

< > BotCompany Repo | #1010517 // replaceConsoleInputWithAutoComboBox - experimental

JavaX fragment (include)

1  
static AutoComboBox replaceConsoleInputWithAutoComboBox() {
2  
  ret replaceConsoleInputWithAutoComboBox(new L);
3  
}
4  
5  
static AutoComboBox replaceConsoleInputWithAutoComboBox(final Collection<S> items) {
6  
  // Upgrade JavaX in place
7  
  if (getOpt(javax(), 'generalMap) == null) {
8  
    run(#1001639);
9  
    restart();
10  
    sleep();
11  
  }
12  
      
13  
  ret swing(func -> AutoComboBox {
14  
    final AutoComboBox cb = autoComboBox(items);
15  
    
16  
    onEnter(cb, r {
17  
      PipedOutputStream pout3 = cast _get(javax(), 'pout3);
18  
      S line = getText(cb);
19  
      try {
20  
        pout3.write(toUtf8(line + "\n"));
21  
        pout3.flush();
22  
      } catch (Exception e) {}
23  
      cb.getEditor().selectAll();
24  
    });
25  
    
26  
    awtReplaceComponent(consoleInputField(), cb);
27  
    setOpt(_get(javax(), 'console), cbInput := cb);
28  
    setOpt(_get(javax(), 'console), tfInput := cb.getEditor().getEditorComponent());
29  
    ret cb;
30  
  });
31  
}

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: #1010517
Snippet name: replaceConsoleInputWithAutoComboBox - experimental
Eternal ID of this version: #1010517/16
Text MD5: cb4decbd94089f956cf2f50416c432e0
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-09-19 19:33:30
Source code size: 918 bytes / 31 lines
Pitched / IR pitched: No / No
Views / Downloads: 374 / 392
Version history: 15 change(s)
Referenced in: [show references]