[hg] main-silver: More flexible search and replace action - fix

  • From: Milutin Kristofic < >
  • To:
  • Subject: [hg] main-silver: More flexible search and replace action - fix
  • Date: Tue, 22 Jan 2013 08:38:13 -0800

changeset 560c4a51903d in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/560c4a51903d
description:
        More flexible search and replace action - fix

diffstat:

 editor.search/src/org/netbeans/modules/editor/search/SearchNbEditorKit.java 
|  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (37 lines):

diff --git 
a/editor.search/src/org/netbeans/modules/editor/search/SearchNbEditorKit.java 
b/editor.search/src/org/netbeans/modules/editor/search/SearchNbEditorKit.java
--- 
a/editor.search/src/org/netbeans/modules/editor/search/SearchNbEditorKit.java
+++ 
b/editor.search/src/org/netbeans/modules/editor/search/SearchNbEditorKit.java
@@ -109,20 +109,22 @@
                             && 
SearchBar.getInstance().getActualTextComponent() != 
EditorRegistry.lastFocusedComponent()
                             && SearchBar.getInstance().isVisible()) {
                         JTextComponent target = 
EditorRegistry.lastFocusedComponent();
-                        EditorUI eui = 
org.netbeans.editor.Utilities.getEditorUI(target);
-                        if (eui != null) {
                             JPanel jp = null;
                             Object clientProperty = 
target.getClientProperty(SearchNbEditorKit.PROP_SEARCH_CONTAINER);
                             if (clientProperty instanceof JPanel) {
                                 jp = (JPanel) clientProperty;
                             } else {
+                            EditorUI eui = 
org.netbeans.editor.Utilities.getEditorUI(target);
+                            if (eui != null) {
+
                                 JComponent comp = eui.hasExtComponent() ? 
eui.getExtComponent() : null;
                                 if (comp != null) {
                                     jp = 
SearchNbEditorKit.findComponent(comp, SearchNbEditorKit.SearchJPanel.class, 
5);
                                 }
                             }
+                        }
                             if (jp != null) {
-                                SearchBar searchBarInstance = 
SearchBar.getInstance(eui.getComponent());
+                            SearchBar searchBarInstance = 
SearchBar.getInstance(target);
                                 ReplaceBar replaceBarInstance = 
ReplaceBar.getInstance(searchBarInstance);
                                 jp.add(searchBarInstance);
                                 if (replaceBarInstance.isVisible()) {
@@ -145,7 +147,6 @@
                         }
 
                     }
-                }
             };
             
EditorRegistry.addPropertyChangeListener(searchAndReplaceBarPersistentListener);
         }

[hg] main-silver: More flexible search and replace action - fix

Milutin Kristofic 01/22/2013

Project Features

About this Project

Editor was started in November 2009, is owned by Martin Ryzl, and has 147 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20140418.2d69abc). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close