Creates and shows the combo box. @param sl strings to be added
(final StringList sl)
| 176 | * @param sl strings to be added |
| 177 | */ |
| 178 | private void createCombo(final StringList sl) { |
| 179 | if(sl == null || sl.isEmpty()) { |
| 180 | popup.setVisible(false); |
| 181 | return; |
| 182 | } |
| 183 | if(completionsChanged(sl)) { |
| 184 | completions.setItems(sl.toArray()); |
| 185 | completions.setSelectedIndex(-1); |
| 186 | popup = new GUIInputPopup(completions); |
| 187 | } |
| 188 | |
| 189 | final int w = getFontMetrics(getFont()).stringWidth(prefix); |
| 190 | popup.show(this, Math.min(getWidth(), w), getHeight()); |
| 191 | } |
| 192 | |
| 193 | /** |
| 194 | * Tests if the combo box entries have changed. |
no test coverage detected