Search a word from one EditPane in a second EditPane of a view
Submitted by Sunday, 19 September, 2004 - 19:07
on
I have a view with two EditPanes of two different files. My cursor is on one word of one EditPane. I would like to write a macro to search for that word in the second EditPane.
Selecting the word in the first window is easy but how can I direct the search in the second window? For the time being I only found a way to search in the second file in the SAME EditPane that the first one:
import javax.swing.border.*;
textArea.selectWord();
word = textArea.getSelectedText() ;
SearchAndReplace.setSearchString(word);
SearchAndReplace.setAutoWrapAround(false);
SearchAndReplace.setReverseSearch(false);
SearchAndReplace.setIgnoreCase(false);
SearchAndReplace.setRegexp(true);
SearchAndReplace.setSearchFileSet(new CurrentBufferSet());
SearchAndReplace.find(view,buffer.getNext(),0);
Also I would like to have the found word sitting at the top of the window. How can I do that?
Thanks for hints.
Andre
Selecting the word in the first window is easy but how can I direct the search in the second window? For the time being I only found a way to search in the second file in the SAME EditPane that the first one:
import javax.swing.border.*;
textArea.selectWord();
word = textArea.getSelectedText() ;
SearchAndReplace.setSearchString(word);
SearchAndReplace.setAutoWrapAround(false);
SearchAndReplace.setReverseSearch(false);
SearchAndReplace.setIgnoreCase(false);
SearchAndReplace.setRegexp(true);
SearchAndReplace.setSearchFileSet(new CurrentBufferSet());
SearchAndReplace.find(view,buffer.getNext(),0);
Also I would like to have the found word sitting at the top of the window. How can I do that?
Thanks for hints.
Andre