Example #1
0
 /**
  * After this method has been executed the caller knows that any installed overview hover has been
  * installed.
  */
 protected void ensureOverviewHoverManagerInstalled() {
   if (fOverviewRuler != null
       && fOverviewRulerAnnotationHover != null
       && fOverviewRulerHoveringController == null
       && fHoverControlCreator != null) {
     fOverviewRulerHoveringController =
         new OverviewRulerHoverManager(
             fOverviewRuler, this, fOverviewRulerAnnotationHover, fHoverControlCreator);
     fOverviewRulerHoveringController.install(fOverviewRuler.getControl());
     fOverviewRulerHoveringController
         .getInternalAccessor()
         .setInformationControlReplacer(new StickyHoverManager(this));
   }
 }
Example #2
0
  /*
   * @see TextViewer#createControl(Composite, int)
   */
  protected void createControl(Composite parent, int styles) {

    if (fVerticalRuler != null || fOverviewRuler != null) {
      styles = (styles & ~SWT.BORDER);
      fComposite = new Canvas(parent, SWT.NONE);
      fComposite.setLayout(createLayout());
      parent = fComposite;
    }

    super.createControl(parent, styles);

    if (fVerticalRuler != null) fVerticalRuler.createControl(fComposite, this);
    if (fOverviewRuler != null) fOverviewRuler.createControl(fComposite, this);
  }
Example #3
0
  /*
   * @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);
  }