Package org.eclipse.jface.text.source

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();
    try {
      for (int l = firstline; l <= lastline; l++) {
        int status = linecoverage.getCoverage(l);
        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 && linecoverage.getCoverage(l + 1) == 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


  }

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

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

    }
    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

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

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

    }
    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

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

    }
    return null;
  }

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

    }
    annotations.clear();
  }

  private 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

TOP

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

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.