Completes the input with the current combobox choice.
()
| 136 | * Completes the input with the current combobox choice. |
| 137 | */ |
| 138 | private void completeInput() { |
| 139 | final String suffix = completions.getSelectedItem(); |
| 140 | if(suffix.isEmpty()) return; |
| 141 | final int pl = prefix.length(), ll = pl > 0 ? prefix.charAt(pl - 1) : ' '; |
| 142 | if(Character.isLetter(ll) && Character.isLetter(suffix.charAt(0))) prefix += " "; |
| 143 | setText(prefix + suffix); |
| 144 | popupMenu(); |
| 145 | if(gui.gopts.get(GUIOptions.EXECRT) && !cmdMode()) gui.execute(); |
| 146 | } |
| 147 | |
| 148 | /** |
| 149 | * Shows or hides a popup menu with input completions. |