This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 215833
Collapse All | Expand All

(-)a/openide.awt/apichanges.xml (+14 lines)
Lines 50-55 Link Here
50
<apidef name="awt">AWT API</apidef>
50
<apidef name="awt">AWT API</apidef>
51
</apidefs>
51
</apidefs>
52
<changes>
52
<changes>
53
    <change id="QuickSearch.alwaysShown">
54
      <api name="awt"/>
55
      <summary>QuickSearch allows to customize of whether the quick search field should always be shown, or not.</summary>
56
      <version major="7" minor="49"/>
57
      <date day="30" month="7" year="2012"/>
58
      <author login="theofanis"/>
59
      <compatibility addition="yes" binary="compatible" source="compatible" deprecation="no" semantic="compatible" modification="no" deletion="no"/>
60
      <description>
61
          QuickSearch.isAlwaysShown() and QuickSearch.setAlwaysShown(boolean) methods are added.
62
          They can be used to change the default behavior of not showing the quick search field until something is typed.
63
      </description>
64
      <class package="org.openide.awt" name="QuickSearch"/>
65
        <issue number="215833"/>
66
    </change>
53
    <change id="CheckForUpdatesProvider">
67
    <change id="CheckForUpdatesProvider">
54
        <api name="awt"/>
68
        <api name="awt"/>
55
        <summary>Support for Check for Updates feature</summary>
69
        <summary>Support for Check for Updates feature</summary>
(-)a/openide.awt/manifest.mf (-1 / +1 lines)
Lines 2-6 Link Here
2
OpenIDE-Module: org.openide.awt
2
OpenIDE-Module: org.openide.awt
3
OpenIDE-Module-Localizing-Bundle: org/openide/awt/Bundle.properties
3
OpenIDE-Module-Localizing-Bundle: org/openide/awt/Bundle.properties
4
AutoUpdate-Essential-Module: true
4
AutoUpdate-Essential-Module: true
5
OpenIDE-Module-Specification-Version: 7.47
5
OpenIDE-Module-Specification-Version: 7.49
6
6
(-)a/openide.awt/src/org/openide/awt/QuickSearch.java (-1 / +32 lines)
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
        }

Return to bug 215833