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 215688
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.dismissOnFocusLost">
54
      <api name="awt"/>
55
      <summary>QuickSearch allows to customize of whether the quick search field should dismiss on focus lost, or not.</summary>
56
      <version major="7" minor="48"/>
57
      <date day="25" month="7" year="2012"/>
58
      <author login="mentlicher"/>
59
      <compatibility addition="yes" binary="compatible" source="compatible" deprecation="no" semantic="compatible" modification="no" deletion="no"/>
60
      <description>
61
          QuickSearch.isDismissOnFocusLost() and QuickSearch.setDismissOnFocusLost(boolean) methods are added.
62
          They can be used to change the default behavior of automatic dismiss of the quick search field on focus lost.
63
      </description>
64
      <class package="org.openide.awt" name="QuickSearch"/>
65
        <issue number="215688"/>
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.48
6
6
(-)a/openide.awt/src/org/openide/awt/QuickSearch.java (-1 / +30 lines)
Lines 77-82 Link Here
77
    private final JMenu popupMenu;
77
    private final JMenu popupMenu;
78
    private final boolean asynchronous;
78
    private final boolean asynchronous;
79
    private boolean enabled = true;
79
    private boolean enabled = true;
80
    private boolean dismissOnFocusLost = true;
80
    private SearchTextField searchTextField;
81
    private SearchTextField searchTextField;
81
    private KeyAdapter quickSearchKeyAdapter;
82
    private KeyAdapter quickSearchKeyAdapter;
82
    private SearchFieldListener searchFieldListener;
83
    private SearchFieldListener searchFieldListener;
Lines 231-236 Link Here
231
    }
232
    }
232
    
233
    
233
    /**
234
    /**
235
     * Test whether the quick search field is automatically dismissed,
236
     * when it loses focus. This is <code>true</code> by default.
237
     * @return <code>true</code> when the search field is dismissed on focus lost,
238
     *         <code>false</code> otherwise.
239
     * @since 7.48
240
     */
241
    public boolean isDismissOnFocusLost() {
242
        return dismissOnFocusLost;
243
    }
244
    
245
    /**
246
     * Set whether the quick search field should be automatically dismissed,
247
     * when it loses focus.
248
     * @param dismissOnFocusLost <code>true</code> to automatically dismiss
249
     *                                             the search field on focus lost,
250
     *                           <code>false</code> to ignore focus lost.
251
     * @since 7.48
252
     */
253
    public void setDismissOnFocusLost(boolean dismissOnFocusLost) {
254
        this.dismissOnFocusLost = dismissOnFocusLost;
255
    }
256
    
257
    /**
234
     * Process this key event in addition to the key events obtained from the
258
     * Process this key event in addition to the key events obtained from the
235
     * component we're attached to.
259
     * component we're attached to.
236
     * @param ke a key event to process.
260
     * @param ke a key event to process.
Lines 702-707 Link Here
702
726
703
        @Override
727
        @Override
704
        public void focusGained(FocusEvent e) {
728
        public void focusGained(FocusEvent e) {
729
            if (!isDismissOnFocusLost()) {
730
                return ;
731
            }
705
            if (e.getSource() == searchTextField) {
732
            if (e.getSource() == searchTextField) {
706
                // make sure nothing is selected
733
                // make sure nothing is selected
707
                int n = searchTextField.getText().length();
734
                int n = searchTextField.getText().length();
Lines 711-717 Link Here
711
738
712
        @Override
739
        @Override
713
        public void focusLost(FocusEvent e) {
740
        public void focusLost(FocusEvent e) {
714
            if (e.isTemporary()) return ;
741
            if (e.isTemporary() || !isDismissOnFocusLost()) {
742
                return ;
743
            }
715
            Component oppositeComponent = e.getOppositeComponent();
744
            Component oppositeComponent = e.getOppositeComponent();
716
            if (e.getSource() != searchTextField) {
745
            if (e.getSource() != searchTextField) {
717
                ((Component) e.getSource()).removeFocusListener(this);
746
                ((Component) e.getSource()).removeFocusListener(this);

Return to bug 215688