MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / find

Method find

ij/src/main/java/ij/text/TextPanel.java:642–676  ·  view source on GitHub ↗
(String s)

Source from the content-addressed store, hash-verified

640 public void lostOwnership (Clipboard clip, Transferable cont) {}
641
642 private void find(String s) {
643 int first = 0;
644 if (s==null) {
645 GenericDialog gd = new GenericDialog("Find...", getTextWindow());
646 gd.addStringField("Find: ", searchString, 20);
647 gd.showDialog();
648 if (gd.wasCanceled())
649 return;
650 s = gd.getNextString();
651 } else {
652 if (selEnd>=0 && selEnd<iRowCount-1)
653 first = selEnd + 1;
654 else {
655 IJ.beep();
656 return;
657 }
658 }
659 if (s.equals(""))
660 return;
661 boolean found = false;
662 for (int i=first; i<iRowCount; i++) {
663 String line = new String((char[])(vData.elementAt(i)));
664 if (line.contains(s)) {
665 setSelection(i, i);
666 found = true;
667 first = i + 1;
668 break;
669 }
670 }
671 if (!found) {
672 IJ.beep();
673 first = 0;
674 }
675 searchString = s;
676 }
677
678 private TextWindow getTextWindow() {
679 Component comp = getParent();

Callers 10

doCommandMethod · 0.95
generateSpecificJsonMethod · 0.45
signIdMethod · 0.45
tokenizeMethod · 0.45
regexMethod · 0.45
addComponentsMethod · 0.45
remarkInlineImageFunction · 0.45
replaceAllMethod · 0.45
testRegexMethod · 0.45

Calls 9

getTextWindowMethod · 0.95
addStringFieldMethod · 0.95
showDialogMethod · 0.95
wasCanceledMethod · 0.95
getNextStringMethod · 0.95
beepMethod · 0.95
setSelectionMethod · 0.95
equalsMethod · 0.45
containsMethod · 0.45

Tested by 2

replaceAllMethod · 0.36
testRegexMethod · 0.36