Lines 85-90
import org.jdesktop.layout.GroupLayout.P
Link Here
|
85 |
import org.jdesktop.layout.GroupLayout.ParallelGroup; |
85 |
import org.jdesktop.layout.GroupLayout.ParallelGroup; |
86 |
import org.jdesktop.layout.GroupLayout.SequentialGroup; |
86 |
import org.jdesktop.layout.GroupLayout.SequentialGroup; |
87 |
import org.jdesktop.layout.LayoutStyle; |
87 |
import org.jdesktop.layout.LayoutStyle; |
|
|
88 |
import org.netbeans.api.editor.EditorRegistry; |
88 |
import org.openide.ErrorManager; |
89 |
import org.openide.ErrorManager; |
89 |
import org.openide.awt.Mnemonics; |
90 |
import org.openide.awt.Mnemonics; |
90 |
import org.openide.util.Exceptions; |
91 |
import org.openide.util.Exceptions; |
Lines 136-142
final class BasicSearchForm extends JPan
Link Here
|
136 |
* BasicSearchCriteria.isSearchAndReplace() would return 'false'. */ |
137 |
* BasicSearchCriteria.isSearchAndReplace() would return 'false'. */ |
137 |
searchCriteria.setReplaceString(""); //NOI18N |
138 |
searchCriteria.setReplaceString(""); //NOI18N |
138 |
} |
139 |
} |
139 |
|
140 |
|
140 |
/* |
141 |
/* |
141 |
* Interaction must be already set up when we set values, otherwise |
142 |
* Interaction must be already set up when we set values, otherwise |
142 |
* state of the dialog might not be corresponding to the values, |
143 |
* state of the dialog might not be corresponding to the values, |
Lines 147-152
final class BasicSearchForm extends JPan
Link Here
|
147 |
initPreviousValues(); |
148 |
initPreviousValues(); |
148 |
} else { |
149 |
} else { |
149 |
initValuesFromHistory(); |
150 |
initValuesFromHistory(); |
|
|
151 |
} |
152 |
|
153 |
/* Search for text selected editor */ |
154 |
JTextComponent c = EditorRegistry.lastFocusedComponent(); |
155 |
if (c != null) { |
156 |
String selText = c.getSelectedText(); |
157 |
if (selText != null && selText.length() > 0) { |
158 |
int n = selText.indexOf( '\n' ); |
159 |
if (n >= 0 ) selText = selText.substring(0, n); |
160 |
cboxTextToFind.setSelectedIndex(-1); |
161 |
textToFindEditor.setText(selText); |
162 |
searchCriteria.setTextPattern(selText); |
163 |
} |
150 |
} |
164 |
} |
151 |
} |
165 |
} |
152 |
|
166 |
|