コード例 #1
0
 @NotNull
 public String getText() {
   RangeHighlighterEx highlighter = this.highlighter;
   if (highlighter == null) throw new RuntimeException("info not applied yet");
   if (!highlighter.isValid()) return "";
   return highlighter.getDocument().getText(TextRange.create(highlighter));
 }
コード例 #2
0
 public boolean changesRange(TextRange range) {
   if (myAltFullRange != null) {
     return range.intersects(myAltFullRange.getStartOffset(), myAltFullRange.getEndOffset());
   } else if (!myMarkers.isEmpty()) {
     TextRange hostRange =
         TextRange.create(
             myMarkers.get(0).first.getStartOffset(),
             myMarkers.get(myMarkers.size() - 1).first.getEndOffset());
     return range.intersects(hostRange);
   }
   return false;
 }