@Override public String toString() { return "[SearchContext: " + "searchFor=" + getSearchFor() + ", replaceWith=" + getReplaceWith() + ", matchCase=" + getMatchCase() + ", wholeWord=" + getWholeWord() + ", regex=" + isRegularExpression() + ", markAll=" + getMarkAll() + "]"; }
if (!context.isRegularExpression()) { int pos = getNextMatchPos(text, findIn, forward, context.getMatchCase(), context.getWholeWord()); do { regExPos = getNextMatchPosRegEx(text, findIn.substring(start), forward, context.getMatchCase(), context.getWholeWord()); if (regExPos!=null) { if (regExPos.x!=regExPos.y) {
boolean goForward = context.getSearchForward(); boolean matchCase = context.getMatchCase(); boolean wholeWord = context.getWholeWord(); return (RegExReplaceInfo)getNextMatchPosRegExImpl(regex, searchIn, goForward, matchCase, wholeWord, replacement);
@Test public void testClone() { String searchFor = "foo"; boolean matchCase = true; boolean markAll = false; boolean regex = true; String replaceWith = "bar"; boolean forward = false; boolean selectionOnly = false;//true; // "true" not yet supported boolean wholeWord = true; SearchContext sc = new SearchContext(searchFor, matchCase); sc.setMarkAll(markAll); sc.setRegularExpression(regex); sc.setReplaceWith(replaceWith); sc.setSearchForward(forward); sc.setSearchSelectionOnly(selectionOnly); sc.setWholeWord(wholeWord); SearchContext sc2 = sc.clone(); Assert.assertEquals(sc2.getSearchFor(), sc.getSearchFor()); Assert.assertEquals(sc2.getMatchCase(), sc.getMatchCase()); Assert.assertEquals(sc2.getMarkAll(), sc.getMarkAll()); Assert.assertEquals(sc2.isRegularExpression(), sc.isRegularExpression()); Assert.assertEquals(sc2.getReplaceWith(), sc.getReplaceWith()); Assert.assertEquals(sc2.getSearchForward(), sc.getSearchForward()); Assert.assertEquals(sc2.getSearchSelectionOnly(), sc.getSearchSelectionOnly()); Assert.assertEquals(sc2.getWholeWord(), sc.getWholeWord()); }
@Override public String toString() { return "[SearchContext: " + "searchFor=" + getSearchFor() + ", replaceWith=" + getReplaceWith() + ", matchCase=" + getMatchCase() + ", wholeWord=" + getWholeWord() + ", regex=" + isRegularExpression() + ", markAll=" + getMarkAll() + "]"; }
if (!context.isRegularExpression()) { int pos = getNextMatchPos(text, findIn, forward, context.getMatchCase(), context.getWholeWord()); do { regExPos = getNextMatchPosRegEx(text, findIn.substring(start), forward, context.getMatchCase(), context.getWholeWord()); if (regExPos!=null) { if (regExPos.x!=regExPos.y) {
boolean goForward = context.getSearchForward(); boolean matchCase = context.getMatchCase(); boolean wholeWord = context.getWholeWord(); return (RegExReplaceInfo)getNextMatchPosRegExImpl(regex, searchIn, goForward, matchCase, wholeWord, replacement);