@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 matchCase = context.getMatchCase(); boolean wholeWord = context.getWholeWord(); return (RegExReplaceInfo)getNextMatchPosRegExImpl(regex, searchIn,
if (!context.getMatchCase()) { context.setMatchCase(true); context.setSearchFor(toMark.toLowerCase());
@Test public void testConstructor_2Arg() { SearchContext sc = new SearchContext("foo", true); Assert.assertEquals("foo", sc.getSearchFor()); Assert.assertTrue(sc.getMatchCase()); }
@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() + "]"; }
boolean found = findImpl(context); assertTrue(found); assertSelected("chuck", 60, context.getMatchCase()); assertResult(new SearchResult(new DocumentRange(60, 65), 1, markedCount)); found = findImpl(context); assertTrue(found); assertSelected("chuck", 48, context.getMatchCase()); assertResult(new SearchResult(new DocumentRange(48, 53), 1, markedCount)); found = findImpl(context); assertTrue(found); assertSelected("chuck", 32, context.getMatchCase()); assertResult(new SearchResult(new DocumentRange(32, 37), 1, markedCount)); found = findImpl(context); assertTrue(found); assertSelected("chuck", 26, context.getMatchCase()); assertResult(new SearchResult(new DocumentRange(26, 31), 1, markedCount)); found = findImpl(context); found = findImpl(context); assertTrue(found); assertSelected("Chuck", 26, context.getMatchCase()); assertResult(new SearchResult(new DocumentRange(26, 31), 1, markedCount)); found = findImpl(context); found = findImpl(context); assertTrue(found); assertSelected("chuck", 60, context.getMatchCase()); assertResult(new SearchResult(new DocumentRange(60, 65), 1, markedCount)); found = findImpl(context);
boolean found = findImpl(context); assertTrue(found); assertSelected("chuck", 26, context.getMatchCase()); assertResult(new SearchResult(new DocumentRange(26, 31), 1, markedCount)); found = findImpl(context); assertTrue(found); assertSelected("chuck", 32, context.getMatchCase()); assertResult(new SearchResult(new DocumentRange(32, 37), 1, markedCount)); found = findImpl(context); assertTrue(found); assertSelected("chuck", 48, context.getMatchCase()); assertResult(new SearchResult(new DocumentRange(48, 53), 1, markedCount)); found = findImpl(context); assertTrue(found); assertSelected("chuck", 60, context.getMatchCase()); assertResult(new SearchResult(new DocumentRange(60, 65), 1, markedCount)); found = findImpl(context); found = findImpl(context); assertTrue(found); assertSelected("Chuck", 26, context.getMatchCase()); assertResult(new SearchResult(new DocumentRange(26, 31), 1, markedCount)); found = findImpl(context); found = findImpl(context); assertTrue(found); assertSelected("chuck", 32, context.getMatchCase()); assertResult(new SearchResult(new DocumentRange(32, 37), 1, markedCount)); found = findImpl(context);
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 matchCase = context.getMatchCase(); boolean wholeWord = context.getWholeWord(); return (RegExReplaceInfo)getNextMatchPosRegExImpl(regex, searchIn,
if (!context.getMatchCase()) { context.setMatchCase(true); context.setSearchFor(toMark.toLowerCase());