コード例 #1
0
ファイル: SourceViewer.java プロジェクト: neelance/jface4ruby
  /*
   * @see ISourceViewer#setDocument(IDocument, IAnnotationModel, int, int)
   */
  public void setDocument(
      IDocument document,
      IAnnotationModel annotationModel,
      int modelRangeOffset,
      int modelRangeLength) {
    disposeVisualAnnotationModel();

    if (annotationModel != null && document != null) {
      fVisualAnnotationModel = createVisualAnnotationModel(annotationModel);
      fVisualAnnotationModel.connect(document);
    }

    if (modelRangeOffset == -1 && modelRangeLength == -1) super.setDocument(document);
    else super.setDocument(document, modelRangeOffset, modelRangeLength);

    if (fVerticalRuler != null) fVerticalRuler.setModel(fVisualAnnotationModel);

    if (fOverviewRuler != null) fOverviewRuler.setModel(fVisualAnnotationModel);
  }