Examples of ITextViewerExtension2


Examples of org.eclipse.jface.text.ITextViewerExtension2

  private void unregisterAutoEditVetoer(ITextViewer viewer) {
    try {
      String[] contentTypes= getContentTypes(viewer.getDocument());
      if (viewer instanceof ITextViewerExtension2) {
        ITextViewerExtension2 vExtension= ((ITextViewerExtension2) viewer);
        for (int i= 0; i < contentTypes.length; i++) {
          vExtension.removeAutoEditStrategy(fAutoEditVetoer, contentTypes[i]);
        }
      } else {
        Assert.isTrue(false);
      }
    } catch (BadPartitioningException e) {
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

    try {
    if (fCursorLinePainter == null || fSourceViewer != null) {
      if (fSourceViewer instanceof ITextViewerExtension2) {
        fCursorLinePainter= new CursorLinePainter(fSourceViewer);
        fCursorLinePainter.setHighlightColor(getColor(fCursorLinePainterColorKey));
        ITextViewerExtension2 extension= (ITextViewerExtension2) fSourceViewer;
        extension.addPainter(fCursorLinePainter);
      }
    }
    }
    catch (NullPointerException npe) {
      npe.printStackTrace();
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

        fMarginPainter.setMarginRulerColor(getColor(fMarginPainterColorKey));
        if (fPreferenceStore != null) {         
          fMarginPainter.setMarginRulerColumn(fPreferenceStore.getInt(fMarginPainterColumnKey));
          fMarginPainter.setMarginRulerColor(getColor(fMarginPainterColorKey));     
        }
        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 && fFontPropertyChangeListener != 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
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.