Package org.eclipse.jface.text.source

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


   */

  public void reconcile(IRegion partition) {
    IDocument document = getDocument();
    if (document != null) {
      IAnnotationModel annotationModel = getAnnotationModel();
      if (annotationModel != null) {
        spellCheck(partition, partition, annotationModel);
      }
    }
  }
View Full Code Here


  }

  private TemporaryAnnotation[] getSpellingAnnotationsToRemove(IRegion region) {
    List toRemove = new ArrayList();
    IAnnotationModel annotationModel = getAnnotationModel();
    // can be null when closing the editor
    if (annotationModel != null) {
      Iterator i = null;
      boolean annotationOverlaps = false;
      if (annotationModel instanceof IAnnotationModelExtension2) {
        i = ((IAnnotationModelExtension2) annotationModel).getAnnotationIterator(region.getOffset(), region.getLength(), true, true);
        annotationOverlaps = true;
      }
      else {
        i = annotationModel.getAnnotationIterator();
      }

      while (i.hasNext()) {
        Object obj = i.next();
        if (!(obj instanceof TemporaryAnnotation))
View Full Code Here

  }

  public void reconcile() {
    IDocument document = getDocument();
    if (document != null) {
      IAnnotationModel annotationModel = getAnnotationModel();
      if (annotationModel != null) {
        IRegion documentRegion = new Region(0, document.getLength());
        spellCheck(documentRegion, documentRegion, annotationModel);
      }
    }
View Full Code Here

   */
  public void reconcile(DirtyRegion dirtyRegion, IRegion subRegion) {
    if (isCanceled())
      return;

    IAnnotationModel annotationModel = getAnnotationModel();

    IDocument document = getDocument();
    if (document != null) {
      long time0 = 0;
      if (_DEBUG_SPELLING) {
View Full Code Here

   */

  public void reconcile(IRegion partition) {
    IDocument document = getDocument();
    if (document != null) {
      IAnnotationModel annotationModel = getAnnotationModel();
      if (annotationModel != null) {
        spellCheck(partition, partition, annotationModel);
      }
    }
  }
View Full Code Here

  // public boolean canSaveDocument(Object element) {
  // return false;
  // }

  protected IAnnotationModel createAnnotationModel(Object element) throws CoreException {
    IAnnotationModel model = null;
    if (debugOperations) {
      if (element instanceof IStorageEditorInput)
        System.out.println("StorageModelProvider: createAnnotationModel for " + ((IStorageEditorInput) element).getStorage().getFullPath()); //$NON-NLS-1$
      else
        System.out.println("StorageModelProvider: createAnnotationModel for " + element); //$NON-NLS-1$
View Full Code Here

   *
   * @return the marker annotation model
   */
  protected AbstractMarkerAnnotationModel getAnnotationModel() {
    IDocumentProvider provider = fTextEditor.getDocumentProvider();
    IAnnotationModel model = provider.getAnnotationModel(fTextEditor.getEditorInput());
    if (model instanceof AbstractMarkerAnnotationModel)
      return (AbstractMarkerAnnotationModel) model;
    return null;
  }
View Full Code Here

    private void rec() {
      CompilerFacade compilerFacade = new CompilerFacade();
      CategorizedProblem[] validate = compilerFacade.validate(
          document.get(), editor.getJavaProject());
      IAnnotationModel annotationModel = editor.getViewer()
          .getAnnotationModel();
      IAnnotationModelExtension e = (IAnnotationModelExtension) annotationModel;
      e.removeAllAnnotations();
      if (validate != null) {
        for (CategorizedProblem p : validate) {
          if (p.isError()){
          int length = p.getSourceEnd() - p.getSourceStart()+1;
          try{
          Position pa = new Position(p.getSourceStart()-compilerFacade.length,length);
          annotationModel.addAnnotation(new Annotation(
              "org.eclipse.ui.workbench.texteditor.spelling",
              false, p.getMessage()), pa);
          }catch (Exception ea) {
          }
          }
View Full Code Here

      semanticHighlightingStrategy.reconcile(new Region(0, document.getLength()));
    }

    if ((getTextViewer() instanceof ISourceViewer)) {
      ISourceViewer sourceViewer = (ISourceViewer) getTextViewer();
      IAnnotationModel annotationModel = sourceViewer.getAnnotationModel();
      for (int i = 0; i < fReconcileListeners.length; i++) {
        fReconcileListeners[i].reconciled(document, annotationModel, false, new NullProgressMonitor());
      }
    }
  }
View Full Code Here

        private int[] _positions;
    }

    private static boolean containsRelevantMarkers(IEditorPart editor) {
        IEditorInput input = editor.getEditorInput();
        IAnnotationModel model = JavaUI.getDocumentProvider()
                .getAnnotationModel(input);
        Iterator<?> iterator = model.getAnnotationIterator();
        while (iterator.hasNext()) {
            Object element = iterator.next();
            if (element instanceof IJavaAnnotation) {
                IJavaAnnotation annot = (IJavaAnnotation) element;
                if (!annot.isMarkedDeleted() && annot.isPersistent()
View Full Code Here

TOP

Related Classes of org.eclipse.jface.text.source.IAnnotationModel

Copyright © 2018 www.massapicom. 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.