FindWidget

Lookup
Section titled “Lookup”// open the find widget from text editorconst editor = new TextEditor();const widget = await editor.openFindWidget();Search
Section titled “Search”// set search textawait widget.setSearchText('search text');// get search textconst text = await widget.getSearchText();// find nextawait widget.nextMatch();// find previousawait widget.previousMatch();// get result countsconst counts = await widget.getResultCount();const currentResultNumber = counts[0];const totalCount = counts[1];Replace
Section titled “Replace”// toggle replace on/offawait widget.toggleReplace(true); // or false// set replace textawait widget.setReplaceText('replacement');// get replace textconst text = await widget.getReplaceText();// replace current matchawait widget.replace();// replace all matchesawait widget.replaceAll();Switches
Section titled “Switches”// switch 'Match Case' on/offawait widget.toggleMatchCase(true / false);// switch 'Match Whole Word' on/offawait widget.toggleMatchWholeWord(true / false);// switch 'Use Regular Expression' on/offawait widget.toggleUseRegularExpression(true / false);// switch 'Preserve Case' on/offawait widget.togglePreserveCase(true / false);await widget.close();