Examples of IAnnotationModelExtension


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

    IDocumentProvider provider = editor.getDocumentProvider();
    // there may be text editors without document providers (SF #1725100)
    if (provider == null) return;
    IAnnotationModel model = provider.getAnnotationModel(editor.getEditorInput());
    if (!(model instanceof IAnnotationModelExtension)) return;
    IAnnotationModelExtension modelex = (IAnnotationModelExtension) model;
    modelex.removeAnnotationModel(KEY);
  }
View Full Code Here

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

   * @param editor Editor to attach a annotation model to
   */
  public static void attach(ITextEditor editor) {
    IAnnotationModel model = editor.getDocumentProvider().getAnnotationModel(editor.getEditorInput());
    if (!(model instanceof IAnnotationModelExtension)) return;
    IAnnotationModelExtension modelex = (IAnnotationModelExtension) model;
   
    IDocument document = editor.getDocumentProvider().getDocument(editor.getEditorInput());
   
    CoverageAnnotationModel coveragemodel = (CoverageAnnotationModel) modelex.getAnnotationModel(KEY);
    if (coveragemodel == null) {
      coveragemodel = new CoverageAnnotationModel(editor, document);
      modelex.addAnnotationModel(KEY, coveragemodel);
    }
  }
View Full Code Here

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

   * @param editor Editor to detach the annotation model from
   */
  public static void detach(ITextEditor editor) {
    IAnnotationModel model = editor.getDocumentProvider().getAnnotationModel(editor.getEditorInput());
    if (!(model instanceof IAnnotationModelExtension)) return;
    IAnnotationModelExtension modelex = (IAnnotationModelExtension) model;
    modelex.removeAnnotationModel(KEY);
  }
View Full Code Here

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

        }
      }
    }

    if (fAnnotationModel instanceof IAnnotationModelExtension) {
      IAnnotationModelExtension ext= (IAnnotationModelExtension) fAnnotationModel;
      ext.replaceAnnotations((Annotation[]) fAnnotations.toArray(new Annotation[fAnnotations.size()]), added);
    } else {
      for (Iterator it= fAnnotations.iterator(); it.hasNext();) {
        Annotation annotation= (Annotation) it.next();
        fAnnotationModel.removeAnnotation(annotation);
      }
View Full Code Here

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

      return;
    IAnnotationModel model = provider.getAnnotationModel(editor
        .getEditorInput());
    if (!(model instanceof IAnnotationModelExtension))
      return;
    IAnnotationModelExtension modelex = (IAnnotationModelExtension) model;

    IDocument document = provider.getDocument(editor.getEditorInput());

    CoverageAnnotationModel coveragemodel = (CoverageAnnotationModel) modelex
        .getAnnotationModel(KEY);
    if (coveragemodel == null) {
      coveragemodel = new CoverageAnnotationModel(editor, document);
      modelex.addAnnotationModel(KEY, coveragemodel);
    }
  }
View Full Code Here

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

      return;
    IAnnotationModel model = provider.getAnnotationModel(editor
        .getEditorInput());
    if (!(model instanceof IAnnotationModelExtension))
      return;
    IAnnotationModelExtension modelex = (IAnnotationModelExtension) model;
    modelex.removeAnnotationModel(KEY);
  }
View Full Code Here

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

   * in this action's editor, if any.
   *
   * @return the diff model associated with the displayed document, or <code>null</code>
   */
  protected ILineDiffer getDiffer() {
    IAnnotationModelExtension extension= getModel();
    if (extension != null)
      return (ILineDiffer)extension.getAnnotationModel(IChangeRulerColumn.QUICK_DIFF_MODEL_ID);
    return null;
  }
View Full Code Here

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

    IEditorInput editorInput= fEditor.getEditorInput();
    if (provider == null || editorInput == null)
      return null;

    IAnnotationModel m= provider.getAnnotationModel(editorInput);
    IAnnotationModelExtension model= null;
    if (m instanceof IAnnotationModelExtension) {
      model= (IAnnotationModelExtension)m;
    } else {
      return null;
    }

    // get differ
    DocumentLineDiffer differ= (DocumentLineDiffer)model.getAnnotationModel(IChangeRulerColumn.QUICK_DIFF_MODEL_ID);

    // create if needed
    if (differ == null && createIfNeeded) {
      differ= new DocumentLineDiffer();
      model.addAnnotationModel(IChangeRulerColumn.QUICK_DIFF_MODEL_ID, differ);
    }

    return differ;
  }
View Full Code Here

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

      ITextViewer viewer= fCurrentTarget.getViewer();
      if (viewer instanceof ISourceViewer) {
        ISourceViewer sv= (ISourceViewer) viewer;
        IAnnotationModel model= sv.getAnnotationModel();
        if (model instanceof IAnnotationModelExtension) {
          IAnnotationModelExtension ext= (IAnnotationModelExtension) model;
          IAnnotationModel ourModel= ext.getAnnotationModel(getUniqueKey());
          if (ourModel == null) {
            ext.addAnnotationModel(getUniqueKey(), lpa);
          }
        }
      }
    }
  }
View Full Code Here

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

    ITextViewer viewer= target.getViewer();
    if (viewer instanceof ISourceViewer) {
      ISourceViewer sv= (ISourceViewer) viewer;
      IAnnotationModel model= sv.getAnnotationModel();
      if (model instanceof IAnnotationModelExtension) {
        IAnnotationModelExtension ext= (IAnnotationModelExtension) model;
        ext.removeAnnotationModel(getUniqueKey());
      }
    }
  }
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.