Lines 84-89
Link Here
|
84 |
private final RequestProcessor rp; |
84 |
private final RequestProcessor rp; |
85 |
private static enum QS_FIRE { UPDATE, NEXT, MAX } |
85 |
private static enum QS_FIRE { UPDATE, NEXT, MAX } |
86 |
private AnimationTimer animationTimer; |
86 |
private AnimationTimer animationTimer; |
|
|
87 |
private boolean alwaysShown = false; |
87 |
|
88 |
|
88 |
private QuickSearch(JComponent component, Object constraints, |
89 |
private QuickSearch(JComponent component, Object constraints, |
89 |
Callback callback, boolean asynchronous, JMenu popupMenu) { |
90 |
Callback callback, boolean asynchronous, JMenu popupMenu) { |
Lines 202-207
Link Here
|
202 |
} |
203 |
} |
203 |
|
204 |
|
204 |
/** |
205 |
/** |
|
|
206 |
* Test whether the quick search field is always shown. |
207 |
* This is <code>false</code> by default. |
208 |
* @return <code>true</code> when the search field is always shown, |
209 |
* <code>false</code> otherwise. |
210 |
* @since 7.49 |
211 |
*/ |
212 |
public boolean isAlwaysShown() { |
213 |
return alwaysShown; |
214 |
} |
215 |
|
216 |
/** |
217 |
* Set whether the quick search field should always be shown. |
218 |
* @param alwaysShown <code>true</code> to always show the search field, |
219 |
* <code>false</code> otherwise. |
220 |
* @since 7.49 |
221 |
*/ |
222 |
public void setAlwaysShown(boolean alwaysShown) { |
223 |
this.alwaysShown = alwaysShown; |
224 |
if(alwaysShown) { |
225 |
displaySearchField(); |
226 |
} |
227 |
} |
228 |
|
229 |
/** |
205 |
* Test whether the quick search is enabled. This is <code>true</code> |
230 |
* Test whether the quick search is enabled. This is <code>true</code> |
206 |
* by default. |
231 |
* by default. |
207 |
* @return <code>true</code> when the quick search is enabled, |
232 |
* @return <code>true</code> when the quick search is enabled, |
Lines 322-328
Link Here
|
322 |
searchTextField.addKeyListener(searchFieldListener); |
347 |
searchTextField.addKeyListener(searchFieldListener); |
323 |
searchTextField.addFocusListener(searchFieldListener); |
348 |
searchTextField.addFocusListener(searchFieldListener); |
324 |
searchTextField.getDocument().addDocumentListener(searchFieldListener); |
349 |
searchTextField.getDocument().addDocumentListener(searchFieldListener); |
325 |
|
350 |
if(isAlwaysShown()) { |
|
|
351 |
displaySearchField(); |
352 |
} |
326 |
} |
353 |
} |
327 |
|
354 |
|
328 |
private void displaySearchField() { |
355 |
private void displaySearchField() { |
Lines 373-378
Link Here
|
373 |
} |
400 |
} |
374 |
|
401 |
|
375 |
private void removeSearchField() { |
402 |
private void removeSearchField() { |
|
|
403 |
if (isAlwaysShown()) { |
404 |
searchTextField.setText(""); |
405 |
return; |
406 |
} |
376 |
if (searchPanel == null) { |
407 |
if (searchPanel == null) { |
377 |
return; |
408 |
return; |
378 |
} |
409 |
} |