Examples of AnnotationModelEvent


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

      return;
    }

    // inform listeners about change
    if (fUpdateNeeded) {
      AnnotationModelEvent ame= new AnnotationModelEvent(this, false);
      for (Iterator it= fAdded.iterator(); it.hasNext(); ) {
        RangeDifference rd= (RangeDifference) it.next();
        ame.annotationAdded(rd.getDiffRegion(fDifferences, fLeftDocument));
      }
      for (Iterator it= fRemoved.iterator(); it.hasNext(); ) {
        RangeDifference rd= (RangeDifference) it.next();
        ame.annotationRemoved(rd.getDiffRegion(fDifferences, fLeftDocument));
      }
      for (Iterator it= fChanged.iterator(); it.hasNext(); ) {
        RangeDifference rd= (RangeDifference) it.next();
        ame.annotationChanged(rd.getDiffRegion(fDifferences, fLeftDocument));
      }
      fireModelChanged(ame);
      fUpdateNeeded= false;
    }
  }
View Full Code Here

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

  /**
   * Informs all annotation model listeners that this model has been changed.
   */
  protected void fireModelChanged() {
    fireModelChanged(new AnnotationModelEvent(this));
  }
View Full Code Here

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

          if (display != null) {
            display.asyncExec(new Runnable() {
              public void run() {
                try {
                  while (true) {
                    AnnotationModelEvent ame= null;
                    synchronized (fLock) {
                      if (fPendingRequests.size() == 0)
                        return;
                      ame= (AnnotationModelEvent) fPendingRequests.remove(0);
                    }
View Full Code Here

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

   
    return coverage.getLineCoverage();
  }
 
  protected void clear() {
    AnnotationModelEvent event = new AnnotationModelEvent(this);
    clear(event);
    fireModelChanged(event);
  }
View Full Code Here

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

    }
    annotations.clear();
  }

  protected void createAnnotations(ILineCoverage linecoverage) {
    AnnotationModelEvent event = new AnnotationModelEvent(this);
    clear(event);
    int firstline = linecoverage.getFirstLine();
    int lastline = linecoverage.getLastLine();
    int offset = linecoverage.getOffset();
    byte[] coverage = linecoverage.getCoverage();
    try {
      for (int l = firstline ; l <= lastline; l++) {
        int status = coverage[l - offset];
        if (status != ILineCoverage.NO_CODE) {
          IRegion region = document.getLineInformation(l - 1);
          int docoffset = region.getOffset();
          int doclength = region.getLength();
          // Extend annotation for subsequent lines with same status:
          while (l < lastline && coverage[l + 1 - offset] == status) {
            l++;
            region = document.getLineInformation(l - 1);
            doclength = region.getOffset() - docoffset + region.getLength();
          }
          CoverageAnnotation ca = new CoverageAnnotation(docoffset, doclength, status);
          annotations.add(ca);
          event.annotationAdded(ca);
        }
      }
    } catch (BadLocationException ex) {
      EclEmmaUIPlugin.log(ex);
    }
View Full Code Here

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

 
  public void addAnnotationModelListener(IAnnotationModelListener listener) {
    if (!annotationModelListeners.contains(listener)) {
      annotationModelListeners.add(listener);
      fireModelChanged(new AnnotationModelEvent(this, true));
    }
  }
View Full Code Here

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

    }
    return null;
  }

  protected void clear() {
    AnnotationModelEvent event = new AnnotationModelEvent(this);
    clear(event);
    fireModelChanged(event);
  }
View Full Code Here

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

    }
    annotations.clear();
  }

  protected void createAnnotations(ISourceNode linecoverage) {
    AnnotationModelEvent event = new AnnotationModelEvent(this);
    clear(event);
    int firstline = linecoverage.getFirstLine();
    int lastline = linecoverage.getLastLine();
    try {
      for (int l = firstline; l <= lastline; l++) {
        final ILine line = linecoverage.getLine(l);
        if (line.getStatus() != ICounter.EMPTY) {
          IRegion region = document.getLineInformation(l - 1);
          int docoffset = region.getOffset();
          int doclength = region.getLength();
          CoverageAnnotation ca = new CoverageAnnotation(docoffset, doclength,
              line);
          annotations.add(ca);
          event.annotationAdded(ca);
        }
      }
    } catch (BadLocationException ex) {
      EclEmmaUIPlugin.log(ex);
    }
View Full Code Here

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

  }

  public void addAnnotationModelListener(IAnnotationModelListener listener) {
    if (!annotationModelListeners.contains(listener)) {
      annotationModelListeners.add(listener);
      fireModelChanged(new AnnotationModelEvent(this, true));
    }
  }
View Full Code Here

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

    return coverage.getLineCoverage();
  }

  protected void clear() {
    AnnotationModelEvent event = new AnnotationModelEvent(this);
    clear(event);
    fireModelChanged(event);
  }
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.