String (String frameText, FindResult ijFindResult, SearchTaskOptions options) { int contextEndOffset = ijFindResult.getEndOffset(); int maxAllowedContextEndOffset = ijFindResult.getEndOffset() + options.contextOneSideLength; if (maxAllowedContextEndOffset > frameText.length()) { maxAllowedContextEndOffset = frameText.length(); } char _char; while (contextEndOffset < maxAllowedContextEndOffset) { _char = frameText.charAt(contextEndOffset); if (_char != '\r' && _char != '\n') { contextEndOffset++; } else { break; } } boolean ellipsis = false; if (contextEndOffset < frameText.length()) { _char = frameText.charAt(contextEndOffset); if (_char != '\n' && _char != '\r') { ellipsis = true; } } String str = frameText.substring(ijFindResult.getEndOffset(), contextEndOffset); str = str.replace('\t', ' '); if (ellipsis) { str += ELLIPSIS; } return str; }