Examples of ITextViewerExtension2


Examples of org.eclipse.jface.text.ITextViewerExtension2

        if (!(sourceViewer instanceof ITextViewerExtension2)) {
            fTextOperationAction.run();
            return;
        }

        final ITextViewerExtension2 textViewerExtension2 = (ITextViewerExtension2) sourceViewer;

        // does a text hover exist?
        final ITextHover textHover = textViewerExtension2.getCurrentTextHover();
        if (textHover == null) {
            // TODO this crashes... why?
            // fTextOperationAction.run();
            return;
        }

        final Point hoverEventLocation = textViewerExtension2.getHoverEventLocation();
        final int offset = computeOffsetAtLocation(sourceViewer, hoverEventLocation.x,
                hoverEventLocation.y);
        if (offset == -1) {
            fTextOperationAction.run();
            return;
View Full Code Here

Examples of org.eclipse.jface.text.ITextViewerExtension2

  private void showMatchingCharacters() {
    if (fMatchingCharacterPainter == null) {
      if (fSourceViewer instanceof ITextViewerExtension2) {
        fMatchingCharacterPainter= new MatchingCharacterPainter(fSourceViewer, fCharacterPairMatcher);
        fMatchingCharacterPainter.setColor(getColor(fMatchingCharacterPainterColorKey));
        ITextViewerExtension2 extension= (ITextViewerExtension2) fSourceViewer;
        extension.addPainter(fMatchingCharacterPainter);
      }
    }
  }
View Full Code Here

Examples of org.eclipse.jface.text.ITextViewerExtension2

   * Disables showing of matching characters.
   */
  private void hideMatchingCharacters() {
    if (fMatchingCharacterPainter != null) {
      if (fSourceViewer instanceof ITextViewerExtension2) {
        ITextViewerExtension2 extension= (ITextViewerExtension2) fSourceViewer;
        extension.removePainter(fMatchingCharacterPainter);
        fMatchingCharacterPainter.deactivate(true);
        fMatchingCharacterPainter.dispose();
        fMatchingCharacterPainter= null;
      }
    }
View Full Code Here

Examples of org.eclipse.jface.text.ITextViewerExtension2

  private void showCursorLine() {
    if (fCursorLinePainter == null) {
      if (fSourceViewer instanceof ITextViewerExtension2) {
        fCursorLinePainter= new CursorLinePainter(fSourceViewer);
        fCursorLinePainter.setHighlightColor(getColor(fCursorLinePainterColorKey));
        ITextViewerExtension2 extension= (ITextViewerExtension2) fSourceViewer;
        extension.addPainter(fCursorLinePainter);
      }
    }
  }
View Full Code Here

Examples of org.eclipse.jface.text.ITextViewerExtension2

   * Hides the cursor line.
   */
  private void hideCursorLine() {
    if (fCursorLinePainter != null) {
      if (fSourceViewer instanceof ITextViewerExtension2) {
        ITextViewerExtension2 extension= (ITextViewerExtension2) fSourceViewer;
        extension.removePainter(fCursorLinePainter);
        fCursorLinePainter.deactivate(true);
        fCursorLinePainter.dispose();
        fCursorLinePainter= null;
      }
    }
View Full Code Here

Examples of org.eclipse.jface.text.ITextViewerExtension2

      if (fSourceViewer instanceof ITextViewerExtension2) {
        fMarginPainter= new MarginPainter(fSourceViewer);
        fMarginPainter.setMarginRulerColor(getColor(fMarginPainterColorKey));
        if (fPreferenceStore != null)
          fMarginPainter.setMarginRulerColumn(fPreferenceStore.getInt(fMarginPainterColumnKey));
        ITextViewerExtension2 extension= (ITextViewerExtension2) fSourceViewer;
        extension.addPainter(fMarginPainter);

        fFontPropertyChangeListener= new FontPropertyChangeListener();
        JFaceResources.getFontRegistry().addListener(fFontPropertyChangeListener);
      }
    }
View Full Code Here

Examples of org.eclipse.jface.text.ITextViewerExtension2

    if (fMarginPainter != null) {
      if (fSourceViewer instanceof ITextViewerExtension2) {
        JFaceResources.getFontRegistry().removeListener(fFontPropertyChangeListener);
        fFontPropertyChangeListener= null;

        ITextViewerExtension2 extension= (ITextViewerExtension2) fSourceViewer;
        extension.removePainter(fMarginPainter);
        fMarginPainter.deactivate(true);
        fMarginPainter.dispose();
        fMarginPainter= null;
      }
    }
View Full Code Here

Examples of org.eclipse.jface.text.ITextViewerExtension2

    if (fSourceViewer instanceof ITextViewerExtension2) {
      if (fAnnotationPainter == null) {
        fAnnotationPainter= createAnnotationPainter();
        if (fSourceViewer instanceof ITextViewerExtension4)
          ((ITextViewerExtension4)fSourceViewer).addTextPresentationListener(fAnnotationPainter);
        ITextViewerExtension2 extension= (ITextViewerExtension2) fSourceViewer;
        extension.addPainter(fAnnotationPainter);
      }
      fAnnotationPainter.setAnnotationTypeColor(annotationType, getAnnotationTypeColor(annotationType));
      if (highlighting)
        fAnnotationPainter.addHighlightAnnotationType(annotationType);
      else
View Full Code Here

Examples of org.eclipse.jface.text.ITextViewerExtension2

      return;

    fAnnotationPainter.paint(IPainter.CONFIGURATION);
    if (!fAnnotationPainter.isPaintingAnnotations()) {
      if (fSourceViewer instanceof ITextViewerExtension2) {
        ITextViewerExtension2 extension= (ITextViewerExtension2) fSourceViewer;
        extension.removePainter(fAnnotationPainter);
      }
      if (fSourceViewer instanceof ITextViewerExtension4)
        ((ITextViewerExtension4)fSourceViewer).removeTextPresentationListener(fAnnotationPainter);

      fAnnotationPainter.deactivate(true);
View Full Code Here

Examples of org.eclipse.jface.text.ITextViewerExtension2

    projectionViewer.doOperation(ProjectionViewer.TOGGLE);
    projectionViewer.getTextWidget().setTabs(
        getPreferenceStore().getInt(
            AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH));
   
    ITextViewerExtension2 extension= (ITextViewerExtension2) getSourceViewer();
    pairMatcher = new HTMLCharacterPairMatcher();
    pairMatcher.setEnable(getPreferenceStore().getBoolean(HTMLPlugin.PREF_PAIR_CHAR));
    MatchingCharacterPainter painter = new MatchingCharacterPainter(getSourceViewer(), pairMatcher);
    painter.setColor(Display.getDefault().getSystemColor(SWT.COLOR_GRAY));
    extension.addPainter(painter);
   
    update();
  }
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.