- Timestamp:
- 06/30/09 18:05:35 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/jabberit_messenger/java_source/src/nu/fw/jeti/util/FindAction.java
r1014 r1064 45 45 46 46 public FindAction(){ 47 //super("find", EditorUtilities.loadIcon("icons/Find16.gif"));48 47 super(I18N.gettext("main.popup.Find")); 49 48 putValue(MNEMONIC_KEY, new Integer(KeyEvent.VK_F)); … … 60 59 JTextComponent text = (JTextComponent) o; 61 60 if(e.getModifiers() == 0 ) 62 {//find Next 61 { 62 //find Next 63 63 if (searchString==null) askSearchString(text); 64 64 if (searchString!=null)search(text,text.getCaretPosition()); … … 83 83 String fulltext = text.getText(); 84 84 85 // // strip out the surplus \r characters86 // StringTokenizer tokenizer = new StringTokenizer(fulltext, "\r");87 // StringBuffer buffer = new StringBuffer();88 // while( tokenizer.hasMoreTokens() ){89 // buffer.append( tokenizer.nextToken() );90 // }91 92 85 //get the substring based on the requested start position 93 86 fulltext = ( fulltext ).substring(startPositionIn); … … 96 89 // so long as we can find the text in the file, go ahead and highlight it 97 90 // if we can't show the dialog 98 if(fulltext.indexOf(searchString) > -1){ 91 if(fulltext.indexOf(searchString) > -1) 92 { 99 93 startPoint = (fulltext.indexOf(searchString) ) + startPositionIn; 100 101 94 endPoint = startPoint + searchStringLength; 102 95 text.requestFocus(); 103 96 text.setCaretPosition(startPoint); 104 //move caret to endPoint - thus highlighting the selected text105 97 text.moveCaretPosition(endPoint); 106 //make the selection visible107 //text.getCaret().setSelectionVisible(true);108 98 } 109 else if (startPositionIn!=0){ 99 else if (startPositionIn!=0) 100 { 110 101 if(JOptionPane.showConfirmDialog(text.getTopLevelAncestor(),MessageFormat.format(I18N.gettext("main.popup.{0}_not_found_until_the_end_of_this_file,_start_again_from_the_beginning?"),new Object[]{searchString})) == JOptionPane.OK_OPTION) 111 102 {
Note: See TracChangeset
for help on using the changeset viewer.