Esempio n. 1
0
 /**
  * After this method has been executed the caller knows that any installed annotation hover has
  * been installed.
  */
 protected void ensureAnnotationHoverManagerInstalled() {
   if (fVerticalRuler != null
       && (fAnnotationHover != null || !isVerticalRulerOnlyShowingAnnotations())
       && fVerticalRulerHoveringController == null
       && fHoverControlCreator != null) {
     fVerticalRulerHoveringController =
         new AnnotationBarHoverManager(
             fVerticalRuler, this, fAnnotationHover, fHoverControlCreator);
     fVerticalRulerHoveringController.install(fVerticalRuler.getControl());
     fVerticalRulerHoveringController
         .getInternalAccessor()
         .setInformationControlReplacer(new StickyHoverManager(this));
   }
 }
Esempio n. 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);
  }
Esempio n. 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);
  }