List<Integer> offsets = new ArrayList<Integer>();
while (offset < endOffset) {
// System.out.println("offset: " + offset + "/" + endOffset);
// System.out.println("Finding: " + findModel.getStringToFind() + " = " + offset);
FindResult result = findManager.findString(text, offset, findModel, virtualFile);
if (!result.isStringFound()) {
// System.out.println(findModel.getStringToFind() + ": not found");
break;
}
// System.out.println("result: " + result.toString());
UsageInfo2UsageAdapter usageAdapter = new UsageInfo2UsageAdapter(new UsageInfo(psiFile, result.getStartOffset(), result.getEndOffset()));
Point point = editor.logicalPositionToXY(editor.offsetToLogicalPosition(usageAdapter.getUsageInfo().getNavigationOffset()));
if (visibleArea.contains(point)) {
UsageInfo usageInfo = usageAdapter.getUsageInfo();
int navigationOffset = usageInfo.getNavigationOffset();
if (navigationOffset != caretModel.getOffset()) {
if (!results.contains(navigationOffset)) {
// System.out.println("Adding: " + navigationOffset + "-> " + usageAdapter.getPlainText());
offsets.add(navigationOffset);
}
}
}
final int prevOffset = offset;
offset = result.getEndOffset();
if (prevOffset == offset) {
++offset;
}