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

Method popupMenu

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

Shows or hides a popup menu with input completions.

()

Source from the content-addressed store, hash-verified

149 * Shows or hides a popup menu with input completions.
150 */
151 private void popupMenu() {
152 final String query = getText();
153
154 StringList list = null;
155 if(textField().getCaretPosition() == query.length()) {
156 final Data data = gui.context.data();
157 if(queryMode() && data != null) {
158 try(QueryContext qc = new QueryContext(gui.context)) {
159 list = qc.suggest(query, data);
160 }
161 } else if(cmdMode()) {
162 list = CommandParser.get(query, gui.context).suggest();
163 }
164 }
165
166 if(list != null) {
167 prefix = list.pop();
168 createCombo(list);
169 } else {
170 popup.setVisible(false);
171 }
172 }
173
174 /**
175 * Creates and shows the combo box.

Callers 3

keyPressedMethod · 0.95
keyReleasedMethod · 0.95
completeInputMethod · 0.95

Calls 11

queryModeMethod · 0.95
cmdModeMethod · 0.95
getMethod · 0.95
createComboMethod · 0.95
textFieldMethod · 0.80
setVisibleMethod · 0.80
getTextMethod · 0.45
lengthMethod · 0.45
dataMethod · 0.45
suggestMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected