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 210700
Collapse All | Expand All

(-)a/editor.lib2/manifest.mf (-1 / +1 lines)
Lines 1-6 Link Here
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
OpenIDE-Module: org.netbeans.modules.editor.lib2/1
2
OpenIDE-Module: org.netbeans.modules.editor.lib2/1
3
OpenIDE-Module-Implementation-Version: 29
3
OpenIDE-Module-Implementation-Version: 30
4
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/editor/lib2/Bundle.properties
4
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/editor/lib2/Bundle.properties
5
OpenIDE-Module-Layer: org/netbeans/modules/editor/lib2/resources/layer.xml
5
OpenIDE-Module-Layer: org/netbeans/modules/editor/lib2/resources/layer.xml
6
OpenIDE-Module-Needs: org.netbeans.modules.editor.actions
6
OpenIDE-Module-Needs: org.netbeans.modules.editor.actions
(-)a/editor.lib2/src/org/netbeans/modules/editor/lib2/search/EditorFindSupport.java (-2 / +9 lines)
Lines 57-62 Link Here
57
import java.util.WeakHashMap;
57
import java.util.WeakHashMap;
58
import java.util.logging.Level;
58
import java.util.logging.Level;
59
import java.util.logging.Logger;
59
import java.util.logging.Logger;
60
import java.util.prefs.Preferences;
60
import javax.swing.text.JTextComponent;
61
import javax.swing.text.JTextComponent;
61
import javax.swing.text.BadLocationException;
62
import javax.swing.text.BadLocationException;
62
import javax.swing.text.Caret;
63
import javax.swing.text.Caret;
Lines 64-70 Link Here
64
import javax.swing.text.PlainDocument;
65
import javax.swing.text.PlainDocument;
65
import javax.swing.text.Position;
66
import javax.swing.text.Position;
66
import org.netbeans.api.editor.EditorRegistry;
67
import org.netbeans.api.editor.EditorRegistry;
68
import org.netbeans.api.editor.mimelookup.MimeLookup;
69
import org.netbeans.api.editor.mimelookup.MimePath;
67
import org.netbeans.api.editor.settings.FontColorNames;
70
import org.netbeans.api.editor.settings.FontColorNames;
71
import org.netbeans.api.editor.settings.SimpleValueNames;
68
import org.netbeans.modules.editor.lib2.ComponentUtils;
72
import org.netbeans.modules.editor.lib2.ComponentUtils;
69
import org.netbeans.modules.editor.lib2.DocUtils;
73
import org.netbeans.modules.editor.lib2.DocUtils;
70
import org.netbeans.modules.editor.lib2.highlighting.BlockHighlighting;
74
import org.netbeans.modules.editor.lib2.highlighting.BlockHighlighting;
Lines 354-361 Link Here
354
                                false
358
                                false
355
                            );
359
                            );
356
                        }
360
                        }
357
361
                        Preferences prefs = MimeLookup.getLookup(MimePath.EMPTY).lookup(Preferences.class);
358
                        selectText(comp, pos, pos + len, back);
362
                        if (prefs.get(SimpleValueNames.EDITOR_SEARCH_TYPE, "default").equals("closing")) // NOI18N
363
                            ensureVisible(comp, pos, pos);
364
                        else
365
                            selectText(comp, pos, pos + len, back);
359
                        return true;
366
                        return true;
360
                    }
367
                    }
361
                }
368
                }
(-)a/editor.search/nbproject/project.properties (-1 / +1 lines)
Lines 1-3 Link Here
1
javac.source=1.6
1
javac.source=1.6
2
javac.compilerargs=-Xlint -Xlint:-serial
2
javac.compilerargs=-Xlint -Xlint:-serial
3
spec.version.base=1.1
3
spec.version.base=1.2
(-)a/editor.search/nbproject/project.xml (+9 lines)
Lines 51-56 Link Here
51
                    </run-dependency>
51
                    </run-dependency>
52
                </dependency>
52
                </dependency>
53
                <dependency>
53
                <dependency>
54
                    <code-name-base>org.netbeans.modules.editor.settings</code-name-base>
55
                    <build-prerequisite/>
56
                    <compile-dependency/>
57
                    <run-dependency>
58
                        <release-version>1</release-version>
59
                        <specification-version>1.40</specification-version>
60
                    </run-dependency>
61
                </dependency>
62
                <dependency>
54
                    <code-name-base>org.netbeans.modules.editor.util</code-name-base>
63
                    <code-name-base>org.netbeans.modules.editor.util</code-name-base>
55
                    <build-prerequisite/>
64
                    <build-prerequisite/>
56
                    <compile-dependency/>
65
                    <compile-dependency/>
(-)a/editor.search/src/org/netbeans/modules/editor/search/ReplaceBar.java (-7 lines)
Lines 63-69 Link Here
63
63
64
    private static ReplaceBar replacebarInstance = null;
64
    private static ReplaceBar replacebarInstance = null;
65
    private static final Logger LOG = Logger.getLogger(ReplaceBar.class.getName());
65
    private static final Logger LOG = Logger.getLogger(ReplaceBar.class.getName());
66
    private static final boolean CLOSE_ON_ENTER = Boolean.getBoolean("org.netbeans.modules.editor.search.closeOnEnter"); // NOI18N
67
    private static final Insets BUTTON_INSETS = new Insets(2, 1, 0, 1);
66
    private static final Insets BUTTON_INSETS = new Insets(2, 1, 0, 1);
68
    private SearchBar searchBar;
67
    private SearchBar searchBar;
69
    private final JComboBox replaceComboBox;
68
    private final JComboBox replaceComboBox;
Lines 245-253 Link Here
245
            @Override
244
            @Override
246
            public void actionPerformed(ActionEvent e) {
245
            public void actionPerformed(ActionEvent e) {
247
                replace();
246
                replace();
248
                if (CLOSE_ON_ENTER) {
249
                    looseFocus();
250
                }
251
            }
247
            }
252
        });
248
        });
253
    }
249
    }
Lines 262-270 Link Here
262
            @Override
258
            @Override
263
            public void actionPerformed(ActionEvent e) {
259
            public void actionPerformed(ActionEvent e) {
264
                replaceAll();
260
                replaceAll();
265
                if (CLOSE_ON_ENTER) {
266
                    looseFocus();
267
                }
268
            }
261
            }
269
        });
262
        });
270
    }
263
    }
(-)a/editor.search/src/org/netbeans/modules/editor/search/SearchBar.java (-33 / +45 lines)
Lines 39-48 Link Here
39
 */
39
 */
40
package org.netbeans.modules.editor.search;
40
package org.netbeans.modules.editor.search;
41
41
42
import java.awt.Color;
42
import java.awt.*;
43
import java.awt.Dimension;
44
import java.awt.Insets;
45
import java.awt.Toolkit;
46
import java.awt.event.*;
43
import java.awt.event.*;
47
import java.beans.PropertyChangeEvent;
44
import java.beans.PropertyChangeEvent;
48
import java.beans.PropertyChangeListener;
45
import java.beans.PropertyChangeListener;
Lines 52-58 Link Here
52
import java.util.List;
49
import java.util.List;
53
import java.util.Map;
50
import java.util.Map;
54
import java.util.logging.Level;
51
import java.util.logging.Level;
52
import java.util.logging.LogRecord;
55
import java.util.logging.Logger;
53
import java.util.logging.Logger;
54
import java.util.prefs.Preferences;
56
import java.util.regex.Pattern;
55
import java.util.regex.Pattern;
57
import java.util.regex.PatternSyntaxException;
56
import java.util.regex.PatternSyntaxException;
58
import javax.swing.*;
57
import javax.swing.*;
Lines 63-68 Link Here
63
import javax.swing.text.*;
62
import javax.swing.text.*;
64
import org.netbeans.api.editor.EditorRegistry;
63
import org.netbeans.api.editor.EditorRegistry;
65
import org.netbeans.api.editor.mimelookup.MimeLookup;
64
import org.netbeans.api.editor.mimelookup.MimeLookup;
65
import org.netbeans.api.editor.mimelookup.MimePath;
66
import org.netbeans.api.editor.settings.SimpleValueNames;
66
import org.netbeans.editor.BaseDocument;
67
import org.netbeans.editor.BaseDocument;
67
import org.netbeans.editor.BaseKit;
68
import org.netbeans.editor.BaseKit;
68
import org.netbeans.editor.MultiKeymap;
69
import org.netbeans.editor.MultiKeymap;
Lines 83-89 Link Here
83
public final class SearchBar extends JPanel {
84
public final class SearchBar extends JPanel {
84
    private static SearchBar searchbarInstance = null;
85
    private static SearchBar searchbarInstance = null;
85
    private static final Logger LOG = Logger.getLogger(SearchBar.class.getName());
86
    private static final Logger LOG = Logger.getLogger(SearchBar.class.getName());
86
    private static final boolean CLOSE_ON_ENTER = Boolean.getBoolean("org.netbeans.modules.editor.search.closeOnEnter"); // NOI18N
87
    private static final Insets BUTTON_INSETS = new Insets(2, 1, 0, 1);
87
    private static final Insets BUTTON_INSETS = new Insets(2, 1, 0, 1);
88
    private static final Color NOT_FOUND = Color.RED.darker();
88
    private static final Color NOT_FOUND = Color.RED.darker();
89
    private static final Color INVALID_REGEXP = Color.red;
89
    private static final Color INVALID_REGEXP = Color.red;
Lines 110-117 Link Here
110
    private final JButton closeButton;
110
    private final JButton closeButton;
111
    private final SearchExpandMenu expandMenu;
111
    private final SearchExpandMenu expandMenu;
112
    private Map<String, Object> findProps = EditorFindSupport.getInstance().getFindProperties();
112
    private Map<String, Object> findProps = EditorFindSupport.getInstance().getFindProperties();
113
    private boolean searched = false;
114
    private boolean popupMenuWasCanceled = false;
113
    private boolean popupMenuWasCanceled = false;
114
    private Rectangle actualViewPort;
115
115
116
    public static SearchBar getInstance() {
116
    public static SearchBar getInstance() {
117
        if (searchbarInstance == null) {
117
        if (searchbarInstance == null) {
Lines 226-231 Link Here
226
226
227
        makeBarExpandable(expandMenu);
227
        makeBarExpandable(expandMenu);
228
        setVisible(false);       
228
        setVisible(false);       
229
        usageLogging();
230
    }
231
    
232
    private static void usageLogging() {
233
        Logger logger = Logger.getLogger("org.netbeans.ui.metrics.editor"); // NOI18N
234
        LogRecord rec = new LogRecord(Level.INFO, "USG_SEARCH_TYPE"); // NOI18N
235
        Preferences prefs = MimeLookup.getLookup(MimePath.EMPTY).lookup(Preferences.class);
236
        rec.setParameters(new Object[] {prefs.get(SimpleValueNames.EDITOR_SEARCH_TYPE, "default")}); // NOI18N
237
        rec.setLoggerName(logger.getName());
238
        logger.log(rec);
229
    }
239
    }
230
    
240
    
231
    private void makeBarExpandable(SearchExpandMenu expMenu) {
241
    private void makeBarExpandable(SearchExpandMenu expMenu) {
Lines 266-271 Link Here
266
                    return;
276
                    return;
267
                }
277
                }
268
                hadFocusOnIncSearchTextField = false;
278
                hadFocusOnIncSearchTextField = false;
279
                if (isClosingSearchType() && !ReplaceBar.getInstance(SearchBar.getInstance()).isVisible())
280
                    looseFocus();
269
            }
281
            }
270
        };
282
        };
271
    }
283
    }
Lines 341-349 Link Here
341
            @Override
353
            @Override
342
            public void actionPerformed(ActionEvent e) {
354
            public void actionPerformed(ActionEvent e) {
343
                findPrevious();
355
                findPrevious();
344
                if (CLOSE_ON_ENTER) {
345
                    looseFocus();
346
                }
347
            }
356
            }
348
        });
357
        });
349
    }
358
    }
Lines 358-364 Link Here
358
            @Override
367
            @Override
359
            public void actionPerformed(ActionEvent e) {
368
            public void actionPerformed(ActionEvent e) {
360
                findNext();
369
                findNext();
361
                if (CLOSE_ON_ENTER) {
370
                if (isClosingSearchType() && !ReplaceBar.getInstance(SearchBar.getInstance()).isVisible()) {
362
                    looseFocus();
371
                    looseFocus();
363
                }
372
                }
364
            }
373
            }
Lines 381-392 Link Here
381
390
382
            @Override
391
            @Override
383
            public void changedUpdate(DocumentEvent e) {
392
            public void changedUpdate(DocumentEvent e) {
384
                searched = false;
385
            }
393
            }
386
394
387
            @Override
395
            @Override
388
            public void insertUpdate(DocumentEvent e) {
396
            public void insertUpdate(DocumentEvent e) {
389
                searched = false;
390
                // text changed - attempt incremental search
397
                // text changed - attempt incremental search
391
                if (incSearchTextField.getText().length() > 3) {
398
                if (incSearchTextField.getText().length() > 3) {
392
                    searchDelayTimer.setInitialDelay(SEARCH_DELAY_TIME_SHORT);
399
                    searchDelayTimer.setInitialDelay(SEARCH_DELAY_TIME_SHORT);
Lines 396-402 Link Here
396
403
397
            @Override
404
            @Override
398
            public void removeUpdate(DocumentEvent e) {
405
            public void removeUpdate(DocumentEvent e) {
399
                searched = false;
400
                // text changed - attempt incremental search
406
                // text changed - attempt incremental search
401
                if (incSearchTextField.getText().length() <= 3) {
407
                if (incSearchTextField.getText().length() <= 3) {
402
                    searchDelayTimer.setInitialDelay(SEARCH_DELAY_TIME_LONG);
408
                    searchDelayTimer.setInitialDelay(SEARCH_DELAY_TIME_LONG);
Lines 405-411 Link Here
405
            }
411
            }
406
        };
412
        };
407
    }
413
    }
408
414
    
409
    private JButton createCloseButton() {
415
    private JButton createCloseButton() {
410
        JButton button = CloseButtonFactory.createBigCloseButton();
416
        JButton button = CloseButtonFactory.createBigCloseButton();
411
        button.addActionListener(new ActionListener() {
417
        button.addActionListener(new ActionListener() {
Lines 565-581 Link Here
565
571
566
            @Override
572
            @Override
567
            public void actionPerformed(ActionEvent e) {
573
            public void actionPerformed(ActionEvent e) {
568
                if (CLOSE_ON_ENTER && !searched) {
574
                if (!popupMenuWasCanceled) {
569
                    findNext();
575
                    looseFocus();                
570
                }
576
                    if (isClosingSearchType())           
571
                if (!popupMenuWasCanceled)
577
                        getActualTextComponent().scrollRectToVisible(actualViewPort);
572
                    looseFocus();
578
                } else
573
                else
574
                    popupMenuWasCanceled = false;
579
                    popupMenuWasCanceled = false;
575
            }
580
            }
576
        });
581
        });
577
    }
582
    }
578
583
584
    private static boolean isClosingSearchType() {
585
        Preferences prefs = MimeLookup.getLookup(MimePath.EMPTY).lookup(Preferences.class);
586
        return prefs.get(SimpleValueNames.EDITOR_SEARCH_TYPE, "default").equals("closing"); // NOI18N
587
    }
588
    
579
    public void gainFocus() {
589
    public void gainFocus() {
580
        incSearchTextField.getDocument().removeDocumentListener(incSearchTextFieldListener);
590
        incSearchTextField.getDocument().removeDocumentListener(incSearchTextFieldListener);
581
        SearchComboBoxEditor.changeToOneLineEditorPane((JEditorPane) incSearchTextField);
591
        SearchComboBoxEditor.changeToOneLineEditorPane((JEditorPane) incSearchTextField);
Lines 605-619 Link Here
605
            findPreviousButton.setEnabled(false);
615
            findPreviousButton.setEnabled(false);
606
            findNextButton.setEnabled(false);
616
            findNextButton.setEnabled(false);
607
        }
617
        }
608
        searched = false;
618
        actualViewPort = getActualTextComponent().getVisibleRect();
609
    }
619
    }
610
620
    
611
    public void looseFocus() {
621
    public void looseFocus() {
612
        hadFocusOnIncSearchTextField = false;
622
        hadFocusOnIncSearchTextField = false;
613
        if (!isVisible()) {
623
        if (!isVisible()) {
614
            return;
624
            return;
615
        }
625
        }
616
        org.netbeans.api.editor.completion.Completion.get().hideAll();
617
        EditorFindSupport.getInstance().setBlockSearchHighlight(0, 0);
626
        EditorFindSupport.getInstance().setBlockSearchHighlight(0, 0);
618
        EditorFindSupport.getInstance().incSearchReset();
627
        EditorFindSupport.getInstance().incSearchReset();
619
        EditorFindSupport.getInstance().setFocusedTextComponent(null);
628
        EditorFindSupport.getInstance().setFocusedTextComponent(null);
Lines 643-648 Link Here
643
652
644
        // search starting at current caret position
653
        // search starting at current caret position
645
        int caretPosition = getActualTextComponent().getSelectionStart();
654
        int caretPosition = getActualTextComponent().getSelectionStart();
655
        if (isClosingSearchType())
656
            caretPosition = getActualTextComponent().getCaretPosition();
646
        if (regexpCheckBox.isSelected()) {
657
        if (regexpCheckBox.isSelected()) {
647
            Pattern pattern;
658
            Pattern pattern;
648
            String patternErrorMsg = null;
659
            String patternErrorMsg = null;
Lines 667-673 Link Here
667
                // text found - reset incremental search text field's foreground
678
                // text found - reset incremental search text field's foreground
668
                incSearchTextField.setForeground(DEFAULT_FG_COLOR); //NOI18N
679
                incSearchTextField.setForeground(DEFAULT_FG_COLOR); //NOI18N
669
                org.netbeans.editor.Utilities.setStatusText(getActualTextComponent(), "", StatusDisplayer.IMPORTANCE_INCREMENTAL_FIND);
680
                org.netbeans.editor.Utilities.setStatusText(getActualTextComponent(), "", StatusDisplayer.IMPORTANCE_INCREMENTAL_FIND);
670
                searched = true;
671
            } else {
681
            } else {
672
                // text not found - indicate error in incremental search
682
                // text not found - indicate error in incremental search
673
                // text field with red foreground
683
                // text field with red foreground
Lines 701-707 Link Here
701
        if (findSupport.find(actualfindProps, !next) || empty) {
711
        if (findSupport.find(actualfindProps, !next) || empty) {
702
            // text found - reset incremental search text field's foreground
712
            // text found - reset incremental search text field's foreground
703
            incSearchTextField.setForeground(DEFAULT_FG_COLOR); //NOI18N
713
            incSearchTextField.setForeground(DEFAULT_FG_COLOR); //NOI18N
704
            searched = true;
705
        } else {
714
        } else {
706
            // text not found - indicate error in incremental search text field with red foreground
715
            // text not found - indicate error in incremental search text field with red foreground
707
            incSearchTextField.setForeground(NOT_FOUND);
716
            incSearchTextField.setForeground(NOT_FOUND);
Lines 744-750 Link Here
744
                        selText = selText.substring(0, n);
753
                        selText = selText.substring(0, n);
745
                    }
754
                    }
746
                    incSearchTextField.setText(selText);
755
                    incSearchTextField.setText(selText);
747
                } 
756
                } else {
757
                    if (isClosingSearchType()) {
758
                        String findWhat = (String) EditorFindSupport.getInstance().getFindProperty(EditorFindSupport.FIND_WHAT);
759
                        if (findWhat != null && findWhat.length() > 0) {
760
                            incSearchTextField.getDocument().removeDocumentListener(incSearchTextFieldListener);
761
                            incSearchTextField.setText(findWhat);
762
                            incSearchTextField.getDocument().addDocumentListener(incSearchTextFieldListener);
763
                        }
764
                    }
765
                        
766
                }
748
            }
767
            }
749
768
750
            int blockSearchStartOffset = blockSearchVisible ? startSelection : 0;
769
            int blockSearchStartOffset = blockSearchVisible ? startSelection : 0;
Lines 854-866 Link Here
854
        return regexpCheckBox;
873
        return regexpCheckBox;
855
    }
874
    }
856
875
857
    boolean isSearched() {
858
        return searched;
859
    }
860
861
    void setSearched(boolean searched) {
862
        this.searched = searched;
863
    }
864
876
865
    JComponent getExpandButton() {
877
    JComponent getExpandButton() {
866
        return expandMenu.getExpandButton();
878
        return expandMenu.getExpandButton();
(-)a/editor.settings/apichanges.xml (+14 lines)
Lines 107-112 Link Here
107
    <!-- ACTUAL CHANGES BEGIN HERE: -->
107
    <!-- ACTUAL CHANGES BEGIN HERE: -->
108
108
109
    <changes>
109
    <changes>
110
        
111
        <change id="added.SimpleValueNames.EDITOR_SEARCH_TYPE">
112
            <summary>Adding SimpleValueNames.EDITOR_SEARCH_TYPE</summary>
113
            <version major="1" minor="40"/>
114
            <date day="6" month="4" year="2012"/>
115
            <author login="mkristofic"/>
116
            <compatibility binary="compatible" source="compatible" semantic="compatible" addition="yes" deprecation="no" deletion="no" modification="no" />
117
            <description>
118
            <p>
119
                Adding new constant <code>SimpleValueNames.EDITOR_SEARCH_TYPE</code>.
120
            </p>
121
            </description>
122
            <issue number="210700"/>
123
        </change>
110
124
111
        <change id="added.SimpleValueNames.ON_SAVE_REMOVE_TRAILING_WHITESPACE">
125
        <change id="added.SimpleValueNames.ON_SAVE_REMOVE_TRAILING_WHITESPACE">
112
            <summary>Adding SimpleValueNames.ON_SAVE_REMOVE_TRAILING_WHITESPACE</summary>
126
            <summary>Adding SimpleValueNames.ON_SAVE_REMOVE_TRAILING_WHITESPACE</summary>
(-)a/editor.settings/manifest.mf (-1 / +1 lines)
Lines 1-5 Link Here
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
OpenIDE-Module: org.netbeans.modules.editor.settings/1
2
OpenIDE-Module: org.netbeans.modules.editor.settings/1
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/editor/settings/Bundle.properties
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/editor/settings/Bundle.properties
4
OpenIDE-Module-Specification-Version: 1.39
4
OpenIDE-Module-Specification-Version: 1.40
5
OpenIDE-Module-Needs: org.netbeans.api.editor.settings.implementation
5
OpenIDE-Module-Needs: org.netbeans.api.editor.settings.implementation
(-)a/editor.settings/src/org/netbeans/api/editor/settings/SimpleValueNames.java (+10 lines)
Lines 437-442 Link Here
437
     */
437
     */
438
    public static final String ON_SAVE_REMOVE_TRAILING_WHITESPACE = "on-save-remove-trailing-whitespace"; //NOI18N
438
    public static final String ON_SAVE_REMOVE_TRAILING_WHITESPACE = "on-save-remove-trailing-whitespace"; //NOI18N
439
439
440
    /**
441
     * Determines editor search type.
442
     * Values: java.lang.String instances
443
     * <ul>
444
     * <li>default
445
     * <li>closing
446
     * </ul>
447
     */
448
    public static final String EDITOR_SEARCH_TYPE = "editor-search-type"; //NOI18N
449
440
    @PatchedPublic
450
    @PatchedPublic
441
    private SimpleValueNames() {
451
    private SimpleValueNames() {
442
        // to prevent instantialization
452
        // to prevent instantialization
(-)a/options.editor/manifest.mf (-1 / +1 lines)
Lines 2-7 Link Here
2
OpenIDE-Module: org.netbeans.modules.options.editor/1
2
OpenIDE-Module: org.netbeans.modules.options.editor/1
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/options/editor/Bundle.properties
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/options/editor/Bundle.properties
4
OpenIDE-Module-Layer: org/netbeans/modules/options/editor/mf-layer.xml
4
OpenIDE-Module-Layer: org/netbeans/modules/options/editor/mf-layer.xml
5
OpenIDE-Module-Specification-Version: 1.29
5
OpenIDE-Module-Specification-Version: 1.30
6
AutoUpdate-Show-In-Client: false
6
AutoUpdate-Show-In-Client: false
7
7
(-)a/options.editor/nbproject/project.xml (-2 / +2 lines)
Lines 100-106 Link Here
100
                    <compile-dependency/>
100
                    <compile-dependency/>
101
                    <run-dependency>
101
                    <run-dependency>
102
                        <release-version>1</release-version>
102
                        <release-version>1</release-version>
103
                        <specification-version>1.33</specification-version>
103
                        <specification-version>1.40</specification-version>
104
                    </run-dependency>
104
                    </run-dependency>
105
                </dependency>
105
                </dependency>
106
                <dependency>
106
                <dependency>
Lines 372-378 Link Here
372
                <friend>org.netbeans.modules.versioning.util</friend>
372
                <friend>org.netbeans.modules.versioning.util</friend>
373
                <friend>org.netbeans.modules.web.project</friend>
373
                <friend>org.netbeans.modules.web.project</friend>
374
                <friend>org.netbeans.spi.java.hints</friend>
374
                <friend>org.netbeans.spi.java.hints</friend>
375
                <friend>org.netbeans.modules.java.hints.ui</friend>                
375
                <friend>org.netbeans.modules.java.hints.ui</friend>
376
                <package>org.netbeans.modules.options.colors</package>
376
                <package>org.netbeans.modules.options.colors</package>
377
                <package>org.netbeans.modules.options.colors.spi</package>
377
                <package>org.netbeans.modules.options.colors.spi</package>
378
                <package>org.netbeans.modules.options.editor.spi</package>
378
                <package>org.netbeans.modules.options.editor.spi</package>
(-)a/options.editor/src/org/netbeans/modules/options/generaleditor/Bundle.properties (+6 lines)
Lines 108-113 Link Here
108
CTL_Remove_Trailing_Whitespace=Remove Trailing Whitespace
108
CTL_Remove_Trailing_Whitespace=Remove Trailing Whitespace
109
AN_Remove_Trailing_Whitespace=Remove Trailing Whitespace
109
AN_Remove_Trailing_Whitespace=Remove Trailing Whitespace
110
AD_Remove_Trailing_Whitespace=Remove Trailing Whitespace
110
AD_Remove_Trailing_Whitespace=Remove Trailing Whitespace
111
CTL_Editor_Search_Type=Editor Search Type
112
AN_Editor_Search_Type=Editor Search Type
113
AD_Editor_Search_Type=Editor Search Type
114
EST_closing=Closing
115
EST_default=Default
116
Editor_Search_Type_Tooltip= In Closing type Enter accepts search match, Esc jumps to start. Both close searchbar. Default type closes searchbar by Esc or button. Enter means find a new instance.
111
RTW_never=Never
117
RTW_never=Never
112
RTW_always=Always
118
RTW_always=Always
113
RTW_modified-lines=From Modified Lines Only
119
RTW_modified-lines=From Modified Lines Only
(-)a/options.editor/src/org/netbeans/modules/options/generaleditor/GeneralEditorPanel.form (-53 / +99 lines)
Lines 1-4 Link Here
1
<?xml version="1.1" encoding="UTF-8" ?>
1
<?xml version="1.0" encoding="UTF-8" ?>
2
2
3
<Form version="1.3" maxVersion="1.3" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
3
<Form version="1.3" maxVersion="1.3" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
4
  <Properties>
4
  <Properties>
Lines 21-77 Link Here
21
  <Layout>
21
  <Layout>
22
    <DimensionLayout dim="0">
22
    <DimensionLayout dim="0">
23
      <Group type="103" groupAlignment="0" attributes="0">
23
      <Group type="103" groupAlignment="0" attributes="0">
24
          <Group type="102" attributes="0">
25
              <EmptySpace max="-2" attributes="0"/>
26
              <Group type="103" groupAlignment="0" attributes="0">
27
                  <Component id="lUseCodeFolding" alignment="0" min="-2" max="-2" attributes="0"/>
28
                  <Component id="lCollapseByDefault" alignment="0" min="-2" max="-2" attributes="0"/>
29
                  <Component id="lRemoveTrailingWhitespace" alignment="0" min="-2" max="-2" attributes="0"/>
30
              </Group>
31
              <EmptySpace max="-2" attributes="0"/>
32
              <Group type="103" groupAlignment="0" attributes="0">
33
                  <Component id="lCamelCaseBehaviorExample" min="-2" max="-2" attributes="0"/>
34
                  <Component id="cboRemoveTrailingWhitespace" alignment="0" min="-2" max="-2" attributes="0"/>
35
              </Group>
36
              <EmptySpace max="32767" attributes="0"/>
37
          </Group>
38
          <Group type="102" alignment="0" attributes="0">
39
              <EmptySpace min="155" pref="155" max="155" attributes="0"/>
40
              <Component id="cbCamelCaseBehavior" min="-2" max="-2" attributes="0"/>
41
              <EmptySpace pref="500" max="32767" attributes="0"/>
42
          </Group>
43
          <Group type="102" alignment="0" attributes="0">
44
              <EmptySpace min="155" pref="155" max="155" attributes="0"/>
45
              <Component id="cbFoldImports" linkSize="1" min="-2" max="-2" attributes="0"/>
46
              <EmptySpace pref="580" max="32767" attributes="0"/>
47
          </Group>
48
          <Group type="102" alignment="0" attributes="0">
49
              <EmptySpace min="155" pref="155" max="155" attributes="0"/>
50
              <Component id="cbFoldInnerClasses" linkSize="1" min="-2" max="-2" attributes="0"/>
51
              <EmptySpace pref="580" max="32767" attributes="0"/>
52
          </Group>
53
          <Group type="102" alignment="0" attributes="0">
54
              <EmptySpace min="155" pref="155" max="155" attributes="0"/>
55
              <Component id="cbFoldMethods" linkSize="1" min="-2" max="-2" attributes="0"/>
56
              <EmptySpace type="separate" max="-2" attributes="0"/>
57
              <Component id="cbFoldTags" min="-2" max="-2" attributes="0"/>
58
              <EmptySpace pref="333" max="32767" attributes="0"/>
59
          </Group>
60
          <Group type="102" alignment="0" attributes="0">
61
              <EmptySpace min="155" pref="155" max="155" attributes="0"/>
62
              <Component id="cbUseCodeFolding" min="-2" max="-2" attributes="0"/>
63
              <EmptySpace pref="720" max="32767" attributes="0"/>
64
          </Group>
65
          <Group type="102" alignment="0" attributes="0">
66
              <EmptySpace min="155" pref="155" max="155" attributes="0"/>
67
              <Component id="cbFoldJavadocComments" linkSize="1" min="-2" max="-2" attributes="0"/>
68
              <EmptySpace pref="580" max="32767" attributes="0"/>
69
          </Group>
70
          <Group type="102" alignment="0" attributes="0">
71
              <EmptySpace min="155" pref="155" max="155" attributes="0"/>
72
              <Component id="cbFoldInitialComments" linkSize="1" min="-2" max="-2" attributes="0"/>
73
              <EmptySpace pref="580" max="32767" attributes="0"/>
74
          </Group>
75
          <Group type="102" alignment="0" attributes="0">
24
          <Group type="102" alignment="0" attributes="0">
76
              <Component id="lWhenSavingFiles" min="-2" max="-2" attributes="0"/>
25
              <Component id="lWhenSavingFiles" min="-2" max="-2" attributes="0"/>
77
              <EmptySpace max="-2" attributes="0"/>
26
              <EmptySpace max="-2" attributes="0"/>
Lines 87-92 Link Here
87
              <EmptySpace min="-2" max="-2" attributes="0"/>
36
              <EmptySpace min="-2" max="-2" attributes="0"/>
88
              <Component id="jSeparator1" pref="792" max="32767" attributes="0"/>
37
              <Component id="jSeparator1" pref="792" max="32767" attributes="0"/>
89
          </Group>
38
          </Group>
39
          <Group type="102" attributes="0">
40
              <Group type="103" groupAlignment="0" attributes="0">
41
                  <Group type="102" attributes="0">
42
                      <EmptySpace max="-2" attributes="0"/>
43
                      <Group type="103" groupAlignment="0" attributes="0">
44
                          <Component id="lUseCodeFolding" alignment="0" min="-2" max="-2" attributes="0"/>
45
                          <Component id="lCollapseByDefault" alignment="0" min="-2" max="-2" attributes="0"/>
46
                          <Component id="lRemoveTrailingWhitespace" alignment="0" min="-2" max="-2" attributes="0"/>
47
                      </Group>
48
                      <EmptySpace max="-2" attributes="0"/>
49
                      <Group type="103" groupAlignment="0" attributes="0">
50
                          <Component id="lCamelCaseBehaviorExample" min="-2" max="-2" attributes="0"/>
51
                          <Component id="cboRemoveTrailingWhitespace" alignment="0" min="-2" max="-2" attributes="0"/>
52
                      </Group>
53
                  </Group>
54
                  <Group type="102" alignment="0" attributes="0">
55
                      <EmptySpace min="155" pref="155" max="155" attributes="0"/>
56
                      <Component id="cbCamelCaseBehavior" min="-2" max="-2" attributes="0"/>
57
                  </Group>
58
                  <Group type="102" alignment="0" attributes="0">
59
                      <EmptySpace min="155" pref="155" max="155" attributes="0"/>
60
                      <Component id="cbFoldImports" linkSize="1" min="-2" max="-2" attributes="0"/>
61
                  </Group>
62
                  <Group type="102" alignment="0" attributes="0">
63
                      <EmptySpace min="155" pref="155" max="155" attributes="0"/>
64
                      <Component id="cbFoldInnerClasses" linkSize="1" min="-2" max="-2" attributes="0"/>
65
                  </Group>
66
                  <Group type="102" alignment="0" attributes="0">
67
                      <EmptySpace min="155" pref="155" max="155" attributes="0"/>
68
                      <Component id="cbFoldMethods" linkSize="1" min="-2" max="-2" attributes="0"/>
69
                      <EmptySpace type="separate" max="-2" attributes="0"/>
70
                      <Component id="cbFoldTags" min="-2" max="-2" attributes="0"/>
71
                  </Group>
72
                  <Group type="102" alignment="0" attributes="0">
73
                      <EmptySpace min="155" pref="155" max="155" attributes="0"/>
74
                      <Component id="cbUseCodeFolding" min="-2" max="-2" attributes="0"/>
75
                  </Group>
76
                  <Group type="102" alignment="0" attributes="0">
77
                      <EmptySpace min="155" pref="155" max="155" attributes="0"/>
78
                      <Component id="cbFoldJavadocComments" linkSize="1" min="-2" max="-2" attributes="0"/>
79
                  </Group>
80
                  <Group type="102" alignment="0" attributes="0">
81
                      <EmptySpace min="155" pref="155" max="155" attributes="0"/>
82
                      <Component id="cbFoldInitialComments" linkSize="1" min="-2" max="-2" attributes="0"/>
83
                  </Group>
84
                  <Group type="102" alignment="0" attributes="0">
85
                      <Component id="lSearch" min="-2" max="-2" attributes="0"/>
86
                      <EmptySpace max="-2" attributes="0"/>
87
                      <Component id="jSeparator5" pref="813" max="32767" attributes="0"/>
88
                  </Group>
89
              </Group>
90
              <EmptySpace pref="24" max="-2" attributes="0"/>
91
          </Group>
92
          <Group type="102" alignment="0" attributes="0">
93
              <EmptySpace max="-2" attributes="0"/>
94
              <Component id="lEditorSearchType" min="-2" max="-2" attributes="0"/>
95
              <EmptySpace max="-2" attributes="0"/>
96
              <Component id="cboEditorSearchType" min="-2" max="-2" attributes="0"/>
97
              <EmptySpace max="32767" attributes="0"/>
98
          </Group>
90
      </Group>
99
      </Group>
91
    </DimensionLayout>
100
    </DimensionLayout>
92
    <DimensionLayout dim="1">
101
    <DimensionLayout dim="1">
Lines 139-145 Link Here
139
                  <Component id="lRemoveTrailingWhitespace" alignment="3" min="-2" max="-2" attributes="0"/>
148
                  <Component id="lRemoveTrailingWhitespace" alignment="3" min="-2" max="-2" attributes="0"/>
140
                  <Component id="cboRemoveTrailingWhitespace" alignment="3" min="-2" max="-2" attributes="0"/>
149
                  <Component id="cboRemoveTrailingWhitespace" alignment="3" min="-2" max="-2" attributes="0"/>
141
              </Group>
150
              </Group>
142
              <EmptySpace pref="67" max="32767" attributes="0"/>
151
              <EmptySpace type="separate" max="-2" attributes="0"/>
152
              <Group type="103" groupAlignment="1" attributes="0">
153
                  <Component id="lSearch" min="-2" max="-2" attributes="0"/>
154
                  <Component id="jSeparator5" min="-2" pref="10" max="-2" attributes="0"/>
155
              </Group>
156
              <EmptySpace max="-2" attributes="0"/>
157
              <Group type="103" groupAlignment="3" attributes="0">
158
                  <Component id="lEditorSearchType" alignment="3" min="-2" max="-2" attributes="0"/>
159
                  <Component id="cboEditorSearchType" alignment="3" min="-2" max="-2" attributes="0"/>
160
              </Group>
161
              <EmptySpace pref="59" max="32767" attributes="0"/>
143
          </Group>
162
          </Group>
144
      </Group>
163
      </Group>
145
    </DimensionLayout>
164
    </DimensionLayout>
Lines 241-245 Link Here
241
        </Property>
260
        </Property>
242
      </Properties>
261
      </Properties>
243
    </Component>
262
    </Component>
263
    <Component class="javax.swing.JLabel" name="lEditorSearchType">
264
      <Properties>
265
        <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
266
          <ComponentRef name="cboRemoveTrailingWhitespace"/>
267
        </Property>
268
        <Property name="text" type="java.lang.String" value="Editor Search Type:"/>
269
      </Properties>
270
    </Component>
271
    <Component class="javax.swing.JSeparator" name="jSeparator5">
272
    </Component>
273
    <Component class="javax.swing.JLabel" name="lSearch">
274
      <Properties>
275
        <Property name="text" type="java.lang.String" value="Search"/>
276
      </Properties>
277
    </Component>
278
    <Component class="javax.swing.JComboBox" name="cboEditorSearchType">
279
      <Properties>
280
        <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
281
          <StringArray count="4">
282
            <StringItem index="0" value="Item 1"/>
283
            <StringItem index="1" value="Item 2"/>
284
            <StringItem index="2" value="Item 3"/>
285
            <StringItem index="3" value="Item 4"/>
286
          </StringArray>
287
        </Property>
288
      </Properties>
289
    </Component>
244
  </SubComponents>
290
  </SubComponents>
245
</Form>
291
</Form>
(-)a/options.editor/src/org/netbeans/modules/options/generaleditor/GeneralEditorPanel.java (-42 / +99 lines)
Lines 91-100 Link Here
91
        loc (lWhenSavingFiles, "When_Saving_Files");
91
        loc (lWhenSavingFiles, "When_Saving_Files");
92
        loc (lRemoveTrailingWhitespace, "Remove_Trailing_Whitespace");
92
        loc (lRemoveTrailingWhitespace, "Remove_Trailing_Whitespace");
93
        loc (cboRemoveTrailingWhitespace, "Remove_Trailing_Whitespace");
93
        loc (cboRemoveTrailingWhitespace, "Remove_Trailing_Whitespace");
94
        loc (cboEditorSearchType, "Editor_Search_Type");
94
95
95
        cbUseCodeFolding.setMnemonic(NbBundle.getMessage (GeneralEditorPanel.class, "MNEMONIC_Use_Folding").charAt(0));
96
        cbUseCodeFolding.setMnemonic(NbBundle.getMessage (GeneralEditorPanel.class, "MNEMONIC_Use_Folding").charAt(0));
96
        cboRemoveTrailingWhitespace.setRenderer(new RemoveTrailingWhitespaceRenderer(cboRemoveTrailingWhitespace.getRenderer()));
97
        cboRemoveTrailingWhitespace.setRenderer(new RemoveTrailingWhitespaceRenderer(cboRemoveTrailingWhitespace.getRenderer()));
97
        cboRemoveTrailingWhitespace.setModel(new DefaultComboBoxModel(new Object [] { "never", "always", "modified-lines" })); //NOI18N
98
        cboRemoveTrailingWhitespace.setModel(new DefaultComboBoxModel(new Object [] { "never", "always", "modified-lines" })); //NOI18N
99
        cboEditorSearchType.setRenderer(new EditorSearchTypeRenderer(cboEditorSearchType.getRenderer()));
100
        cboEditorSearchType.setModel(new DefaultComboBoxModel(new Object [] { "default", "closing"})); //NOI18N
101
        cboEditorSearchType.setToolTipText(loc("Editor_Search_Type_Tooltip"));
98
    }
102
    }
99
    
103
    
100
    /** This method is called from within the constructor to
104
    /** This method is called from within the constructor to
Lines 124-129 Link Here
124
        lWhenSavingFiles = new javax.swing.JLabel();
128
        lWhenSavingFiles = new javax.swing.JLabel();
125
        lRemoveTrailingWhitespace = new javax.swing.JLabel();
129
        lRemoveTrailingWhitespace = new javax.swing.JLabel();
126
        cboRemoveTrailingWhitespace = new javax.swing.JComboBox();
130
        cboRemoveTrailingWhitespace = new javax.swing.JComboBox();
131
        lEditorSearchType = new javax.swing.JLabel();
132
        jSeparator5 = new javax.swing.JSeparator();
133
        lSearch = new javax.swing.JLabel();
134
        cboEditorSearchType = new javax.swing.JComboBox();
127
135
128
        setForeground(new java.awt.Color(99, 130, 191));
136
        setForeground(new java.awt.Color(99, 130, 191));
129
137
Lines 159-210 Link Here
159
167
160
        cboRemoveTrailingWhitespace.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
168
        cboRemoveTrailingWhitespace.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
161
169
170
        lEditorSearchType.setLabelFor(cboRemoveTrailingWhitespace);
171
        lEditorSearchType.setText("Editor Search Type:");
172
173
        lSearch.setText("Search");
174
175
        cboEditorSearchType.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
176
162
        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
177
        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
163
        this.setLayout(layout);
178
        this.setLayout(layout);
164
        layout.setHorizontalGroup(
179
        layout.setHorizontalGroup(
165
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
180
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
166
            .addGroup(layout.createSequentialGroup()
181
            .addGroup(layout.createSequentialGroup()
167
                .addContainerGap()
168
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
169
                    .addComponent(lUseCodeFolding)
170
                    .addComponent(lCollapseByDefault)
171
                    .addComponent(lRemoveTrailingWhitespace))
172
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
173
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
174
                    .addComponent(lCamelCaseBehaviorExample)
175
                    .addComponent(cboRemoveTrailingWhitespace, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
176
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
177
            .addGroup(layout.createSequentialGroup()
178
                .addGap(155, 155, 155)
179
                .addComponent(cbCamelCaseBehavior)
180
                .addContainerGap(500, Short.MAX_VALUE))
181
            .addGroup(layout.createSequentialGroup()
182
                .addGap(155, 155, 155)
183
                .addComponent(cbFoldImports)
184
                .addContainerGap(580, Short.MAX_VALUE))
185
            .addGroup(layout.createSequentialGroup()
186
                .addGap(155, 155, 155)
187
                .addComponent(cbFoldInnerClasses)
188
                .addContainerGap(580, Short.MAX_VALUE))
189
            .addGroup(layout.createSequentialGroup()
190
                .addGap(155, 155, 155)
191
                .addComponent(cbFoldMethods)
192
                .addGap(18, 18, 18)
193
                .addComponent(cbFoldTags)
194
                .addContainerGap(333, Short.MAX_VALUE))
195
            .addGroup(layout.createSequentialGroup()
196
                .addGap(155, 155, 155)
197
                .addComponent(cbUseCodeFolding)
198
                .addContainerGap(720, Short.MAX_VALUE))
199
            .addGroup(layout.createSequentialGroup()
200
                .addGap(155, 155, 155)
201
                .addComponent(cbFoldJavadocComments)
202
                .addContainerGap(580, Short.MAX_VALUE))
203
            .addGroup(layout.createSequentialGroup()
204
                .addGap(155, 155, 155)
205
                .addComponent(cbFoldInitialComments)
206
                .addContainerGap(580, Short.MAX_VALUE))
207
            .addGroup(layout.createSequentialGroup()
208
                .addComponent(lWhenSavingFiles)
182
                .addComponent(lWhenSavingFiles)
209
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
183
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
210
                .addComponent(jSeparator4, javax.swing.GroupLayout.DEFAULT_SIZE, 755, Short.MAX_VALUE))
184
                .addComponent(jSeparator4, javax.swing.GroupLayout.DEFAULT_SIZE, 755, Short.MAX_VALUE))
Lines 216-221 Link Here
216
                .addComponent(lCodeFolding)
190
                .addComponent(lCodeFolding)
217
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
191
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
218
                .addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 792, Short.MAX_VALUE))
192
                .addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 792, Short.MAX_VALUE))
193
            .addGroup(layout.createSequentialGroup()
194
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
195
                    .addGroup(layout.createSequentialGroup()
196
                        .addContainerGap()
197
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
198
                            .addComponent(lUseCodeFolding)
199
                            .addComponent(lCollapseByDefault)
200
                            .addComponent(lRemoveTrailingWhitespace))
201
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
202
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
203
                            .addComponent(lCamelCaseBehaviorExample)
204
                            .addComponent(cboRemoveTrailingWhitespace, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
205
                    .addGroup(layout.createSequentialGroup()
206
                        .addGap(155, 155, 155)
207
                        .addComponent(cbCamelCaseBehavior))
208
                    .addGroup(layout.createSequentialGroup()
209
                        .addGap(155, 155, 155)
210
                        .addComponent(cbFoldImports))
211
                    .addGroup(layout.createSequentialGroup()
212
                        .addGap(155, 155, 155)
213
                        .addComponent(cbFoldInnerClasses))
214
                    .addGroup(layout.createSequentialGroup()
215
                        .addGap(155, 155, 155)
216
                        .addComponent(cbFoldMethods)
217
                        .addGap(18, 18, 18)
218
                        .addComponent(cbFoldTags))
219
                    .addGroup(layout.createSequentialGroup()
220
                        .addGap(155, 155, 155)
221
                        .addComponent(cbUseCodeFolding))
222
                    .addGroup(layout.createSequentialGroup()
223
                        .addGap(155, 155, 155)
224
                        .addComponent(cbFoldJavadocComments))
225
                    .addGroup(layout.createSequentialGroup()
226
                        .addGap(155, 155, 155)
227
                        .addComponent(cbFoldInitialComments))
228
                    .addGroup(layout.createSequentialGroup()
229
                        .addComponent(lSearch)
230
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
231
                        .addComponent(jSeparator5, javax.swing.GroupLayout.DEFAULT_SIZE, 813, Short.MAX_VALUE)))
232
                .addContainerGap(24, javax.swing.GroupLayout.PREFERRED_SIZE))
233
            .addGroup(layout.createSequentialGroup()
234
                .addContainerGap()
235
                .addComponent(lEditorSearchType)
236
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
237
                .addComponent(cboEditorSearchType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
238
                .addContainerGap())
219
        );
239
        );
220
240
221
        layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {cbFoldImports, cbFoldInitialComments, cbFoldInnerClasses, cbFoldJavadocComments, cbFoldMethods});
241
        layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {cbFoldImports, cbFoldInitialComments, cbFoldInnerClasses, cbFoldJavadocComments, cbFoldMethods});
Lines 262-268 Link Here
262
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
282
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
263
                    .addComponent(lRemoveTrailingWhitespace)
283
                    .addComponent(lRemoveTrailingWhitespace)
264
                    .addComponent(cboRemoveTrailingWhitespace, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
284
                    .addComponent(cboRemoveTrailingWhitespace, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
265
                .addContainerGap(67, Short.MAX_VALUE))
285
                .addGap(18, 18, 18)
286
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
287
                    .addComponent(lSearch)
288
                    .addComponent(jSeparator5, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE))
289
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
290
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
291
                    .addComponent(lEditorSearchType)
292
                    .addComponent(cboEditorSearchType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
293
                .addContainerGap(59, Short.MAX_VALUE))
266
        );
294
        );
267
    }// </editor-fold>//GEN-END:initComponents
295
    }// </editor-fold>//GEN-END:initComponents
268
    
296
    
Lines 276-290 Link Here
276
    private javax.swing.JCheckBox cbFoldMethods;
304
    private javax.swing.JCheckBox cbFoldMethods;
277
    private javax.swing.JCheckBox cbFoldTags;
305
    private javax.swing.JCheckBox cbFoldTags;
278
    private javax.swing.JCheckBox cbUseCodeFolding;
306
    private javax.swing.JCheckBox cbUseCodeFolding;
307
    private javax.swing.JComboBox cboEditorSearchType;
279
    private javax.swing.JComboBox cboRemoveTrailingWhitespace;
308
    private javax.swing.JComboBox cboRemoveTrailingWhitespace;
280
    private javax.swing.JSeparator jSeparator1;
309
    private javax.swing.JSeparator jSeparator1;
281
    private javax.swing.JSeparator jSeparator3;
310
    private javax.swing.JSeparator jSeparator3;
282
    private javax.swing.JSeparator jSeparator4;
311
    private javax.swing.JSeparator jSeparator4;
312
    private javax.swing.JSeparator jSeparator5;
283
    private javax.swing.JLabel lCamelCaseBehavior;
313
    private javax.swing.JLabel lCamelCaseBehavior;
284
    private javax.swing.JLabel lCamelCaseBehaviorExample;
314
    private javax.swing.JLabel lCamelCaseBehaviorExample;
285
    private javax.swing.JLabel lCodeFolding;
315
    private javax.swing.JLabel lCodeFolding;
286
    private javax.swing.JLabel lCollapseByDefault;
316
    private javax.swing.JLabel lCollapseByDefault;
317
    private javax.swing.JLabel lEditorSearchType;
287
    private javax.swing.JLabel lRemoveTrailingWhitespace;
318
    private javax.swing.JLabel lRemoveTrailingWhitespace;
319
    private javax.swing.JLabel lSearch;
288
    private javax.swing.JLabel lUseCodeFolding;
320
    private javax.swing.JLabel lUseCodeFolding;
289
    private javax.swing.JLabel lWhenSavingFiles;
321
    private javax.swing.JLabel lWhenSavingFiles;
290
    // End of variables declaration//GEN-END:variables
322
    // End of variables declaration//GEN-END:variables
Lines 327-332 Link Here
327
            cbCamelCaseBehavior.addActionListener (this);
359
            cbCamelCaseBehavior.addActionListener (this);
328
            cbFoldTags.addActionListener (this);
360
            cbFoldTags.addActionListener (this);
329
            cboRemoveTrailingWhitespace.addActionListener(this);
361
            cboRemoveTrailingWhitespace.addActionListener(this);
362
            cboEditorSearchType.addActionListener(this);
330
        }
363
        }
331
        
364
        
332
        // init code folding
365
        // init code folding
Lines 351-356 Link Here
351
384
352
        // when saving files section
385
        // when saving files section
353
        cboRemoveTrailingWhitespace.setSelectedItem(model.getRemoveTrailingWhitespace());
386
        cboRemoveTrailingWhitespace.setSelectedItem(model.getRemoveTrailingWhitespace());
387
        
388
        cboEditorSearchType.setSelectedItem(model.getEditorSearchType());
354
389
355
        updateEnabledState ();
390
        updateEnabledState ();
356
        
391
        
Lines 377-382 Link Here
377
        
412
        
378
        // when saving files section
413
        // when saving files section
379
        model.setRemoveTrailingWhitespace((String)cboRemoveTrailingWhitespace.getSelectedItem());
414
        model.setRemoveTrailingWhitespace((String)cboRemoveTrailingWhitespace.getSelectedItem());
415
        
416
        model.setEditorSearchType((String)cboEditorSearchType.getSelectedItem());
380
417
381
        changed = false;
418
        changed = false;
382
    }
419
    }
Lines 434-437 Link Here
434
        }
471
        }
435
472
436
    } // End of RemoveTrailingWhitespaceRendererRenderer class
473
    } // End of RemoveTrailingWhitespaceRendererRenderer class
474
    
475
    private static final class EditorSearchTypeRenderer implements ListCellRenderer {
476
477
        private final ListCellRenderer defaultRenderer;
478
479
        public EditorSearchTypeRenderer(ListCellRenderer defaultRenderer) {
480
            this.defaultRenderer = defaultRenderer;
481
        }
482
483
        @Override
484
        public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
485
            return defaultRenderer.getListCellRendererComponent(
486
                    list,
487
                    NbBundle.getMessage(GeneralEditorPanel.class, "EST_" + value), //NOI18N
488
                    index,
489
                    isSelected,
490
                    cellHasFocus);
491
        }
492
493
    }
437
}
494
}
(-)a/options.editor/src/org/netbeans/modules/options/generaleditor/Model.java (+10 lines)
Lines 133-138 Link Here
133
        Preferences prefs = MimeLookup.getLookup(MimePath.EMPTY).lookup(Preferences.class);
133
        Preferences prefs = MimeLookup.getLookup(MimePath.EMPTY).lookup(Preferences.class);
134
        prefs.put(SimpleValueNames.ON_SAVE_REMOVE_TRAILING_WHITESPACE, value);
134
        prefs.put(SimpleValueNames.ON_SAVE_REMOVE_TRAILING_WHITESPACE, value);
135
    }
135
    }
136
    
137
    String getEditorSearchType() {
138
        Preferences prefs = MimeLookup.getLookup(MimePath.EMPTY).lookup(Preferences.class);
139
        return prefs.get(SimpleValueNames.EDITOR_SEARCH_TYPE, "default");
140
    }
141
142
    void setEditorSearchType(String value) {
143
        Preferences prefs = MimeLookup.getLookup(MimePath.EMPTY).lookup(Preferences.class);
144
        prefs.put(SimpleValueNames.EDITOR_SEARCH_TYPE, value);
145
    }
136
146
137
    // private helper methods ..................................................
147
    // private helper methods ..................................................
138
    
148
    

Return to bug 210700