MCPcopy Create free account
hub / github.com/BaseXdb/basex / createCombo

Method createCombo

basex-core/src/main/java/org/basex/gui/GUIInput.java:178–191  ·  view source on GitHub ↗

Creates and shows the combo box. @param sl strings to be added

(final StringList sl)

Source from the content-addressed store, hash-verified

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.

Callers 1

popupMenuMethod · 0.95

Calls 8

completionsChangedMethod · 0.95
setVisibleMethod · 0.80
setItemsMethod · 0.80
stringWidthMethod · 0.80
isEmptyMethod · 0.45
toArrayMethod · 0.45
showMethod · 0.45
minMethod · 0.45

Tested by

no test coverage detected