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

(-)a/editor.lib/apichanges.xml (+47 lines)
Lines 107-112 Link Here
107
    <!-- ACTUAL CHANGES BEGIN HERE: -->
107
    <!-- ACTUAL CHANGES BEGIN HERE: -->
108
108
109
    <changes>
109
    <changes>
110
        <change id="moving-find">
111
            <summary>Moving find implementations to module editor.search</summary>
112
            <version major="3" minor="35"/>
113
            <date day="6" month="2" year="2013"/>
114
            <author login="mkristofic"/>
115
            <compatibility binary="incompatible" source="incompatible" semantic="incompatible" addition="no" deprecation="yes" deletion="yes" modification="yes"/>
116
            <description>
117
                <p>
118
                    The search actions from ActionFactory where moved to editor.search module. DocumentFinder was removed as unused by new search implementation.
119
                </p>
120
121
                <pre>
122
                    check-sigtest:
123
                    [mkdir] Created dir: /home/mito/nb/develop/editor.lib/build/test/sigtest/results
124
                    [sigtest] /home/mito/nb/develop/editor.lib/build/test/sigtest/results/org.netbeans.modules.editor.lib
125
                    [sigtest] Packages: org.netbeans.editor.*, org.netbeans.editor.ext.*, org.netbeans.editor.view.spi.*, org.netbeans.lib.editor.hyperlink.spi.*, org.netbeans.lib.editor.view.*
126
                    [sigtest]
127
                    [sigtest] email: api-changes@netbeans.org
128
                    [sigtest] SignatureTest report
129
                    [sigtest] Base version: 3.34.0
130
                    [sigtest] Tested version: 3.34.0
131
                    [sigtest] Check mode: bin [throws removed]
132
                    [sigtest] Constant checking: on
133
                    [sigtest]
134
                    [sigtest]
135
                    [sigtest] Class org.netbeans.editor.ActionFactory$FindNextAction
136
                    [sigtest]   "E1.2 - API type removed" : CLASS public static org.netbeans.editor.ActionFactory$FindNextAction
137
                    [sigtest]
138
                    [sigtest] Class org.netbeans.editor.ActionFactory$FindPreviousAction
139
                    [sigtest]   "E1.2 - API type removed" : CLASS public static org.netbeans.editor.ActionFactory$FindPreviousAction
140
                    [sigtest]
141
                    [sigtest] Class org.netbeans.editor.ActionFactory$FindSelectionAction
142
                    [sigtest]   "E1.2 - API type removed" : CLASS public static org.netbeans.editor.ActionFactory$FindSelectionAction
143
                    [sigtest]
144
                    [sigtest] Class org.netbeans.editor.ActionFactory$ToggleHighlightSearchAction
145
                    [sigtest]   "E1.2 - API type removed" : CLASS public static org.netbeans.editor.ActionFactory$ToggleHighlightSearchAction
146
                    [sigtest]
147
                    [sigtest] Class org.netbeans.editor.DocumentFinder
148
                    [sigtest]   "E1.2 - API type removed" : CLASS public org.netbeans.editor.DocumentFinder
149
                    [sigtest]
150
                    [sigtest] Class org.netbeans.editor.DocumentFinder$FindReplaceResult
151
                    [sigtest]   "E1.2 - API type removed" : CLASS public static org.netbeans.editor.DocumentFinder$FindReplaceResult
152
                    [sigtest]
153
                    [sigtest] /home/mito/nb/develop/editor.lib/build/test/sigtest/results/org-netbeans-modules-editor-lib.xml: 1 failures in /home/mito/nb/develop/editor.lib/nbproject/org-netbeans-modules-editor-lib.sig
154
                </pre>
155
            </description>
156
        </change>
110
        <change id="pasive.corrected.to.passive">
157
        <change id="pasive.corrected.to.passive">
111
            <summary>Spelling error in the API corrected</summary>
158
            <summary>Spelling error in the API corrected</summary>
112
            <version major="3" minor="33"/>
159
            <version major="3" minor="33"/>
(-)a/editor.lib/nbproject/project.properties (-1 / +1 lines)
Lines 42-48 Link Here
42
42
43
javac.compilerargs=-Xlint:unchecked
43
javac.compilerargs=-Xlint:unchecked
44
javac.source=1.6
44
javac.source=1.6
45
spec.version.base=3.34.0
45
spec.version.base=3.35.0
46
is.autoload=true
46
is.autoload=true
47
47
48
javadoc.arch=${basedir}/arch.xml
48
javadoc.arch=${basedir}/arch.xml
(-)a/editor.lib/src/org/netbeans/editor/ActionFactory.java (-242 lines)
Lines 56-63 Link Here
56
import java.text.SimpleDateFormat;
56
import java.text.SimpleDateFormat;
57
import java.util.Arrays;
57
import java.util.Arrays;
58
import java.util.Date;
58
import java.util.Date;
59
import java.util.Map;
60
import java.util.HashMap;
61
import java.util.HashSet;
59
import java.util.HashSet;
62
import java.util.LinkedList;
60
import java.util.LinkedList;
63
import java.util.concurrent.atomic.AtomicBoolean;
61
import java.util.concurrent.atomic.AtomicBoolean;
Lines 65-78 Link Here
65
import java.util.logging.Logger;
63
import java.util.logging.Logger;
66
import javax.swing.Action;
64
import javax.swing.Action;
67
import javax.swing.ActionMap;
65
import javax.swing.ActionMap;
68
import javax.swing.ButtonModel;
69
import javax.swing.Icon;
66
import javax.swing.Icon;
70
import javax.swing.JCheckBoxMenuItem;
67
import javax.swing.JCheckBoxMenuItem;
71
import javax.swing.JEditorPane;
68
import javax.swing.JEditorPane;
72
import javax.swing.JMenuItem;
69
import javax.swing.JMenuItem;
73
import javax.swing.JToggleButton;
70
import javax.swing.JToggleButton;
74
import javax.swing.event.ChangeEvent;
75
import javax.swing.event.ChangeListener;
76
import javax.swing.plaf.TextUI;
71
import javax.swing.plaf.TextUI;
77
import javax.swing.text.BadLocationException;
72
import javax.swing.text.BadLocationException;
78
import javax.swing.text.Caret;
73
import javax.swing.text.Caret;
Lines 100-112 Link Here
100
import org.netbeans.modules.editor.indent.api.Reformat;
95
import org.netbeans.modules.editor.indent.api.Reformat;
101
import org.netbeans.modules.editor.lib.NavigationHistory;
96
import org.netbeans.modules.editor.lib.NavigationHistory;
102
import org.netbeans.modules.editor.lib2.RectangularSelectionUtils;
97
import org.netbeans.modules.editor.lib2.RectangularSelectionUtils;
103
import org.netbeans.modules.editor.lib2.search.EditorFindSupport;
104
import org.netbeans.modules.editor.lib2.view.DocumentView;
98
import org.netbeans.modules.editor.lib2.view.DocumentView;
105
import org.openide.util.ContextAwareAction;
99
import org.openide.util.ContextAwareAction;
106
import org.openide.util.ImageUtilities;
100
import org.openide.util.ImageUtilities;
107
import org.openide.util.Lookup;
101
import org.openide.util.Lookup;
108
import org.openide.util.NbBundle;
102
import org.openide.util.NbBundle;
109
import org.openide.util.WeakListeners;
110
import org.openide.util.actions.Presenter;
103
import org.openide.util.actions.Presenter;
111
104
112
/**
105
/**
Lines 1189-1332 Link Here
1189
        }
1182
        }
1190
    }
1183
    }
1191
1184
1192
    @EditorActionRegistration(name = BaseKit.findNextAction,
1193
            iconResource = "org/netbeans/modules/editor/resources/find_next.png") // NOI18N
1194
    public static class FindNextAction extends LocalBaseAction {
1195
1196
        static final long serialVersionUID =6878814427731642684L;
1197
1198
        public FindNextAction() {
1199
            super(ABBREV_RESET | MAGIC_POSITION_RESET | UNDO_MERGE_RESET | WORD_MATCH_RESET);
1200
        }
1201
1202
        @Override
1203
        public void actionPerformed(ActionEvent evt, JTextComponent target) {
1204
            if (target != null) {
1205
                EditorUI eui = org.netbeans.editor.Utilities.getEditorUI(target);
1206
                if (eui.getComponent().getClientProperty("AsTextField") == null)  { //NOI18N
1207
                    EditorFindSupport.getInstance().setFocusedTextComponent(eui.getComponent());
1208
                }
1209
                openFindIfNecessary(eui, evt);
1210
                EditorFindSupport.getInstance().find(null, false);
1211
            }
1212
        }
1213
    }
1214
    
1215
    private static void openFindIfNecessary(EditorUI eui, ActionEvent evt) {
1216
        Object findWhat = EditorFindSupport.getInstance().getFindProperty(EditorFindSupport.FIND_WHAT);
1217
        if (findWhat == null || !(findWhat instanceof String) || ((String) findWhat).isEmpty()) {
1218
1219
            Action findAction = ((BaseKit) eui.getComponent().getUI().getEditorKit(
1220
                    eui.getComponent())).getActionByName("find");
1221
            if (findAction != null) {
1222
                findAction.actionPerformed(evt);
1223
            }
1224
        }
1225
    }
1226
    
1227
    @EditorActionRegistration(name = BaseKit.findPreviousAction,
1228
            iconResource = "org/netbeans/modules/editor/resources/find_previous.png") // NOI18N
1229
    public static class FindPreviousAction extends LocalBaseAction {
1230
1231
        static final long serialVersionUID =-43746947902694926L;
1232
1233
        public FindPreviousAction() {
1234
            super(ABBREV_RESET | MAGIC_POSITION_RESET | UNDO_MERGE_RESET | WORD_MATCH_RESET);
1235
        }
1236
1237
        @Override
1238
        public void actionPerformed(ActionEvent evt, JTextComponent target) {
1239
            if (target != null) {
1240
                EditorUI eui = org.netbeans.editor.Utilities.getEditorUI(target);
1241
                if (eui.getComponent().getClientProperty("AsTextField") == null)  { //NOI18N
1242
                    EditorFindSupport.getInstance().setFocusedTextComponent(eui.getComponent());
1243
                }
1244
                openFindIfNecessary(eui, evt);
1245
                EditorFindSupport.getInstance().find(null, true);
1246
            }
1247
        }
1248
    }
1249
1250
    /** Finds either selection or if there's no selection it finds
1251
    * the word where the cursor is standing.
1252
    */
1253
    @EditorActionRegistration(name = BaseKit.findSelectionAction,
1254
            iconResource = "org/netbeans/modules/editor/resources/find_selection.png") // NOI18N
1255
    public static class FindSelectionAction extends LocalBaseAction {
1256
1257
        static final long serialVersionUID =-5601618936504699565L;
1258
1259
        public FindSelectionAction() {
1260
            super();
1261
        }
1262
1263
        @Override
1264
        public void actionPerformed(ActionEvent evt, JTextComponent target) {
1265
            if (target != null) {
1266
                EditorFindSupport findSupport = EditorFindSupport.getInstance();
1267
                Caret caret = target.getCaret();
1268
                int dotPos = caret.getDot();
1269
                HashMap props = new HashMap(findSupport.createDefaultFindProperties());
1270
                String searchWord = null;
1271
                boolean revert = false;
1272
                Boolean originalValue = null;
1273
                Map revertMap = (Map)props.get(EditorFindSupport.REVERT_MAP);
1274
                Boolean revertValue = revertMap != null ? (Boolean)revertMap.get(EditorFindSupport.FIND_WHOLE_WORDS) : null;
1275
1276
                if (Utilities.isSelectionShowing(caret)) { // valid selection
1277
                    searchWord = target.getSelectedText();
1278
                    originalValue = (Boolean)props.put(EditorFindSupport.FIND_WHOLE_WORDS, Boolean.FALSE);
1279
                    if (Boolean.FALSE.equals(revertValue)) {
1280
                        revertMap.remove(EditorFindSupport.FIND_WHOLE_WORDS);
1281
                    } else {
1282
                        revert = !Boolean.FALSE.equals(originalValue);
1283
                    }
1284
                } else { // no selection, get current word
1285
                    try {
1286
                        searchWord = Utilities.getIdentifier((BaseDocument)target.getDocument(),
1287
                                                             dotPos);
1288
                        originalValue = (Boolean)props.put(EditorFindSupport.FIND_WHOLE_WORDS, Boolean.TRUE);
1289
                        if (Boolean.TRUE.equals(revertValue)) {
1290
                            revertMap.remove(EditorFindSupport.FIND_WHOLE_WORDS);
1291
                        } else {
1292
                            revert = !Boolean.TRUE.equals(originalValue);
1293
                        }
1294
1295
                    } catch (BadLocationException e) {
1296
                        e.printStackTrace();
1297
                    }
1298
                }
1299
1300
                if (searchWord != null) {
1301
                    int n = searchWord.indexOf( '\n' );
1302
                    if (n >= 0 ) 
1303
                        searchWord = searchWord.substring(0, n);
1304
                    props.put(EditorFindSupport.FIND_WHAT, searchWord);
1305
                
1306
                    if (revert){
1307
                        revertMap = new HashMap();
1308
                        revertMap.put(EditorFindSupport.FIND_WHOLE_WORDS, originalValue != null ? originalValue : Boolean.FALSE);
1309
                        props.put(EditorFindSupport.REVERT_MAP, revertMap);
1310
                    }
1311
                    
1312
                    props.put(EditorFindSupport.FIND_BLOCK_SEARCH, Boolean.FALSE);
1313
                    props.put(EditorFindSupport.FIND_BLOCK_SEARCH_START, null);
1314
                    props.put(EditorFindSupport.FIND_BLOCK_SEARCH_END, null);
1315
1316
                    EditorUI eui = org.netbeans.editor.Utilities.getEditorUI(target);
1317
                    if (eui.getComponent().getClientProperty("AsTextField") == null) { //NOI18N
1318
                        findSupport.setFocusedTextComponent(eui.getComponent());
1319
                    }
1320
                    findSupport.putFindProperties(props);
1321
                    if (findSupport.find(null, false)) {
1322
                        findSupport.addToHistory(new EditorFindSupport.SPW((String) props.get(EditorFindSupport.FIND_WHAT),
1323
                                (Boolean) props.get(EditorFindSupport.FIND_WHOLE_WORDS), (Boolean) props.get(EditorFindSupport.FIND_MATCH_CASE), (Boolean) props.get(EditorFindSupport.FIND_REG_EXP)));
1324
                    }
1325
                }
1326
            }
1327
        }
1328
    }
1329
1330
    // Cannot easily use EditorActionRegistration yet for toggle buttons
1185
    // Cannot easily use EditorActionRegistration yet for toggle buttons
1331
    public static class ToggleRectangularSelectionAction extends LocalBaseAction
1186
    public static class ToggleRectangularSelectionAction extends LocalBaseAction
1332
    implements Presenter.Toolbar, ContextAwareAction, PropertyChangeListener {
1187
    implements Presenter.Toolbar, ContextAwareAction, PropertyChangeListener {
Lines 1401-1503 Link Here
1401
        
1256
        
1402
    }    
1257
    }    
1403
1258
1404
// suspending the use of EditorActionRegistration due to #167063
1405
//    @EditorActionRegistration(name = BaseKit.toggleHighlightSearchAction,
1406
//            iconResource = "org/netbeans/modules/editor/resources/toggle_highlight.png")
1407
    public static class ToggleHighlightSearchAction extends LocalBaseAction implements Presenter.Toolbar {
1408
1409
        static final long serialVersionUID =4603809175771743200L;
1410
1411
        public ToggleHighlightSearchAction() {
1412
            super(BaseKit.toggleHighlightSearchAction, CLEAR_STATUS_TEXT);
1413
            putValue(Action.SMALL_ICON, ImageUtilities.loadImageIcon("org/netbeans/modules/editor/resources/toggle_highlight.png", false)); //NOI18N
1414
            putValue("noIconInMenu", Boolean.TRUE); // NOI18N
1415
        }
1416
1417
        public void actionPerformed(ActionEvent evt, JTextComponent target) {
1418
            if (target != null) {
1419
                Boolean cur = (Boolean)EditorFindSupport.getInstance().getFindProperty(
1420
                                  EditorFindSupport.FIND_HIGHLIGHT_SEARCH);
1421
                if (cur == null || cur.booleanValue() == false) {
1422
                    cur = Boolean.TRUE;
1423
                } else {
1424
                    cur = Boolean.FALSE;
1425
                }
1426
                EditorFindSupport.getInstance().putFindProperty(
1427
                    EditorFindSupport.FIND_HIGHLIGHT_SEARCH, cur);
1428
            }
1429
        }
1430
1431
        public Component getToolbarPresenter() {
1432
            JToggleButton b = new MyGaGaButton();
1433
            b.setModel(new HighlightButtonModel());
1434
            b.putClientProperty("hideActionText", Boolean.TRUE); //NOI18N
1435
            b.setAction(this);
1436
            
1437
            return b;
1438
        }
1439
        
1440
        private static final class HighlightButtonModel extends JToggleButton.ToggleButtonModel implements PropertyChangeListener {
1441
            
1442
            public HighlightButtonModel() {
1443
                EditorFindSupport efs = EditorFindSupport.getInstance();
1444
                efs.addPropertyChangeListener(WeakListeners.propertyChange(this, efs));
1445
                propertyChange(null);
1446
            }
1447
        
1448
            public void propertyChange(PropertyChangeEvent evt) {
1449
                if (evt == null || evt.getPropertyName() == null || evt.getPropertyName().equals(EditorFindSupport.FIND_HIGHLIGHT_SEARCH)) {
1450
                    Boolean value = (Boolean) EditorFindSupport.getInstance().getFindProperty(EditorFindSupport.FIND_HIGHLIGHT_SEARCH);
1451
                    setSelected(value == null ? false : value.booleanValue());
1452
                }
1453
            }
1454
        } // End of HighlightButtonModel class
1455
        
1456
        private static final class MyGaGaButton extends JToggleButton implements ChangeListener {
1457
            
1458
            public MyGaGaButton() {
1459
                
1460
            }
1461
            
1462
            @Override
1463
            public void setModel(ButtonModel model) {
1464
                ButtonModel oldModel = getModel();
1465
                if (oldModel != null) {
1466
                    oldModel.removeChangeListener(this);
1467
                }
1468
                
1469
                super.setModel(model);
1470
                
1471
                ButtonModel newModel = getModel();
1472
                if (newModel != null) {
1473
                    newModel.addChangeListener(this);
1474
                }
1475
                
1476
                stateChanged(null);
1477
            }
1478
1479
            public void stateChanged(ChangeEvent evt) {
1480
                boolean selected = isSelected();
1481
                super.setContentAreaFilled(selected);
1482
                super.setBorderPainted(selected);
1483
            }
1484
1485
            @Override
1486
            public void setBorderPainted(boolean arg0) {
1487
                if (!isSelected()) {
1488
                    super.setBorderPainted(arg0);
1489
                }
1490
            }
1491
1492
            @Override
1493
            public void setContentAreaFilled(boolean arg0) {
1494
                if (!isSelected()) {
1495
                    super.setContentAreaFilled(arg0);
1496
                }
1497
            }
1498
        }
1499
    } // End of ToggleHighlightSearchAction class
1500
1501
    public static class UndoAction extends LocalBaseAction {
1259
    public static class UndoAction extends LocalBaseAction {
1502
1260
1503
        static final long serialVersionUID =8628586205035497612L;
1261
        static final long serialVersionUID =8628586205035497612L;
(-)a/editor.lib/src/org/netbeans/editor/BaseKit.java (-1 lines)
Lines 931-937 Link Here
931
                   new PreviousWordAction(selectionPreviousWordAction),
931
                   new PreviousWordAction(selectionPreviousWordAction),
932
                   new ActionFactory.RemoveWordNextAction(),
932
                   new ActionFactory.RemoveWordNextAction(),
933
                   new ActionFactory.RemoveWordPreviousAction(),
933
                   new ActionFactory.RemoveWordPreviousAction(),
934
                   new ActionFactory.ToggleHighlightSearchAction(),
935
                   new ActionFactory.ToggleRectangularSelectionAction(),
934
                   new ActionFactory.ToggleRectangularSelectionAction(),
936
935
937
                   // Self test actions
936
                   // Self test actions
(-)a/editor.lib/src/org/netbeans/editor/Bundle.properties (-4 lines)
Lines 92-100 Link Here
92
escape=Simulate Escape Key
92
escape=Simulate Escape Key
93
fast-import=Fast Import
93
fast-import=Fast Import
94
try-catch=Surround With try-catch
94
try-catch=Surround With try-catch
95
find-next=Find Next Occurrence
96
find-previous=Find Previous Occurrence
97
find-selection=Find Selection
98
find=Find
95
find=Find
99
first-non-white=Go to First Non-whitespace Char
96
first-non-white=Go to First Non-whitespace Char
100
format=Format
97
format=Format
Lines 192-198 Link Here
192
to-upper-case=To Uppercase
189
to-upper-case=To Uppercase
193
toggle-case-identifier-begin=Switch Capitalization of Identifier
190
toggle-case-identifier-begin=Switch Capitalization of Identifier
194
toggle-case-word-begin=Switch Capitalization of Word
191
toggle-case-word-begin=Switch Capitalization of Word
195
toggle-highlight-search=Toggle Highlight Search
196
toggle-line-numbers=Toggle Line Numbers
192
toggle-line-numbers=Toggle Line Numbers
197
toggle-rectangular-selection=Toggle Rectangular Selection
193
toggle-rectangular-selection=Toggle Rectangular Selection
198
toggle-toolbar=Toggle Toolbar
194
toggle-toolbar=Toggle Toolbar
(-)a/editor.lib/src/org/netbeans/editor/DocumentFinder.java (-128 lines)
Lines 1-128 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
5
 *
6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
7
 * Other names may be trademarks of their respective owners.
8
 *
9
 * The contents of this file are subject to the terms of either the GNU
10
 * General Public License Version 2 only ("GPL") or the Common
11
 * Development and Distribution License("CDDL") (collectively, the
12
 * "License"). You may not use this file except in compliance with the
13
 * License. You can obtain a copy of the License at
14
 * http://www.netbeans.org/cddl-gplv2.html
15
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
16
 * specific language governing permissions and limitations under the
17
 * License.  When distributing the software, include this License Header
18
 * Notice in each file and include the License file at
19
 * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
20
 * particular file as subject to the "Classpath" exception as provided
21
 * by Oracle in the GPL Version 2 section of the License file that
22
 * accompanied this code. If applicable, add the following below the
23
 * License Header, with the fields enclosed by brackets [] replaced by
24
 * your own identifying information:
25
 * "Portions Copyrighted [year] [name of copyright owner]"
26
 *
27
 * Contributor(s):
28
 *
29
 * The Original Software is NetBeans. The Initial Developer of the Original
30
 * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
31
 * Microsystems, Inc. All Rights Reserved.
32
 *
33
 * If you wish your version of this file to be governed by only the CDDL
34
 * or only the GPL Version 2, indicate your decision by adding
35
 * "[Contributor] elects to include this software in this distribution
36
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
37
 * single choice of license, a recipient has the option to distribute
38
 * your version of this file under either the CDDL, the GPL Version 2 or
39
 * to extend the choice of license to its licensees as provided above.
40
 * However, if you add GPL Version 2 code and therefore, elected the GPL
41
 * Version 2 license, then the option applies only if the new code is
42
 * made subject to such option by the copyright holder.
43
 */
44
45
package org.netbeans.editor;
46
47
import java.util.Map;
48
import java.util.regex.Matcher;
49
import java.util.regex.Pattern;
50
import java.util.regex.PatternSyntaxException;
51
import javax.swing.text.BadLocationException;
52
import javax.swing.text.Document;
53
import org.netbeans.lib.editor.util.swing.DocumentUtilities;
54
import org.openide.DialogDisplayer;
55
import org.openide.ErrorManager;
56
import org.openide.NotifyDescriptor;
57
import org.openide.util.NbBundle;
58
59
/**
60
 *
61
 * @author  Martin Roskanin
62
 * @deprecated Without any replacement.
63
 */
64
public class DocumentFinder
65
{
66
    /** 
67
     * Finds in document 
68
     *
69
     * @param doc document where to find
70
     * @param startOffset offset in the document where the search will start
71
     * @param endOffset offset where the search will end with reporting
72
     *   that nothing was found.
73
     * @param props find properties
74
     */
75
    public static int[] find(
76
        BaseDocument doc, int startOffset, int endOffset, Map props,
77
        boolean oppositeDir
78
    ) throws BadLocationException {
79
        return org.netbeans.modules.editor.lib2.search.DocumentFinder.find(doc, startOffset, endOffset, props, oppositeDir);
80
    }
81
82
    public static int[] findBlocks(
83
        BaseDocument doc, int startOffset, int endOffset, 
84
        Map props, int blocks[]
85
    ) throws BadLocationException {
86
        return org.netbeans.modules.editor.lib2.search.DocumentFinder.findBlocks(doc, startOffset, endOffset, props, blocks);
87
    }
88
    
89
    /**
90
     *  Finds the searching string and substitute replace expression in case of
91
     *  regexp backreferences.
92
     *  @return FindReplaceResult, that contains positions of found string and substituted replace expression
93
     */
94
    public static FindReplaceResult findReplaceResult(
95
        String replaceString, BaseDocument doc, int startOffset, int endOffset,
96
        Map props, boolean oppositeDir
97
    ) throws BadLocationException {
98
        org.netbeans.modules.editor.lib2.search.DocumentFinder.FindReplaceResult result = 
99
            org.netbeans.modules.editor.lib2.search.DocumentFinder.findReplaceResult(
100
                replaceString, doc, startOffset, endOffset, props, oppositeDir);
101
        
102
        return new FindReplaceResult(result.getFoundPositions(), result.getReplacedString());
103
    }
104
105
    private DocumentFinder() {
106
        
107
    }
108
    
109
    public static class FindReplaceResult{
110
        private int[] positions;
111
        private String replacedString;
112
        
113
        public FindReplaceResult(int[] positions, String replacedString){
114
            this.positions = positions;
115
            this.replacedString = replacedString;
116
        }
117
        
118
        public String getReplacedString(){
119
            return replacedString;
120
        }
121
        
122
        public int[] getFoundPositions(){
123
            return positions;
124
        }
125
    } // End of FindReplaceResult class
126
}
127
128
(-)a/editor.lib2/nbproject/org-netbeans-modules-editor-lib2.sig (-336 lines)
Lines 1-336 Link Here
1
#Signature file v4.1
2
#Version 1.61.1
3
4
CLSS public abstract interface java.io.Serializable
5
6
CLSS public java.lang.Object
7
cons public init()
8
meth protected java.lang.Object clone() throws java.lang.CloneNotSupportedException
9
meth protected void finalize() throws java.lang.Throwable
10
meth public boolean equals(java.lang.Object)
11
meth public final java.lang.Class<?> getClass()
12
meth public final void notify()
13
meth public final void notifyAll()
14
meth public final void wait() throws java.lang.InterruptedException
15
meth public final void wait(long) throws java.lang.InterruptedException
16
meth public final void wait(long,int) throws java.lang.InterruptedException
17
meth public int hashCode()
18
meth public java.lang.String toString()
19
20
CLSS public abstract interface java.lang.annotation.Annotation
21
meth public abstract boolean equals(java.lang.Object)
22
meth public abstract int hashCode()
23
meth public abstract java.lang.Class<? extends java.lang.annotation.Annotation> annotationType()
24
meth public abstract java.lang.String toString()
25
26
CLSS public abstract interface !annotation java.lang.annotation.Documented
27
 anno 0 java.lang.annotation.Documented()
28
 anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
29
 anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[ANNOTATION_TYPE])
30
intf java.lang.annotation.Annotation
31
32
CLSS public abstract interface !annotation java.lang.annotation.Retention
33
 anno 0 java.lang.annotation.Documented()
34
 anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
35
 anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[ANNOTATION_TYPE])
36
intf java.lang.annotation.Annotation
37
meth public abstract java.lang.annotation.RetentionPolicy value()
38
39
CLSS public abstract interface !annotation java.lang.annotation.Target
40
 anno 0 java.lang.annotation.Documented()
41
 anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
42
 anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[ANNOTATION_TYPE])
43
intf java.lang.annotation.Annotation
44
meth public abstract java.lang.annotation.ElementType[] value()
45
46
CLSS public abstract interface java.util.EventListener
47
48
CLSS public java.util.EventObject
49
cons public init(java.lang.Object)
50
fld protected java.lang.Object source
51
intf java.io.Serializable
52
meth public java.lang.Object getSource()
53
meth public java.lang.String toString()
54
supr java.lang.Object
55
hfds serialVersionUID
56
57
CLSS public final org.netbeans.api.editor.DialogBinding
58
cons public init()
59
meth public static void bindComponentToDocument(javax.swing.text.Document,int,int,int,javax.swing.text.JTextComponent)
60
meth public static void bindComponentToDocument(javax.swing.text.Document,int,int,javax.swing.text.JTextComponent)
61
meth public static void bindComponentToFile(org.openide.filesystems.FileObject,int,int,int,javax.swing.text.JTextComponent)
62
meth public static void bindComponentToFile(org.openide.filesystems.FileObject,int,int,javax.swing.text.JTextComponent)
63
supr java.lang.Object
64
hfds LOG
65
66
CLSS public final org.netbeans.api.editor.EditorActionNames
67
fld public final static java.lang.String gotoDeclaration = "goto-declaration"
68
fld public final static java.lang.String moveCodeElementDown = "move-code-element-down"
69
fld public final static java.lang.String moveCodeElementUp = "move-code-element-up"
70
fld public final static java.lang.String removeSurroundingCode = "remove-surrounding-code"
71
fld public final static java.lang.String toggleLineNumbers = "toggle-line-numbers"
72
fld public final static java.lang.String toggleNonPrintableCharacters = "toggle-non-printable-characters"
73
fld public final static java.lang.String toggleRectangularSelection = "toggle-rectangular-selection"
74
fld public final static java.lang.String toggleToolbar = "toggle-toolbar"
75
fld public final static java.lang.String transposeLetters = "transpose-letters"
76
fld public final static java.lang.String zoomTextIn = "zoom-text-in"
77
fld public final static java.lang.String zoomTextOut = "zoom-text-out"
78
supr java.lang.Object
79
80
CLSS public abstract interface !annotation org.netbeans.api.editor.EditorActionRegistration
81
 anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=SOURCE)
82
 anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE, METHOD])
83
intf java.lang.annotation.Annotation
84
meth public abstract !hasdefault int menuPosition()
85
meth public abstract !hasdefault int popupPosition()
86
meth public abstract !hasdefault int toolBarPosition()
87
meth public abstract !hasdefault int weight()
88
meth public abstract !hasdefault java.lang.String iconResource()
89
meth public abstract !hasdefault java.lang.String menuPath()
90
meth public abstract !hasdefault java.lang.String menuText()
91
meth public abstract !hasdefault java.lang.String mimeType()
92
meth public abstract !hasdefault java.lang.String popupPath()
93
meth public abstract !hasdefault java.lang.String popupText()
94
meth public abstract !hasdefault java.lang.String preferencesKey()
95
meth public abstract !hasdefault java.lang.String shortDescription()
96
meth public abstract java.lang.String name()
97
98
CLSS public abstract interface !annotation org.netbeans.api.editor.EditorActionRegistrations
99
 anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=SOURCE)
100
 anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE, METHOD])
101
intf java.lang.annotation.Annotation
102
meth public abstract org.netbeans.api.editor.EditorActionRegistration[] value()
103
104
CLSS public final org.netbeans.api.editor.EditorRegistry
105
fld public final static java.lang.String COMPONENT_REMOVED_PROPERTY = "componentRemoved"
106
fld public final static java.lang.String FOCUSED_DOCUMENT_PROPERTY = "focusedDocument"
107
fld public final static java.lang.String FOCUS_GAINED_PROPERTY = "focusGained"
108
fld public final static java.lang.String FOCUS_LOST_PROPERTY = "focusLost"
109
fld public final static java.lang.String LAST_FOCUSED_REMOVED_PROPERTY = "lastFocusedRemoved"
110
meth public static java.util.List<? extends javax.swing.text.JTextComponent> componentList()
111
meth public static javax.swing.text.JTextComponent focusedComponent()
112
meth public static javax.swing.text.JTextComponent lastFocusedComponent()
113
meth public static void addPropertyChangeListener(java.beans.PropertyChangeListener)
114
meth public static void removePropertyChangeListener(java.beans.PropertyChangeListener)
115
supr java.lang.Object
116
hfds LOG,USED_BY_CLONEABLE_EDITOR_PROPERTY,ignoredAncestorClass,items,pcs
117
hcls AncestorL,CloneableEditorUsageL,FocusL,Item,PackageAccessor,PropertyDocL
118
119
CLSS public final org.netbeans.api.editor.EditorUtilities
120
meth public static javax.swing.Action getAction(javax.swing.text.EditorKit,java.lang.String)
121
supr java.lang.Object
122
123
CLSS public final org.netbeans.api.editor.document.EditorDocumentUtils
124
meth public static void runExclusive(javax.swing.text.Document,java.lang.Runnable)
125
supr java.lang.Object
126
127
CLSS public abstract interface org.netbeans.spi.editor.codegen.CodeGenerator
128
innr public abstract interface static Factory
129
meth public abstract java.lang.String getDisplayName()
130
meth public abstract void invoke()
131
132
CLSS public abstract interface static org.netbeans.spi.editor.codegen.CodeGenerator$Factory
133
 outer org.netbeans.spi.editor.codegen.CodeGenerator
134
 anno 0 org.netbeans.spi.editor.mimelookup.MimeLocation(java.lang.Class<? extends org.netbeans.spi.editor.mimelookup.InstanceProvider> instanceProviderClass=class org.netbeans.spi.editor.mimelookup.InstanceProvider, java.lang.String subfolderName="CodeGenerators")
135
meth public abstract java.util.List<? extends org.netbeans.spi.editor.codegen.CodeGenerator> create(org.openide.util.Lookup)
136
137
CLSS public abstract interface org.netbeans.spi.editor.codegen.CodeGeneratorContextProvider
138
 anno 0 org.netbeans.spi.editor.mimelookup.MimeLocation(java.lang.Class<? extends org.netbeans.spi.editor.mimelookup.InstanceProvider> instanceProviderClass=class org.netbeans.spi.editor.mimelookup.InstanceProvider, java.lang.String subfolderName="CodeGeneratorContextProviders")
139
innr public abstract interface static Task
140
meth public abstract void runTaskWithinContext(org.openide.util.Lookup,org.netbeans.spi.editor.codegen.CodeGeneratorContextProvider$Task)
141
142
CLSS public abstract interface static org.netbeans.spi.editor.codegen.CodeGeneratorContextProvider$Task
143
 outer org.netbeans.spi.editor.codegen.CodeGeneratorContextProvider
144
meth public abstract void run(org.openide.util.Lookup)
145
146
CLSS public abstract interface org.netbeans.spi.editor.document.UndoableEditWrapper
147
meth public abstract javax.swing.undo.UndoableEdit wrap(javax.swing.undo.UndoableEdit,javax.swing.text.Document)
148
 anno 0 org.netbeans.api.annotations.common.NonNull()
149
 anno 1 org.netbeans.api.annotations.common.NonNull()
150
 anno 2 org.netbeans.api.annotations.common.NonNull()
151
152
CLSS public abstract interface org.netbeans.spi.editor.highlighting.HighlightAttributeValue<%0 extends java.lang.Object>
153
meth public abstract {org.netbeans.spi.editor.highlighting.HighlightAttributeValue%0} getValue(javax.swing.text.JTextComponent,javax.swing.text.Document,java.lang.Object,int,int)
154
155
CLSS public final org.netbeans.spi.editor.highlighting.HighlightsChangeEvent
156
cons public init(org.netbeans.spi.editor.highlighting.HighlightsContainer,int,int)
157
meth public int getEndOffset()
158
meth public int getStartOffset()
159
supr java.util.EventObject
160
hfds endOffset,startOffset
161
162
CLSS public abstract interface org.netbeans.spi.editor.highlighting.HighlightsChangeListener
163
intf java.util.EventListener
164
meth public abstract void highlightChanged(org.netbeans.spi.editor.highlighting.HighlightsChangeEvent)
165
166
CLSS public abstract interface org.netbeans.spi.editor.highlighting.HighlightsContainer
167
fld public final static java.lang.String ATTR_EXTENDS_EMPTY_LINE = "org.netbeans.spi.editor.highlighting.HighlightsContainer.ATTR_EXTENDS_EMPTY_LINE"
168
fld public final static java.lang.String ATTR_EXTENDS_EOL = "org.netbeans.spi.editor.highlighting.HighlightsContainer.ATTR_EXTENDS_EOL"
169
meth public abstract org.netbeans.spi.editor.highlighting.HighlightsSequence getHighlights(int,int)
170
meth public abstract void addHighlightsChangeListener(org.netbeans.spi.editor.highlighting.HighlightsChangeListener)
171
meth public abstract void removeHighlightsChangeListener(org.netbeans.spi.editor.highlighting.HighlightsChangeListener)
172
173
CLSS public final org.netbeans.spi.editor.highlighting.HighlightsLayer
174
meth public java.lang.String toString()
175
meth public static org.netbeans.spi.editor.highlighting.HighlightsLayer create(java.lang.String,org.netbeans.spi.editor.highlighting.ZOrder,boolean,org.netbeans.spi.editor.highlighting.HighlightsContainer)
176
supr java.lang.Object
177
hfds accessor,container,fixedSize,layerTypeId,zOrder
178
hcls PackageAccessor
179
180
CLSS public abstract interface org.netbeans.spi.editor.highlighting.HighlightsLayerFactory
181
innr public final static Context
182
meth public abstract org.netbeans.spi.editor.highlighting.HighlightsLayer[] createLayers(org.netbeans.spi.editor.highlighting.HighlightsLayerFactory$Context)
183
184
CLSS public final static org.netbeans.spi.editor.highlighting.HighlightsLayerFactory$Context
185
 outer org.netbeans.spi.editor.highlighting.HighlightsLayerFactory
186
meth public javax.swing.text.Document getDocument()
187
meth public javax.swing.text.JTextComponent getComponent()
188
supr java.lang.Object
189
hfds component,document
190
191
CLSS public abstract interface org.netbeans.spi.editor.highlighting.HighlightsSequence
192
fld public final static org.netbeans.spi.editor.highlighting.HighlightsSequence EMPTY
193
meth public abstract boolean moveNext()
194
meth public abstract int getEndOffset()
195
meth public abstract int getStartOffset()
196
meth public abstract javax.swing.text.AttributeSet getAttributes()
197
198
CLSS public final org.netbeans.spi.editor.highlighting.ZOrder
199
fld public final static org.netbeans.spi.editor.highlighting.ZOrder BOTTOM_RACK
200
fld public final static org.netbeans.spi.editor.highlighting.ZOrder CARET_RACK
201
fld public final static org.netbeans.spi.editor.highlighting.ZOrder DEFAULT_RACK
202
fld public final static org.netbeans.spi.editor.highlighting.ZOrder SHOW_OFF_RACK
203
fld public final static org.netbeans.spi.editor.highlighting.ZOrder SYNTAX_RACK
204
fld public final static org.netbeans.spi.editor.highlighting.ZOrder TOP_RACK
205
meth public java.lang.String toString()
206
meth public org.netbeans.spi.editor.highlighting.ZOrder forPosition(int)
207
supr java.lang.Object
208
hfds COMPARATOR,LOG,position,rack
209
210
CLSS public abstract org.netbeans.spi.editor.highlighting.support.AbstractHighlightsContainer
211
cons protected init()
212
intf org.netbeans.spi.editor.highlighting.HighlightsContainer
213
meth protected final void fireHighlightsChange(int,int)
214
meth public abstract org.netbeans.spi.editor.highlighting.HighlightsSequence getHighlights(int,int)
215
meth public final void addHighlightsChangeListener(org.netbeans.spi.editor.highlighting.HighlightsChangeListener)
216
meth public final void removeHighlightsChangeListener(org.netbeans.spi.editor.highlighting.HighlightsChangeListener)
217
supr java.lang.Object
218
hfds listeners
219
220
CLSS public final org.netbeans.spi.editor.highlighting.support.OffsetsBag
221
cons public init(javax.swing.text.Document)
222
cons public init(javax.swing.text.Document,boolean)
223
meth public org.netbeans.spi.editor.highlighting.HighlightsSequence getHighlights(int,int)
224
meth public void addAllHighlights(org.netbeans.spi.editor.highlighting.HighlightsSequence)
225
meth public void addHighlight(int,int,javax.swing.text.AttributeSet)
226
meth public void clear()
227
meth public void discard()
228
meth public void removeHighlights(int,int,boolean)
229
meth public void setHighlights(org.netbeans.spi.editor.highlighting.HighlightsSequence)
230
meth public void setHighlights(org.netbeans.spi.editor.highlighting.support.OffsetsBag)
231
supr org.netbeans.spi.editor.highlighting.support.AbstractHighlightsContainer
232
hfds LOG,discardCaller,discardThreadId,docListener,document,lastAddIndex,lastMoveNextIndex,marks,mergeHighlights,version
233
hcls DocL,Mark,Seq
234
235
CLSS public final org.netbeans.spi.editor.highlighting.support.PositionsBag
236
cons public init(javax.swing.text.Document)
237
cons public init(javax.swing.text.Document,boolean)
238
meth public org.netbeans.spi.editor.highlighting.HighlightsSequence getHighlights(int,int)
239
meth public void addAllHighlights(org.netbeans.spi.editor.highlighting.support.PositionsBag)
240
meth public void addHighlight(javax.swing.text.Position,javax.swing.text.Position,javax.swing.text.AttributeSet)
241
meth public void clear()
242
meth public void removeHighlights(int,int)
243
meth public void removeHighlights(javax.swing.text.Position,javax.swing.text.Position,boolean)
244
meth public void setHighlights(org.netbeans.spi.editor.highlighting.support.PositionsBag)
245
supr org.netbeans.spi.editor.highlighting.support.AbstractHighlightsContainer
246
hfds LOG,attributes,document,marks,mergeHighlights,version
247
hcls Seq
248
249
CLSS public abstract interface !annotation org.netbeans.spi.editor.mimelookup.MimeLocation
250
 anno 0 java.lang.annotation.Documented()
251
 anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
252
 anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE])
253
intf java.lang.annotation.Annotation
254
meth public abstract !hasdefault java.lang.Class<? extends org.netbeans.spi.editor.mimelookup.InstanceProvider> instanceProviderClass()
255
meth public abstract java.lang.String subfolderName()
256
257
CLSS public abstract interface org.netbeans.spi.editor.typinghooks.DeletedTextInterceptor
258
innr public abstract interface static Factory
259
innr public final static Context
260
meth public abstract boolean beforeRemove(org.netbeans.spi.editor.typinghooks.DeletedTextInterceptor$Context) throws javax.swing.text.BadLocationException
261
meth public abstract void afterRemove(org.netbeans.spi.editor.typinghooks.DeletedTextInterceptor$Context) throws javax.swing.text.BadLocationException
262
meth public abstract void cancelled(org.netbeans.spi.editor.typinghooks.DeletedTextInterceptor$Context)
263
meth public abstract void remove(org.netbeans.spi.editor.typinghooks.DeletedTextInterceptor$Context) throws javax.swing.text.BadLocationException
264
265
CLSS public final static org.netbeans.spi.editor.typinghooks.DeletedTextInterceptor$Context
266
 outer org.netbeans.spi.editor.typinghooks.DeletedTextInterceptor
267
meth public boolean isBackwardDelete()
268
meth public int getOffset()
269
meth public java.lang.String getText()
270
meth public javax.swing.text.Document getDocument()
271
meth public javax.swing.text.JTextComponent getComponent()
272
supr java.lang.Object
273
hfds backwardDelete,component,document,offset,removedText
274
275
CLSS public abstract interface static org.netbeans.spi.editor.typinghooks.DeletedTextInterceptor$Factory
276
 outer org.netbeans.spi.editor.typinghooks.DeletedTextInterceptor
277
meth public abstract org.netbeans.spi.editor.typinghooks.DeletedTextInterceptor createDeletedTextInterceptor(org.netbeans.api.editor.mimelookup.MimePath)
278
279
CLSS public abstract interface org.netbeans.spi.editor.typinghooks.TypedBreakInterceptor
280
innr public abstract interface static Factory
281
innr public final static MutableContext
282
innr public static Context
283
meth public abstract boolean beforeInsert(org.netbeans.spi.editor.typinghooks.TypedBreakInterceptor$Context) throws javax.swing.text.BadLocationException
284
meth public abstract void afterInsert(org.netbeans.spi.editor.typinghooks.TypedBreakInterceptor$Context) throws javax.swing.text.BadLocationException
285
meth public abstract void cancelled(org.netbeans.spi.editor.typinghooks.TypedBreakInterceptor$Context)
286
meth public abstract void insert(org.netbeans.spi.editor.typinghooks.TypedBreakInterceptor$MutableContext) throws javax.swing.text.BadLocationException
287
288
CLSS public static org.netbeans.spi.editor.typinghooks.TypedBreakInterceptor$Context
289
 outer org.netbeans.spi.editor.typinghooks.TypedBreakInterceptor
290
meth public int getBreakInsertOffset()
291
meth public int getCaretOffset()
292
meth public javax.swing.text.Document getDocument()
293
meth public javax.swing.text.JTextComponent getComponent()
294
supr java.lang.Object
295
hfds breakInsertOffset,caretOffset,component,document
296
297
CLSS public abstract interface static org.netbeans.spi.editor.typinghooks.TypedBreakInterceptor$Factory
298
 outer org.netbeans.spi.editor.typinghooks.TypedBreakInterceptor
299
meth public abstract org.netbeans.spi.editor.typinghooks.TypedBreakInterceptor createTypedBreakInterceptor(org.netbeans.api.editor.mimelookup.MimePath)
300
301
CLSS public final static org.netbeans.spi.editor.typinghooks.TypedBreakInterceptor$MutableContext
302
 outer org.netbeans.spi.editor.typinghooks.TypedBreakInterceptor
303
meth public !varargs void setText(java.lang.String,int,int,int[])
304
supr org.netbeans.spi.editor.typinghooks.TypedBreakInterceptor$Context
305
hfds breakInsertPosition,caretPosition,insertionText,reindentBlocks
306
307
CLSS public abstract interface org.netbeans.spi.editor.typinghooks.TypedTextInterceptor
308
innr public abstract interface static Factory
309
innr public final static MutableContext
310
innr public static Context
311
meth public abstract boolean beforeInsert(org.netbeans.spi.editor.typinghooks.TypedTextInterceptor$Context) throws javax.swing.text.BadLocationException
312
meth public abstract void afterInsert(org.netbeans.spi.editor.typinghooks.TypedTextInterceptor$Context) throws javax.swing.text.BadLocationException
313
meth public abstract void cancelled(org.netbeans.spi.editor.typinghooks.TypedTextInterceptor$Context)
314
meth public abstract void insert(org.netbeans.spi.editor.typinghooks.TypedTextInterceptor$MutableContext) throws javax.swing.text.BadLocationException
315
316
CLSS public static org.netbeans.spi.editor.typinghooks.TypedTextInterceptor$Context
317
 outer org.netbeans.spi.editor.typinghooks.TypedTextInterceptor
318
meth public int getOffset()
319
meth public java.lang.String getText()
320
meth public javax.swing.text.Document getDocument()
321
meth public javax.swing.text.JTextComponent getComponent()
322
supr java.lang.Object
323
hfds component,document,offset,originallyTypedText
324
325
CLSS public abstract interface static org.netbeans.spi.editor.typinghooks.TypedTextInterceptor$Factory
326
 outer org.netbeans.spi.editor.typinghooks.TypedTextInterceptor
327
meth public abstract org.netbeans.spi.editor.typinghooks.TypedTextInterceptor createTypedTextInterceptor(org.netbeans.api.editor.mimelookup.MimePath)
328
329
CLSS public final static org.netbeans.spi.editor.typinghooks.TypedTextInterceptor$MutableContext
330
 outer org.netbeans.spi.editor.typinghooks.TypedTextInterceptor
331
meth public java.lang.String getText()
332
meth public void setText(java.lang.String,int)
333
supr org.netbeans.spi.editor.typinghooks.TypedTextInterceptor$Context
334
hfds caretPosition,insertionText
335
hcls Accessor
336
(-)a/editor.lib2/src/org/netbeans/modules/editor/lib2/highlighting/BlockHighlighting.java (-2 lines)
Lines 55-61 Link Here
55
import org.netbeans.api.editor.mimelookup.MimeLookup;
55
import org.netbeans.api.editor.mimelookup.MimeLookup;
56
import org.netbeans.api.editor.settings.AttributesUtilities;
56
import org.netbeans.api.editor.settings.AttributesUtilities;
57
import org.netbeans.api.editor.settings.FontColorSettings;
57
import org.netbeans.api.editor.settings.FontColorSettings;
58
import org.netbeans.modules.editor.lib2.search.EditorFindSupport;
59
import org.netbeans.spi.editor.highlighting.HighlightsChangeEvent;
58
import org.netbeans.spi.editor.highlighting.HighlightsChangeEvent;
60
import org.netbeans.spi.editor.highlighting.HighlightsChangeListener;
59
import org.netbeans.spi.editor.highlighting.HighlightsChangeListener;
61
import org.netbeans.spi.editor.highlighting.support.AbstractHighlightsContainer;
60
import org.netbeans.spi.editor.highlighting.support.AbstractHighlightsContainer;
Lines 83-89 Link Here
83
        this.bag = new PositionsBag(document);
82
        this.bag = new PositionsBag(document);
84
        this.bag.addHighlightsChangeListener(this);
83
        this.bag.addHighlightsChangeListener(this);
85
        
84
        
86
        EditorFindSupport.getInstance().hookLayer(this, component);
87
    }
85
    }
88
86
89
    public String getLayerTypeId() {
87
    public String getLayerTypeId() {
(-)a/editor.lib2/src/org/netbeans/modules/editor/lib2/highlighting/Factory.java (-14 lines)
Lines 85-104 Link Here
85
        );
85
        );
86
86
87
        layers.add(HighlightsLayer.create(
87
        layers.add(HighlightsLayer.create(
88
            BLOCK_SEARCH_LAYER, 
89
            ZOrder.SHOW_OFF_RACK.forPosition(100),
90
            true,
91
            new BlockHighlighting(BLOCK_SEARCH_LAYER, context.getComponent()))
92
        );
93
94
        layers.add(HighlightsLayer.create(
95
            TextSearchHighlighting.LAYER_TYPE_ID,
96
            ZOrder.SHOW_OFF_RACK.forPosition(200),
97
            true,
98
            new TextSearchHighlighting(context.getComponent()))
99
        );
100
101
        layers.add(HighlightsLayer.create(
102
            INC_SEARCH_LAYER, 
88
            INC_SEARCH_LAYER, 
103
            ZOrder.SHOW_OFF_RACK.forPosition(300),
89
            ZOrder.SHOW_OFF_RACK.forPosition(300),
104
            true,
90
            true,
(-)a/editor.lib2/src/org/netbeans/modules/editor/lib2/search/Bundle.properties (-100 lines)
Lines 1-100 Link Here
1
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
2
#
3
# Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
4
#
5
# Oracle and Java are registered trademarks of Oracle and/or its affiliates.
6
# Other names may be trademarks of their respective owners.
7
#
8
# The contents of this file are subject to the terms of either the GNU
9
# General Public License Version 2 only ("GPL") or the Common
10
# Development and Distribution License("CDDL") (collectively, the
11
# "License"). You may not use this file except in compliance with the
12
# License. You can obtain a copy of the License at
13
# http://www.netbeans.org/cddl-gplv2.html
14
# or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
15
# specific language governing permissions and limitations under the
16
# License.  When distributing the software, include this License Header
17
# Notice in each file and include the License file at
18
# nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
19
# particular file as subject to the "Classpath" exception as provided
20
# by Oracle in the GPL Version 2 section of the License file that
21
# accompanied this code. If applicable, add the following below the
22
# License Header, with the fields enclosed by brackets [] replaced by
23
# your own identifying information:
24
# "Portions Copyrighted [year] [name of copyright owner]"
25
#
26
# Contributor(s):
27
#
28
# The Original Software is NetBeans. The Initial Developer of the Original
29
# Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
30
# Microsystems, Inc. All Rights Reserved.
31
#
32
# If you wish your version of this file to be governed by only the CDDL
33
# or only the GPL Version 2, indicate your decision by adding
34
# "[Contributor] elects to include this software in this distribution
35
# under the [CDDL or GPL Version 2] license." If you do not indicate a
36
# single choice of license, a recipient has the option to distribute
37
# your version of this file under either the CDDL, the GPL Version 2 or
38
# to extend the choice of license to its licensees as provided above.
39
# However, if you add GPL Version 2 code and therefore, elected the GPL
40
# Version 2 license, then the option applies only if the new code is
41
# made subject to such option by the copyright holder.
42
43
44
#FindSupport related stuff
45
find-found=''{0}'' found at {1}
46
find-not-found=''{0}'' not found
47
find-wrap-start=End of the document reached. Continuing search from beginning.
48
find-wrap-end=Beginning of the document reached. Continuing search from end.
49
find-block-wrap-start=End of the selection reached. Continuing search from beginning.
50
find-block-wrap-end=Beginning of the selection reached. Continuing search from end.
51
find-items-replaced={0} of {1} items replaced
52
pattern-error-dialog-title=Regular Expression Error
53
pattern-error-dialog-content=Regular Expression Pattern Syntax Error:
54
pattern-error-missing-escape-hint=Hint: The $ character has to be escaped (\\$) when it is not followed by a numeric character in a regular expression.
55
56
#FindDialogPanel
57
find-what=Find What:
58
find-what-mnemonic=F
59
ACSD_find-what=
60
find-replace-with=Replace With:
61
find-replace-with-mnemonic=l
62
ACSD_find-replace-with=
63
find-highlight-search=\ Highligh&t Results
64
find-highlight-search-tooltip=Highlights all occurrences of the searched text.
65
find-inc-search=\ &Incremental Search
66
find-inc-search-tooltip=Tries to find text as you type.
67
find-match-case=\ &Match Case
68
find-match-case-tooltip=Search the document only for text with the same capitalization.
69
find-smart-case=\ Smart Case
70
find-smart-case-mnemonic=S
71
find-smart-case-tooltip=Matches case if at least one character in the searched text is uppercase.
72
find-preserve-case=\ Preser&ve Case when Replacing
73
find-preserve-case-tooltip=Preserve case according to found instance of word.
74
find-whole-words=\ &Whole Words
75
find-whole-words-tooltip=Matches the searched text only to whole words in the document.
76
find-backward-search=\ Search &Backwards
77
find-backward-search-tooltip=Searches backwards from the current cursor position.
78
find-wrap-search=\ Wra&p Around
79
find-wrap-search-tooltip=Continues search from the beginning if end of the document is reached.
80
find-reg-exp=\ Regular &Expressions
81
find-reg-exp-tooltip=Uses regular expressions to search the document.
82
find-block-search=\ Sear&ch Selection
83
find-block-search-tooltip=Searches for occurrences in a selected block of text only.
84
ACSD_find=
85
86
#FindDialogSupport
87
find-title=Find
88
replace-title=Replace
89
find-button-find=Find
90
find-button-find-mnemonic=D
91
find-button-replace=Replace
92
find-button-replace-mnemonic=R
93
find-button-replace-all=Replace All
94
find-button-replace-all-mnemonic=A
95
find-button-cancel=Close
96
ACSD_find-button-find=
97
ACSD_find-button-replace=
98
ACSD_find-button-replace-all=
99
ACSD_find-button-cancel=
100
(-)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.11.0
3
spec.version.base=1.12.0
(-)a/editor.search/nbproject/project.xml (-1 / +9 lines)
Lines 37-43 Link Here
37
                    <compile-dependency/>
37
                    <compile-dependency/>
38
                    <run-dependency>
38
                    <run-dependency>
39
                        <release-version>3</release-version>
39
                        <release-version>3</release-version>
40
                        <specification-version>3.30.0</specification-version>
40
                        <specification-version>3.35.0</specification-version>
41
                    </run-dependency>
41
                    </run-dependency>
42
                </dependency>
42
                </dependency>
43
                <dependency>
43
                <dependency>
Lines 93-98 Link Here
93
                    </run-dependency>
93
                    </run-dependency>
94
                </dependency>
94
                </dependency>
95
                <dependency>
95
                <dependency>
96
                    <code-name-base>org.openide.dialogs</code-name-base>
97
                    <build-prerequisite/>
98
                    <compile-dependency/>
99
                    <run-dependency>
100
                        <specification-version>7.29</specification-version>
101
                    </run-dependency>
102
                </dependency>
103
                <dependency>
96
                    <code-name-base>org.openide.filesystems</code-name-base>
104
                    <code-name-base>org.openide.filesystems</code-name-base>
97
                    <build-prerequisite/>
105
                    <build-prerequisite/>
98
                    <compile-dependency/>
106
                    <compile-dependency/>
(-)a/editor.search/src/org/netbeans/modules/editor/search/Bundle.properties (+12 lines)
Lines 28-30 Link Here
28
CTL_PreserveCase=Preser&ve Case
28
CTL_PreserveCase=Preser&ve Case
29
TOOLTIP_PreserveCase=Preserve case according to found instance of word. (Auto -> Car, auto -> car, AUTO -> CAR)
29
TOOLTIP_PreserveCase=Preserve case according to found instance of word. (Auto -> Car, auto -> car, AUTO -> CAR)
30
CTL_BackwardsReplace=Replace &Backwards
30
CTL_BackwardsReplace=Replace &Backwards
31
32
#FindSupport related stuff
33
find-found=''{0}'' found at {1}
34
find-not-found=''{0}'' not found
35
find-wrap-start=End of the document reached. Continuing search from beginning.
36
find-wrap-end=Beginning of the document reached. Continuing search from end.
37
find-block-wrap-start=End of the selection reached. Continuing search from beginning.
38
find-block-wrap-end=Beginning of the selection reached. Continuing search from end.
39
find-items-replaced={0} of {1} items replaced
40
pattern-error-dialog-title=Regular Expression Error
41
pattern-error-dialog-content=Regular Expression Pattern Syntax Error:
42
pattern-error-missing-escape-hint=Hint: The $ character has to be escaped (\\$) when it is not followed by a numeric character in a regular expression.
(-)a/editor.lib2/src/org/netbeans/modules/editor/lib2/search/DocumentFinder.java (-1 / +1 lines)
Lines 42-48 Link Here
42
 * made subject to such option by the copyright holder.
42
 * made subject to such option by the copyright holder.
43
 */
43
 */
44
44
45
package org.netbeans.modules.editor.lib2.search;
45
package org.netbeans.modules.editor.search;
46
46
47
import java.util.Map;
47
import java.util.Map;
48
import java.util.MissingResourceException;
48
import java.util.MissingResourceException;
(-)a/editor.lib2/src/org/netbeans/modules/editor/lib2/search/EditorFindSupport.java (-2 / +2 lines)
Lines 42-48 Link Here
42
 * made subject to such option by the copyright holder.
42
 * made subject to such option by the copyright holder.
43
 */
43
 */
44
44
45
package org.netbeans.modules.editor.lib2.search;
45
package org.netbeans.modules.editor.search;
46
46
47
import java.awt.Insets;
47
import java.awt.Insets;
48
import java.awt.Rectangle;
48
import java.awt.Rectangle;
Lines 73-79 Link Here
73
import org.netbeans.modules.editor.lib2.DocUtils;
73
import org.netbeans.modules.editor.lib2.DocUtils;
74
import org.netbeans.modules.editor.lib2.highlighting.BlockHighlighting;
74
import org.netbeans.modules.editor.lib2.highlighting.BlockHighlighting;
75
import org.netbeans.modules.editor.lib2.highlighting.Factory;
75
import org.netbeans.modules.editor.lib2.highlighting.Factory;
76
import org.netbeans.modules.editor.lib2.search.DocumentFinder.FindReplaceResult;
76
import org.netbeans.modules.editor.search.DocumentFinder.FindReplaceResult;
77
import org.openide.util.NbBundle;
77
import org.openide.util.NbBundle;
78
78
79
/**
79
/**
(-)a/editor.search/src/org/netbeans/modules/editor/search/ReplaceBar.java (-1 lines)
Lines 51-57 Link Here
51
import javax.swing.text.BadLocationException;
51
import javax.swing.text.BadLocationException;
52
import javax.swing.text.JTextComponent;
52
import javax.swing.text.JTextComponent;
53
import org.netbeans.editor.GuardedException;
53
import org.netbeans.editor.GuardedException;
54
import org.netbeans.modules.editor.lib2.search.EditorFindSupport;
55
import org.openide.awt.Mnemonics;
54
import org.openide.awt.Mnemonics;
56
import org.openide.util.NbBundle;
55
import org.openide.util.NbBundle;
57
56
(-)a/editor.search/src/org/netbeans/modules/editor/search/SearchBar.java (-3 / +2 lines)
Lines 72-78 Link Here
72
import org.netbeans.editor.BaseDocument;
72
import org.netbeans.editor.BaseDocument;
73
import org.netbeans.editor.BaseKit;
73
import org.netbeans.editor.BaseKit;
74
import org.netbeans.editor.MultiKeymap;
74
import org.netbeans.editor.MultiKeymap;
75
import org.netbeans.modules.editor.lib2.search.EditorFindSupport;
76
import org.netbeans.modules.editor.search.SearchPropertiesSupport.SearchProperties;
75
import org.netbeans.modules.editor.search.SearchPropertiesSupport.SearchProperties;
77
import org.openide.awt.CloseButtonFactory;
76
import org.openide.awt.CloseButtonFactory;
78
import org.openide.awt.Mnemonics;
77
import org.openide.awt.Mnemonics;
Lines 185-191 Link Here
185
        leftSeparator.setOrientation(SwingConstants.VERTICAL);
184
        leftSeparator.setOrientation(SwingConstants.VERTICAL);
186
        add(leftSeparator);
185
        add(leftSeparator);
187
186
188
        findPreviousButton = createFindButton("org/netbeans/modules/editor/resources/find_previous.png", "CTL_FindPrevious"); // NOI18N
187
        findPreviousButton = createFindButton("org/netbeans/modules/editor/search/resources/find_previous.png", "CTL_FindPrevious"); // NOI18N
189
        findPreviousButton.addActionListener(new ActionListener() {
188
        findPreviousButton.addActionListener(new ActionListener() {
190
189
191
            @Override
190
            @Override
Lines 194-200 Link Here
194
            }
193
            }
195
        });
194
        });
196
        add(findPreviousButton);
195
        add(findPreviousButton);
197
        findNextButton = createFindButton("org/netbeans/modules/editor/resources/find_next.png", "CTL_FindNext"); // NOI18N
196
        findNextButton = createFindButton("org/netbeans/modules/editor/search/resources/find_next.png", "CTL_FindNext"); // NOI18N
198
        findNextButton.addActionListener(new ActionListener() {
197
        findNextButton.addActionListener(new ActionListener() {
199
198
200
            @Override
199
            @Override
(-)a/editor.search/src/org/netbeans/modules/editor/search/SearchNbEditorKit.java (+15 lines)
Lines 43-50 Link Here
43
43
44
import java.awt.Component;
44
import java.awt.Component;
45
import java.awt.Container;
45
import java.awt.Container;
46
import java.awt.event.ActionEvent;
46
import java.beans.PropertyChangeEvent;
47
import java.beans.PropertyChangeEvent;
47
import java.beans.PropertyChangeListener;
48
import java.beans.PropertyChangeListener;
49
import javax.swing.Action;
48
import javax.swing.BoxLayout;
50
import javax.swing.BoxLayout;
49
import javax.swing.JComponent;
51
import javax.swing.JComponent;
50
import javax.swing.JPanel;
52
import javax.swing.JPanel;
Lines 52-57 Link Here
52
import javax.swing.text.JTextComponent;
54
import javax.swing.text.JTextComponent;
53
import org.netbeans.api.editor.EditorRegistry;
55
import org.netbeans.api.editor.EditorRegistry;
54
import org.netbeans.api.editor.mimelookup.MimeRegistration;
56
import org.netbeans.api.editor.mimelookup.MimeRegistration;
57
import org.netbeans.editor.BaseKit;
55
import org.netbeans.editor.EditorUI;
58
import org.netbeans.editor.EditorUI;
56
import org.netbeans.editor.SideBarFactory;
59
import org.netbeans.editor.SideBarFactory;
57
import org.netbeans.editor.ext.ExtKit;
60
import org.netbeans.editor.ext.ExtKit;
Lines 151-154 Link Here
151
            EditorRegistry.addPropertyChangeListener(searchAndReplaceBarPersistentListener);
154
            EditorRegistry.addPropertyChangeListener(searchAndReplaceBarPersistentListener);
152
        }
155
        }
153
    }
156
    }
157
158
    public static void openFindIfNecessary(EditorUI eui, ActionEvent evt) {
159
        Object findWhat = EditorFindSupport.getInstance().getFindProperty(EditorFindSupport.FIND_WHAT);
160
        if (findWhat == null || !(findWhat instanceof String) || ((String) findWhat).isEmpty()) {
161
162
            Action findAction = ((BaseKit) eui.getComponent().getUI().getEditorKit(
163
                    eui.getComponent())).getActionByName("find");
164
            if (findAction != null) {
165
                findAction.actionPerformed(evt);
166
            }
167
        }
168
    }
154
}
169
}
(-)a/editor.search/src/org/netbeans/modules/editor/search/SearchPropertiesSupport.java (-1 lines)
Lines 45-51 Link Here
45
import java.util.List;
45
import java.util.List;
46
import java.util.Map;
46
import java.util.Map;
47
import java.util.prefs.Preferences;
47
import java.util.prefs.Preferences;
48
import org.netbeans.modules.editor.lib2.search.EditorFindSupport;
49
import org.openide.util.NbPreferences;
48
import org.openide.util.NbPreferences;
50
49
51
public final class SearchPropertiesSupport {
50
public final class SearchPropertiesSupport {
(-)a/editor.lib2/src/org/netbeans/modules/editor/lib2/highlighting/TextSearchHighlighting.java (-3 / +59 lines)
Lines 42-51 Link Here
42
 * made subject to such option by the copyright holder.
42
 * made subject to such option by the copyright holder.
43
 */
43
 */
44
44
45
package org.netbeans.modules.editor.lib2.highlighting;
45
package org.netbeans.modules.editor.search;
46
46
47
import java.beans.PropertyChangeEvent;
47
import java.beans.PropertyChangeEvent;
48
import java.beans.PropertyChangeListener;
48
import java.beans.PropertyChangeListener;
49
import java.util.ArrayList;
49
import java.util.logging.Level;
50
import java.util.logging.Level;
50
import java.util.logging.Logger;
51
import java.util.logging.Logger;
51
import javax.swing.event.DocumentEvent;
52
import javax.swing.event.DocumentEvent;
Lines 53-68 Link Here
53
import javax.swing.text.AttributeSet;
54
import javax.swing.text.AttributeSet;
54
import javax.swing.text.BadLocationException;
55
import javax.swing.text.BadLocationException;
55
import javax.swing.text.Document;
56
import javax.swing.text.Document;
57
import javax.swing.text.EditorKit;
56
import javax.swing.text.JTextComponent;
58
import javax.swing.text.JTextComponent;
57
import javax.swing.text.SimpleAttributeSet;
59
import javax.swing.text.SimpleAttributeSet;
58
import org.netbeans.api.editor.mimelookup.MimeLookup;
60
import org.netbeans.api.editor.mimelookup.MimeLookup;
59
import org.netbeans.api.editor.mimelookup.MimePath;
61
import org.netbeans.api.editor.mimelookup.MimePath;
62
import org.netbeans.api.editor.mimelookup.MimeRegistration;
60
import org.netbeans.api.editor.settings.FontColorNames;
63
import org.netbeans.api.editor.settings.FontColorNames;
61
import org.netbeans.api.editor.settings.FontColorSettings;
64
import org.netbeans.api.editor.settings.FontColorSettings;
62
import org.netbeans.modules.editor.lib2.search.EditorFindSupport;
65
import org.netbeans.modules.editor.lib2.highlighting.BlockHighlighting;
66
import static org.netbeans.modules.editor.lib2.highlighting.Factory.BLOCK_SEARCH_LAYER;
67
import static org.netbeans.modules.editor.lib2.highlighting.Factory.INC_SEARCH_LAYER;
63
import org.netbeans.spi.editor.highlighting.HighlightsChangeEvent;
68
import org.netbeans.spi.editor.highlighting.HighlightsChangeEvent;
64
import org.netbeans.spi.editor.highlighting.HighlightsChangeListener;
69
import org.netbeans.spi.editor.highlighting.HighlightsChangeListener;
70
import org.netbeans.spi.editor.highlighting.HighlightsLayer;
71
import org.netbeans.spi.editor.highlighting.HighlightsLayerFactory;
65
import org.netbeans.spi.editor.highlighting.HighlightsSequence;
72
import org.netbeans.spi.editor.highlighting.HighlightsSequence;
73
import org.netbeans.spi.editor.highlighting.ZOrder;
66
import org.netbeans.spi.editor.highlighting.support.AbstractHighlightsContainer;
74
import org.netbeans.spi.editor.highlighting.support.AbstractHighlightsContainer;
67
import org.netbeans.spi.editor.highlighting.support.OffsetsBag;
75
import org.netbeans.spi.editor.highlighting.support.OffsetsBag;
68
import org.openide.util.RequestProcessor;
76
import org.openide.util.RequestProcessor;
Lines 87-93 Link Here
87
    /** Creates a new instance of TextSearchHighlighting */
95
    /** Creates a new instance of TextSearchHighlighting */
88
    public TextSearchHighlighting(JTextComponent component) {
96
    public TextSearchHighlighting(JTextComponent component) {
89
        // Determine the mime type
97
        // Determine the mime type
90
        String mimeType = BlockHighlighting.getMimeType(component);
98
        String mimeType = getMimeType(component);
91
        this.mimePath = mimeType == null ? MimePath.EMPTY : MimePath.parse(mimeType);
99
        this.mimePath = mimeType == null ? MimePath.EMPTY : MimePath.parse(mimeType);
92
        
100
        
93
        this.component = component;
101
        this.component = component;
Lines 187-190 Link Here
187
        AttributeSet attribs = fcs.getFontColors(FontColorNames.HIGHLIGHT_SEARCH_COLORING);
195
        AttributeSet attribs = fcs.getFontColors(FontColorNames.HIGHLIGHT_SEARCH_COLORING);
188
        return attribs == null ? SimpleAttributeSet.EMPTY : attribs;
196
        return attribs == null ? SimpleAttributeSet.EMPTY : attribs;
189
    }
197
    }
198
199
    /* package */ static String getMimeType(JTextComponent component) {
200
        Document doc = component.getDocument();
201
        String mimeType = (String) doc.getProperty("mimeType"); //NOI18N
202
        if (mimeType == null) {
203
            EditorKit kit = component.getUI().getEditorKit(component);
204
            if (kit != null) {
205
                mimeType = kit.getContentType();
206
            }
207
        }
208
        return mimeType;
209
    }
210
211
    @MimeRegistration(mimeType = "", service = HighlightsLayerFactory.class)
212
    public static final class FactoryImpl implements HighlightsLayerFactory {
213
214
        public final class SearchBlockHighlighting extends BlockHighlighting {
215
            public SearchBlockHighlighting(String layerId, JTextComponent component) {
216
                super(layerId,component);
217
                EditorFindSupport.getInstance().hookLayer(this, component);
218
            }
219
        }
220
221
        @Override
222
        public HighlightsLayer[] createLayers(HighlightsLayerFactory.Context context) {
223
            ArrayList<HighlightsLayer> layers = new ArrayList<HighlightsLayer>();
224
            layers.add(HighlightsLayer.create(
225
                    TextSearchHighlighting.LAYER_TYPE_ID,
226
                    ZOrder.SHOW_OFF_RACK.forPosition(200),
227
                    true,
228
                    new TextSearchHighlighting(context.getComponent())));
229
230
            layers.add(HighlightsLayer.create(
231
                    BLOCK_SEARCH_LAYER,
232
                    ZOrder.SHOW_OFF_RACK.forPosition(100),
233
                    true,
234
                    new SearchBlockHighlighting(BLOCK_SEARCH_LAYER, context.getComponent())));
235
236
            layers.add(HighlightsLayer.create(
237
                    INC_SEARCH_LAYER,
238
                    ZOrder.SHOW_OFF_RACK.forPosition(300),
239
                    true,
240
                    new SearchBlockHighlighting(INC_SEARCH_LAYER, context.getComponent())));
241
242
            return layers.toArray(new HighlightsLayer[layers.size()]);
243
        }
244
245
    } // End of FactoryImpl class
190
}
246
}
(-)a/editor.search/src/org/netbeans/modules/editor/search/actions/Bundle.properties (-1 / +5 lines)
Lines 1-4 Link Here
1
replace=Replace
1
replace=Replace
2
replace_menu_text=R&eplace...
2
replace_menu_text=R&eplace...
3
find=Find
3
find=Find
4
find_menu_text=&Find...
4
find_menu_text=&Find...
5
find-next=Find Next Occurrence
6
find-previous=Find Previous Occurrence
7
find-selection=Find Selection
8
toggle-highlight-search=Toggle Highlight Search
(-)a/editor.search/src/org/netbeans/modules/editor/search/actions/FindNextAction.java (+76 lines)
Line 0 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2013 Oracle and/or its affiliates. All rights reserved.
5
 *
6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
7
 * Other names may be trademarks of their respective owners.
8
 *
9
 * The contents of this file are subject to the terms of either the GNU
10
 * General Public License Version 2 only ("GPL") or the Common
11
 * Development and Distribution License("CDDL") (collectively, the
12
 * "License"). You may not use this file except in compliance with the
13
 * License. You can obtain a copy of the License at
14
 * http://www.netbeans.org/cddl-gplv2.html
15
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
16
 * specific language governing permissions and limitations under the
17
 * License.  When distributing the software, include this License Header
18
 * Notice in each file and include the License file at
19
 * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
20
 * particular file as subject to the "Classpath" exception as provided
21
 * by Oracle in the GPL Version 2 section of the License file that
22
 * accompanied this code. If applicable, add the following below the
23
 * License Header, with the fields enclosed by brackets [] replaced by
24
 * your own identifying information:
25
 * "Portions Copyrighted [year] [name of copyright owner]"
26
 *
27
 * If you wish your version of this file to be governed by only the CDDL
28
 * or only the GPL Version 2, indicate your decision by adding
29
 * "[Contributor] elects to include this software in this distribution
30
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
31
 * single choice of license, a recipient has the option to distribute
32
 * your version of this file under either the CDDL, the GPL Version 2 or
33
 * to extend the choice of license to its licensees as provided above.
34
 * However, if you add GPL Version 2 code and therefore, elected the GPL
35
 * Version 2 license, then the option applies only if the new code is
36
 * made subject to such option by the copyright holder.
37
 *
38
 * Contributor(s):
39
 *
40
 * Portions Copyrighted 2013 Sun Microsystems, Inc.
41
 */
42
package org.netbeans.modules.editor.search.actions;
43
44
import java.awt.event.ActionEvent;
45
import javax.swing.text.JTextComponent;
46
import org.netbeans.api.editor.EditorActionRegistration;
47
import org.netbeans.editor.BaseKit;
48
import org.netbeans.editor.EditorUI;
49
import org.netbeans.modules.editor.search.EditorFindSupport;
50
import org.netbeans.modules.editor.search.SearchNbEditorKit;
51
import org.netbeans.spi.editor.AbstractEditorAction;
52
53
// NOI18N
54
55
@EditorActionRegistration(name = BaseKit.findNextAction, iconResource = "org/netbeans/modules/editor/search/resources/find_next.png") // NOI18N
56
public class FindNextAction  extends AbstractEditorAction {
57
    static final long serialVersionUID = 6878814427731642684L;
58
59
    public FindNextAction() {
60
        super();
61
    }
62
63
    @Override
64
    public void actionPerformed(ActionEvent evt, JTextComponent target) {
65
        if (target != null) {
66
            EditorUI eui = org.netbeans.editor.Utilities.getEditorUI(target);
67
            if (eui.getComponent().getClientProperty("AsTextField") == null) {
68
                //NOI18N
69
                EditorFindSupport.getInstance().setFocusedTextComponent(eui.getComponent());
70
            }
71
            SearchNbEditorKit.openFindIfNecessary(eui, evt);
72
            EditorFindSupport.getInstance().find(null, false);
73
        }
74
    }
75
76
}
(-)a/editor.search/src/org/netbeans/modules/editor/search/actions/FindPreviousAction.java (+76 lines)
Line 0 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2013 Oracle and/or its affiliates. All rights reserved.
5
 *
6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
7
 * Other names may be trademarks of their respective owners.
8
 *
9
 * The contents of this file are subject to the terms of either the GNU
10
 * General Public License Version 2 only ("GPL") or the Common
11
 * Development and Distribution License("CDDL") (collectively, the
12
 * "License"). You may not use this file except in compliance with the
13
 * License. You can obtain a copy of the License at
14
 * http://www.netbeans.org/cddl-gplv2.html
15
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
16
 * specific language governing permissions and limitations under the
17
 * License.  When distributing the software, include this License Header
18
 * Notice in each file and include the License file at
19
 * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
20
 * particular file as subject to the "Classpath" exception as provided
21
 * by Oracle in the GPL Version 2 section of the License file that
22
 * accompanied this code. If applicable, add the following below the
23
 * License Header, with the fields enclosed by brackets [] replaced by
24
 * your own identifying information:
25
 * "Portions Copyrighted [year] [name of copyright owner]"
26
 *
27
 * If you wish your version of this file to be governed by only the CDDL
28
 * or only the GPL Version 2, indicate your decision by adding
29
 * "[Contributor] elects to include this software in this distribution
30
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
31
 * single choice of license, a recipient has the option to distribute
32
 * your version of this file under either the CDDL, the GPL Version 2 or
33
 * to extend the choice of license to its licensees as provided above.
34
 * However, if you add GPL Version 2 code and therefore, elected the GPL
35
 * Version 2 license, then the option applies only if the new code is
36
 * made subject to such option by the copyright holder.
37
 *
38
 * Contributor(s):
39
 *
40
 * Portions Copyrighted 2013 Sun Microsystems, Inc.
41
 */
42
package org.netbeans.modules.editor.search.actions;
43
44
import java.awt.event.ActionEvent;
45
import javax.swing.text.JTextComponent;
46
import org.netbeans.api.editor.EditorActionRegistration;
47
import org.netbeans.editor.BaseKit;
48
import org.netbeans.editor.EditorUI;
49
import org.netbeans.modules.editor.search.EditorFindSupport;
50
import org.netbeans.modules.editor.search.SearchNbEditorKit;
51
import org.netbeans.spi.editor.AbstractEditorAction;
52
53
// NOI18N
54
55
@EditorActionRegistration(name = BaseKit.findPreviousAction, iconResource = "org/netbeans/modules/editor/search/resources/find_previous.png") // NOI18N
56
public class FindPreviousAction extends AbstractEditorAction {
57
    static final long serialVersionUID = -43746947902694926L;
58
59
    public FindPreviousAction() {
60
        super();
61
    }
62
63
    @Override
64
    public void actionPerformed(ActionEvent evt, JTextComponent target) {
65
        if (target != null) {
66
            EditorUI eui = org.netbeans.editor.Utilities.getEditorUI(target);
67
            if (eui.getComponent().getClientProperty("AsTextField") == null) {
68
                //NOI18N
69
                EditorFindSupport.getInstance().setFocusedTextComponent(eui.getComponent());
70
            }
71
            SearchNbEditorKit.openFindIfNecessary(eui, evt);
72
            EditorFindSupport.getInstance().find(null, true);
73
        }
74
    }
75
76
}
(-)a/editor.search/src/org/netbeans/modules/editor/search/actions/FindSelectionAction.java (+135 lines)
Line 0 Link Here
1
package org.netbeans.modules.editor.search.actions;
2
3
/*
4
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
5
 *
6
 * Copyright 2013 Oracle and/or its affiliates. All rights reserved.
7
 *
8
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
9
 * Other names may be trademarks of their respective owners.
10
 *
11
 * The contents of this file are subject to the terms of either the GNU
12
 * General Public License Version 2 only ("GPL") or the Common
13
 * Development and Distribution License("CDDL") (collectively, the
14
 * "License"). You may not use this file except in compliance with the
15
 * License. You can obtain a copy of the License at
16
 * http://www.netbeans.org/cddl-gplv2.html
17
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
18
 * specific language governing permissions and limitations under the
19
 * License.  When distributing the software, include this License Header
20
 * Notice in each file and include the License file at
21
 * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
22
 * particular file as subject to the "Classpath" exception as provided
23
 * by Oracle in the GPL Version 2 section of the License file that
24
 * accompanied this code. If applicable, add the following below the
25
 * License Header, with the fields enclosed by brackets [] replaced by
26
 * your own identifying information:
27
 * "Portions Copyrighted [year] [name of copyright owner]"
28
 *
29
 * If you wish your version of this file to be governed by only the CDDL
30
 * or only the GPL Version 2, indicate your decision by adding
31
 * "[Contributor] elects to include this software in this distribution
32
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
33
 * single choice of license, a recipient has the option to distribute
34
 * your version of this file under either the CDDL, the GPL Version 2 or
35
 * to extend the choice of license to its licensees as provided above.
36
 * However, if you add GPL Version 2 code and therefore, elected the GPL
37
 * Version 2 license, then the option applies only if the new code is
38
 * made subject to such option by the copyright holder.
39
 *
40
 * Contributor(s):
41
 *
42
 * Portions Copyrighted 2013 Sun Microsystems, Inc.
43
 */
44
45
46
import java.awt.event.ActionEvent;
47
import java.util.HashMap;
48
import java.util.Map;
49
import javax.swing.text.BadLocationException;
50
import javax.swing.text.Caret;
51
import javax.swing.text.JTextComponent;
52
import org.netbeans.api.editor.EditorActionRegistration;
53
import org.netbeans.editor.BaseDocument;
54
import org.netbeans.editor.BaseKit;
55
import org.netbeans.editor.EditorUI;
56
import org.netbeans.editor.Utilities;
57
import org.netbeans.modules.editor.search.EditorFindSupport;
58
import org.netbeans.modules.editor.search.SearchNbEditorKit;
59
import org.netbeans.spi.editor.AbstractEditorAction;
60
61
/** Finds either selection or if there's no selection it finds
62
 * the word where the cursor is standing.
63
 */
64
// NOI18N
65
@EditorActionRegistration(name = BaseKit.findSelectionAction, iconResource = "org/netbeans/modules/editor/search/resources/find_selection.png") // NOI18N
66
public class FindSelectionAction extends AbstractEditorAction {
67
    static final long serialVersionUID = -5601618936504699565L;
68
69
    public FindSelectionAction() {
70
        super();
71
    }
72
73
    @Override
74
    public void actionPerformed(ActionEvent evt, JTextComponent target) {
75
        if (target != null) {
76
            EditorFindSupport findSupport = EditorFindSupport.getInstance();
77
            Caret caret = target.getCaret();
78
            int dotPos = caret.getDot();
79
            HashMap props = new HashMap(findSupport.createDefaultFindProperties());
80
            String searchWord = null;
81
            boolean revert = false;
82
            Boolean originalValue = null;
83
            Map revertMap = (Map) props.get(EditorFindSupport.REVERT_MAP);
84
            Boolean revertValue = revertMap != null ? (Boolean) revertMap.get(EditorFindSupport.FIND_WHOLE_WORDS) : null;
85
            if (Utilities.isSelectionShowing(caret)) {
86
                // valid selection
87
                searchWord = target.getSelectedText();
88
                originalValue = (Boolean) props.put(EditorFindSupport.FIND_WHOLE_WORDS, Boolean.FALSE);
89
                if (Boolean.FALSE.equals(revertValue)) {
90
                    revertMap.remove(EditorFindSupport.FIND_WHOLE_WORDS);
91
                } else {
92
                    revert = !Boolean.FALSE.equals(originalValue);
93
                }
94
            } else {
95
                // no selection, get current word
96
                try {
97
                    searchWord = Utilities.getIdentifier((BaseDocument) target.getDocument(), dotPos);
98
                    originalValue = (Boolean) props.put(EditorFindSupport.FIND_WHOLE_WORDS, Boolean.TRUE);
99
                    if (Boolean.TRUE.equals(revertValue)) {
100
                        revertMap.remove(EditorFindSupport.FIND_WHOLE_WORDS);
101
                    } else {
102
                        revert = !Boolean.TRUE.equals(originalValue);
103
                    }
104
                } catch (BadLocationException e) {
105
                    e.printStackTrace();
106
                }
107
            }
108
            if (searchWord != null) {
109
                int n = searchWord.indexOf('\n');
110
                if (n >= 0) {
111
                    searchWord = searchWord.substring(0, n);
112
                }
113
                props.put(EditorFindSupport.FIND_WHAT, searchWord);
114
                if (revert) {
115
                    revertMap = new HashMap();
116
                    revertMap.put(EditorFindSupport.FIND_WHOLE_WORDS, originalValue != null ? originalValue : Boolean.FALSE);
117
                    props.put(EditorFindSupport.REVERT_MAP, revertMap);
118
                }
119
                props.put(EditorFindSupport.FIND_BLOCK_SEARCH, Boolean.FALSE);
120
                props.put(EditorFindSupport.FIND_BLOCK_SEARCH_START, null);
121
                props.put(EditorFindSupport.FIND_BLOCK_SEARCH_END, null);
122
                EditorUI eui = org.netbeans.editor.Utilities.getEditorUI(target);
123
                if (eui.getComponent().getClientProperty("AsTextField") == null) {
124
                    //NOI18N
125
                    findSupport.setFocusedTextComponent(eui.getComponent());
126
                }
127
                findSupport.putFindProperties(props);
128
                if (findSupport.find(null, false)) {
129
                    findSupport.addToHistory(new EditorFindSupport.SPW((String) props.get(EditorFindSupport.FIND_WHAT), (Boolean) props.get(EditorFindSupport.FIND_WHOLE_WORDS), (Boolean) props.get(EditorFindSupport.FIND_MATCH_CASE), (Boolean) props.get(EditorFindSupport.FIND_REG_EXP)));
130
                }
131
            }
132
        }
133
    }
134
135
}
(-)a/editor.search/src/org/netbeans/modules/editor/search/actions/ToggleHighlightSearchAction.java (+153 lines)
Line 0 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2013 Oracle and/or its affiliates. All rights reserved.
5
 *
6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
7
 * Other names may be trademarks of their respective owners.
8
 *
9
 * The contents of this file are subject to the terms of either the GNU
10
 * General Public License Version 2 only ("GPL") or the Common
11
 * Development and Distribution License("CDDL") (collectively, the
12
 * "License"). You may not use this file except in compliance with the
13
 * License. You can obtain a copy of the License at
14
 * http://www.netbeans.org/cddl-gplv2.html
15
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
16
 * specific language governing permissions and limitations under the
17
 * License.  When distributing the software, include this License Header
18
 * Notice in each file and include the License file at
19
 * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
20
 * particular file as subject to the "Classpath" exception as provided
21
 * by Oracle in the GPL Version 2 section of the License file that
22
 * accompanied this code. If applicable, add the following below the
23
 * License Header, with the fields enclosed by brackets [] replaced by
24
 * your own identifying information:
25
 * "Portions Copyrighted [year] [name of copyright owner]"
26
 *
27
 * If you wish your version of this file to be governed by only the CDDL
28
 * or only the GPL Version 2, indicate your decision by adding
29
 * "[Contributor] elects to include this software in this distribution
30
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
31
 * single choice of license, a recipient has the option to distribute
32
 * your version of this file under either the CDDL, the GPL Version 2 or
33
 * to extend the choice of license to its licensees as provided above.
34
 * However, if you add GPL Version 2 code and therefore, elected the GPL
35
 * Version 2 license, then the option applies only if the new code is
36
 * made subject to such option by the copyright holder.
37
 *
38
 * Contributor(s):
39
 *
40
 * Portions Copyrighted 2013 Sun Microsystems, Inc.
41
 */
42
package org.netbeans.modules.editor.search.actions;
43
44
import java.awt.Component;
45
import java.awt.event.ActionEvent;
46
import java.beans.PropertyChangeEvent;
47
import java.beans.PropertyChangeListener;
48
import javax.swing.ButtonModel;
49
import javax.swing.JToggleButton;
50
import javax.swing.event.ChangeEvent;
51
import javax.swing.event.ChangeListener;
52
import javax.swing.text.JTextComponent;
53
import org.netbeans.api.editor.EditorActionRegistration;
54
import org.netbeans.editor.BaseKit;
55
import org.netbeans.modules.editor.search.EditorFindSupport;
56
import org.netbeans.modules.editor.search.SearchNbEditorKit;
57
import org.netbeans.spi.editor.AbstractEditorAction;
58
import org.openide.util.WeakListeners;
59
import org.openide.util.actions.Presenter;
60
61
// suspending the use of EditorActionRegistration due to #167063
62
63
//    @EditorActionRegistration(name = BaseKit.toggleHighlightSearchAction,
64
@EditorActionRegistration(name = BaseKit.toggleHighlightSearchAction, iconResource = "org/netbeans/modules/editor/search/resources/toggle_highlight.png") // NOI18N
65
public class ToggleHighlightSearchAction extends AbstractEditorAction implements Presenter.Toolbar {
66
    static final long serialVersionUID = 4603809175771743200L;
67
68
69
    public ToggleHighlightSearchAction() {
70
        super();
71
        putValue("noIconInMenu", Boolean.TRUE); // NOI18N
72
        JToggleButton b = new MyGaGaButton();
73
        b.setModel(new HighlightButtonModel());
74
        b.setAction(this);
75
    }
76
77
    public void actionPerformed(ActionEvent evt, JTextComponent target) {
78
        if (target != null) {
79
            Boolean cur = (Boolean) EditorFindSupport.getInstance().getFindProperty(EditorFindSupport.FIND_HIGHLIGHT_SEARCH);
80
            if (cur == null || cur.booleanValue() == false) {
81
                cur = Boolean.TRUE;
82
            } else {
83
                cur = Boolean.FALSE;
84
            }
85
            EditorFindSupport.getInstance().putFindProperty(EditorFindSupport.FIND_HIGHLIGHT_SEARCH, cur);
86
        }
87
    }
88
89
    public Component getToolbarPresenter() {
90
        JToggleButton b = new MyGaGaButton();
91
        b.setModel(new HighlightButtonModel());
92
        b.putClientProperty("hideActionText", Boolean.TRUE); //NOI18N
93
        b.setAction(this);
94
        return b;
95
    }
96
97
    private static final class HighlightButtonModel extends JToggleButton.ToggleButtonModel implements PropertyChangeListener {
98
99
        public HighlightButtonModel() {
100
            EditorFindSupport efs = EditorFindSupport.getInstance();
101
            efs.addPropertyChangeListener(WeakListeners.propertyChange(this, efs));
102
            propertyChange(null);
103
        }
104
105
        public void propertyChange(PropertyChangeEvent evt) {
106
            if (evt == null || evt.getPropertyName() == null || evt.getPropertyName().equals(EditorFindSupport.FIND_HIGHLIGHT_SEARCH)) {
107
                Boolean value = (Boolean) EditorFindSupport.getInstance().getFindProperty(EditorFindSupport.FIND_HIGHLIGHT_SEARCH);
108
                setSelected(value == null ? false : value.booleanValue());
109
            }
110
        }
111
    } // End of HighlightButtonModel class
112
113
    private static final class MyGaGaButton extends JToggleButton implements ChangeListener {
114
115
        public MyGaGaButton() {
116
        }
117
118
        @Override
119
        public void setModel(ButtonModel model) {
120
            ButtonModel oldModel = getModel();
121
            if (oldModel != null) {
122
                oldModel.removeChangeListener(this);
123
            }
124
            super.setModel(model);
125
            ButtonModel newModel = getModel();
126
            if (newModel != null) {
127
                newModel.addChangeListener(this);
128
            }
129
            stateChanged(null);
130
        }
131
132
        public void stateChanged(ChangeEvent evt) {
133
            boolean selected = isSelected();
134
            super.setContentAreaFilled(selected);
135
            super.setBorderPainted(selected);
136
        }
137
138
        @Override
139
        public void setBorderPainted(boolean arg0) {
140
            if (!isSelected()) {
141
                super.setBorderPainted(arg0);
142
            }
143
        }
144
145
        @Override
146
        public void setContentAreaFilled(boolean arg0) {
147
            if (!isSelected()) {
148
                super.setContentAreaFilled(arg0);
149
            }
150
        }
151
    }
152
153
} // End of ToggleHighlightSearchAction class
(-)a/editor.search/src/org/netbeans/modules/editor/search/completion/SearchCompletion.java (-3 / +3 lines)
Lines 47-55 Link Here
47
import javax.swing.text.Document;
47
import javax.swing.text.Document;
48
import javax.swing.text.JTextComponent;
48
import javax.swing.text.JTextComponent;
49
import org.netbeans.api.editor.mimelookup.MimeRegistration;
49
import org.netbeans.api.editor.mimelookup.MimeRegistration;
50
import org.netbeans.modules.editor.lib2.search.EditorFindSupport;
50
import org.netbeans.modules.editor.search.EditorFindSupport;
51
import org.netbeans.modules.editor.lib2.search.EditorFindSupport.RP;
51
import org.netbeans.modules.editor.search.EditorFindSupport.RP;
52
import org.netbeans.modules.editor.lib2.search.EditorFindSupport.SPW;
52
import org.netbeans.modules.editor.search.EditorFindSupport.SPW;
53
import org.netbeans.modules.editor.search.SearchBar;
53
import org.netbeans.modules.editor.search.SearchBar;
54
import org.netbeans.modules.editor.search.SearchNbEditorKit;
54
import org.netbeans.modules.editor.search.SearchNbEditorKit;
55
import org.netbeans.spi.editor.completion.CompletionProvider;
55
import org.netbeans.spi.editor.completion.CompletionProvider;
(-)a/editor.search/src/org/netbeans/modules/editor/search/layer.xml (+38 lines)
Lines 9-13 Link Here
9
                <attr name="scrollable" boolvalue="false"/>
9
                <attr name="scrollable" boolvalue="false"/>
10
            </file>
10
            </file>
11
    </folder>
11
    </folder>
12
13
    <folder name="Toolbars">
14
        <folder name="Default">
15
                 <file name="find-selection">
16
                    <attr name="position" intvalue="6000"/>
17
                </file>
18
                <file name="find-previous">
19
                    <attr name="position" intvalue="7000"/>
20
                </file>
21
                <file name="find-next">
22
                    <attr name="position" intvalue="8000"/>
23
                </file>
24
                <file name="toggle-highlight-search">
25
                    <attr name="position" intvalue="9000"/>
26
                </file>
27
        </folder>
28
    </folder>
29
  </folder>
30
31
  <folder name="Menu">
32
      <folder name="Edit">
33
            <file name="org-netbeans-modules-editor-MainMenuAction$FindSelectionAction.instance">
34
                <attr name="position" intvalue="1600"/>
35
            </file>
36
37
            <file name="org-netbeans-modules-editor-MainMenuAction$FindNextAction.instance">
38
                <attr name="position" intvalue="1700"/>
39
            </file>
40
41
            <file name="org-netbeans-modules-editor-MainMenuAction$FindPreviousAction.instance">
42
                <attr name="position" intvalue="1800"/>
43
            </file>
44
45
            <file name="SeparatorAfterFindPrevious.instance">
46
                <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
47
                <attr name="position" intvalue="1900"/>
48
            </file>
49
      </folder>
12
  </folder>
50
  </folder>
13
</filesystem>
51
</filesystem>
(-)a/editor.lib2/test/unit/src/org/netbeans/modules/editor/lib2/search/DocumentFinderTest.java (-2 / +4 lines)
Lines 39-46 Link Here
39
 *
39
 *
40
 * Portions Copyrighted 2011 Sun Microsystems, Inc.
40
 * Portions Copyrighted 2011 Sun Microsystems, Inc.
41
 */
41
 */
42
package org.netbeans.modules.editor.lib2.search;
42
package org.netbeans.modules.editor.search;
43
43
44
import org.netbeans.modules.editor.search.DocumentFinder;
45
import org.netbeans.modules.editor.search.EditorFindSupport;
44
import javax.swing.text.BadLocationException;
46
import javax.swing.text.BadLocationException;
45
import javax.swing.text.Document;
47
import javax.swing.text.Document;
46
import java.util.HashMap;
48
import java.util.HashMap;
Lines 48-54 Link Here
48
import javax.swing.JTextArea;
50
import javax.swing.JTextArea;
49
import org.junit.Test;
51
import org.junit.Test;
50
import static org.junit.Assert.*;
52
import static org.junit.Assert.*;
51
import org.netbeans.modules.editor.lib2.search.DocumentFinder.FindReplaceResult;
53
import org.netbeans.modules.editor.search.DocumentFinder.FindReplaceResult;
52
54
53
/**
55
/**
54
 * @author Milutin Kristofic
56
 * @author Milutin Kristofic
(-)a/editor.lib2/test/unit/src/org/netbeans/modules/editor/lib2/search/EditorFindSupportTest.java (-1 / +2 lines)
Lines 40-47 Link Here
40
 * Portions Copyrighted 2009 Sun Microsystems, Inc.
40
 * Portions Copyrighted 2009 Sun Microsystems, Inc.
41
 */
41
 */
42
42
43
package org.netbeans.modules.editor.lib2.search;
43
package org.netbeans.modules.editor.search;
44
44
45
import org.netbeans.modules.editor.search.EditorFindSupport;
45
import java.util.HashMap;
46
import java.util.HashMap;
46
import java.util.Map;
47
import java.util.Map;
47
import javax.swing.JTextArea;
48
import javax.swing.JTextArea;
(-)a/editor.search/test/unit/src/org/netbeans/modules/editor/search/SearchPropertiesSupportTest.java (-1 lines)
Lines 43-49 Link Here
43
43
44
import org.junit.Test;
44
import org.junit.Test;
45
import static org.junit.Assert.*;
45
import static org.junit.Assert.*;
46
import org.netbeans.modules.editor.lib2.search.EditorFindSupport;
47
import org.netbeans.modules.editor.search.SearchPropertiesSupport.SearchProperties;
46
import org.netbeans.modules.editor.search.SearchPropertiesSupport.SearchProperties;
48
47
49
public class SearchPropertiesSupportTest {
48
public class SearchPropertiesSupportTest {
(-)a/editor/src/org/netbeans/modules/editor/resources/layer.xml (-29 lines)
Lines 72-94 Link Here
72
                <attr name="position" intvalue="1440"/>
72
                <attr name="position" intvalue="1440"/>
73
            </file>
73
            </file>
74
            
74
            
75
            <file name="org-netbeans-modules-editor-MainMenuAction$FindSelectionAction.instance">
76
                <attr name="position" intvalue="1600"/>
77
            </file>
78
            
79
            <file name="org-netbeans-modules-editor-MainMenuAction$FindNextAction.instance">
80
                <attr name="position" intvalue="1700"/>
81
            </file>
82
        
83
            <file name="org-netbeans-modules-editor-MainMenuAction$FindPreviousAction.instance">
84
                <attr name="position" intvalue="1800"/>
85
            </file>
86
            
87
            <file name="SeparatorAfterFindPrevious.instance">
88
                <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
89
                <attr name="position" intvalue="1900"/>
90
            </file>
91
            
92
            <file name="SeparatorAfterProjectsSearch.instance">
75
            <file name="SeparatorAfterProjectsSearch.instance">
93
                <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
76
                <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
94
                <attr name="position" intvalue="3000"/>
77
                <attr name="position" intvalue="3000"/>
Lines 289-306 Link Here
289
                    <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
272
                    <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
290
                    <attr name="position" intvalue="5000"/>
273
                    <attr name="position" intvalue="5000"/>
291
                </file>
274
                </file>
292
                <file name="find-selection">
293
                    <attr name="position" intvalue="6000"/>
294
                </file>
295
                <file name="find-previous">
296
                    <attr name="position" intvalue="7000"/>
297
                </file>
298
                <file name="find-next">
299
                    <attr name="position" intvalue="8000"/>
300
                </file>
301
                <file name="toggle-highlight-search">
302
                    <attr name="position" intvalue="9000"/>
303
                </file>
304
                <file name="toggle-rectangular-selection">
275
                <file name="toggle-rectangular-selection">
305
                    <attr name="position" intvalue="9500"/>
276
                    <attr name="position" intvalue="9500"/>
306
                </file>
277
                </file>

Return to bug 221823