boolean (SelectionModel selection, TextRange range) { int[] starts = selection.getBlockSelectionStarts(); int[] ends = selection.getBlockSelectionEnds(); for (int i = 0; i < starts.length; ++i) { if (new TextRange(starts[i], ends[i]).contains(range)) { //todo return true; } } return false; }