Examples of IVerticalRulerInfo


Examples of org.eclipse.jface.text.source.IVerticalRulerInfo

   * @since 3.1
   */
  private int computeLine(boolean useRulerInfo) {
    int lastLine;
    if (useRulerInfo) {
      IVerticalRulerInfo ruler= getRuler();
      if (ruler == null)
        lastLine= -1;
      else
        lastLine= ruler.getLineOfLastMouseButtonActivity();
    } else {
      ITextSelection selection= getSelection();
      if (selection == null)
        lastLine= -1;
      else
View Full Code Here

Examples of org.eclipse.jface.text.source.IVerticalRulerInfo

  /*
   * @see IEditorActionDelegate#setActiveEditor(org.eclipse.jface.action.IAction, org.eclipse.ui.IEditorPart)
   */
  public void setActiveEditor(IAction callerAction, IEditorPart targetEditor) {
    if (fEditor != null) {
      IVerticalRulerInfo rulerInfo= (IVerticalRulerInfo) fEditor.getAdapter(IVerticalRulerInfo.class);
      if (rulerInfo != null) {
        Control control= rulerInfo.getControl();
        if (control != null && !control.isDisposed())
          control.removeMouseListener(this);
      }

      if (fEditor instanceof ITextEditorExtension)
        ((ITextEditorExtension) fEditor).removeRulerContextMenuListener(this);
    }

    fEditor= (ITextEditor)(targetEditor == null ? null : targetEditor.getAdapter(ITextEditor.class));
    fCallerAction= callerAction;
    fAction= null;

    if (fEditor != null) {
      if (fEditor instanceof ITextEditorExtension)
        ((ITextEditorExtension) fEditor).addRulerContextMenuListener(this);

      IVerticalRulerInfo rulerInfo= (IVerticalRulerInfo) fEditor.getAdapter(IVerticalRulerInfo.class);
      if (rulerInfo != null) {
        fAction= createAction(fEditor, rulerInfo);
        update();

        Control control= rulerInfo.getControl();
        if (control != null && !control.isDisposed())
          control.addMouseListener(this);
      }
    }
  }
View Full Code Here

Examples of org.eclipse.jface.text.source.IVerticalRulerInfo

  /*
   * @see org.eclipse.ui.texteditor.TextEditorAction#setEditor(org.eclipse.ui.texteditor.ITextEditor)
   */
  public void setEditor(ITextEditor editor) {
    if (getTextEditor() != null) {
      IVerticalRulerInfo service= (IVerticalRulerInfo) getTextEditor().getAdapter(IVerticalRulerInfo.class);
      if (service instanceof IVerticalRulerInfoExtension)
        ((IVerticalRulerInfoExtension) service).removeVerticalRulerListener(this);
    }
    super.setEditor(editor);
    if (getTextEditor() != null) {
      IVerticalRulerInfo service= (IVerticalRulerInfo) getTextEditor().getAdapter(IVerticalRulerInfo.class);
      if (service instanceof IVerticalRulerInfoExtension)
        ((IVerticalRulerInfoExtension) service).addVerticalRulerListener(this);
    }
  }
View Full Code Here

Examples of org.eclipse.jface.text.source.IVerticalRulerInfo

     * @param sourceViewer the source viewer to display the hover over
     * @param annotationHover the hover to make focusable
     * @return <code>true</code> if successful, <code>false</code> otherwise
     */
    private boolean makeAnnotationHoverFocusable(ISourceViewer sourceViewer, IAnnotationHover annotationHover) {
      IVerticalRulerInfo info= getVerticalRuler();
      int line= info.getLineOfLastMouseButtonActivity();
      if (line == -1)
        return false;

      try {

View Full Code Here

Examples of org.eclipse.jface.text.source.IVerticalRulerInfo

   * @since 3.1
   */
  private int computeLine(boolean useRulerInfo) {
    int lastLine;
    if (useRulerInfo) {
      IVerticalRulerInfo ruler= getRuler();
      if (ruler == null)
        lastLine= -1;
      else
        lastLine= ruler.getLineOfLastMouseButtonActivity();
    } else {
      ITextSelection selection= getSelection();
      if (selection == null)
        lastLine= -1;
      else
View Full Code Here

Examples of org.eclipse.jface.text.source.IVerticalRulerInfo

   * @since 3.1
   */
  private int computeLine(boolean useRulerInfo) {
    int lastLine;
    if (useRulerInfo) {
      IVerticalRulerInfo ruler= getRuler();
      if (ruler == null)
        lastLine= -1;
      else
        lastLine= ruler.getLineOfLastMouseButtonActivity();
    } else {
      ITextSelection selection= getSelection();
      if (selection == null)
        lastLine= -1;
      else
View Full Code Here

Examples of org.eclipse.jface.text.source.IVerticalRulerInfo

  /*
   * @see org.eclipse.ui.texteditor.TextEditorAction#setEditor(org.eclipse.ui.texteditor.ITextEditor)
   */
  public void setEditor(ITextEditor editor) {
    if (getTextEditor() != null) {
      IVerticalRulerInfo service= (IVerticalRulerInfo) getTextEditor().getAdapter(IVerticalRulerInfo.class);
      if (service instanceof IVerticalRulerInfoExtension)
        ((IVerticalRulerInfoExtension) service).removeVerticalRulerListener(this);
    }
    super.setEditor(editor);
    if (getTextEditor() != null) {
      IVerticalRulerInfo service= (IVerticalRulerInfo) getTextEditor().getAdapter(IVerticalRulerInfo.class);
      if (service instanceof IVerticalRulerInfoExtension)
        ((IVerticalRulerInfoExtension) service).addVerticalRulerListener(this);
    }
  }
View Full Code Here

Examples of org.eclipse.jface.text.source.IVerticalRulerInfo

     *
     * @param annotationHover the hover to make focusable
     * @return <code>true</code> if successful, <code>false</code> otherwise
     */
    private boolean makeAnnotationHoverFocusable(IAnnotationHover annotationHover) {
      IVerticalRulerInfo info= getVerticalRuler();
      int line= info.getLineOfLastMouseButtonActivity();
      if (line == -1)
        return false;

      return getInformationPresenter().openFocusedAnnotationHover(annotationHover, line);
        }
View Full Code Here

Examples of org.eclipse.jface.text.source.IVerticalRulerInfo

  /*
   * @see IEditorActionDelegate#setActiveEditor(org.eclipse.jface.action.IAction, org.eclipse.ui.IEditorPart)
   */
  public void setActiveEditor(IAction callerAction, IEditorPart targetEditor) {
    if (fEditor != null) {
      IVerticalRulerInfo rulerInfo= (IVerticalRulerInfo) fEditor.getAdapter(IVerticalRulerInfo.class);
      if (rulerInfo != null) {
        Control control= rulerInfo.getControl();
        if (control != null && !control.isDisposed())
          control.removeMouseListener(this);
      }

      if (fEditor instanceof ITextEditorExtension)
        ((ITextEditorExtension) fEditor).removeRulerContextMenuListener(this);
    }

    fEditor= (ITextEditor)(targetEditor == null ? null : targetEditor.getAdapter(ITextEditor.class));
    fCallerAction= callerAction;
    fAction= null;

    if (fEditor != null) {
      if (fEditor instanceof ITextEditorExtension)
        ((ITextEditorExtension) fEditor).addRulerContextMenuListener(this);

      IVerticalRulerInfo rulerInfo= (IVerticalRulerInfo) fEditor.getAdapter(IVerticalRulerInfo.class);
      if (rulerInfo != null) {
        fAction= createAction(fEditor, rulerInfo);
        update();

        Control control= rulerInfo.getControl();
        if (control != null && !control.isDisposed())
          control.addMouseListener(this);
      }
    }
  }
View Full Code Here

Examples of org.eclipse.jface.text.source.IVerticalRulerInfo

          false);
    }

    // IRevisionRulerColumn would also be possible but using
    // IVerticalRulerInfo seems to work in more situations.
    IVerticalRulerInfo rulerInfo = AdapterUtils.adapt(editor,
        IVerticalRulerInfo.class);

    BlameInformationControlCreator creator = new BlameInformationControlCreator(
        rulerInfo);
    info.setHoverControlCreator(creator);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.