Package org.eclipse.jface.text.source

Examples of org.eclipse.jface.text.source.IAnnotationModel.addAnnotation()


                            annotationMap);
                } else {
                    editor.markOccurencesHandler.removeOccurrenceAnnotations();
                    for (final Map.Entry<Annotation, Position> mapEntry : annotationMap
                            .entrySet()) {
                        annotationModel.addAnnotation(mapEntry.getKey(),
                                mapEntry.getValue());
                    }
                }
                editor.markOccurencesHandler.fOccurrenceAnnotations = annotationMap
                        .keySet().toArray(new Annotation[annotationMap.keySet().size()]);
View Full Code Here


            final Annotation lastAnn = coverage.getAnnotation(editor.getTitle(), lr);

            log.info(lastAnn);

            if (lastAnn == null) {
                annMod.addAnnotation(annotation, pos);
                coverage.addAnnotation(editor.getTitle(), lr, annotation);
            } else if (annMod.getPosition(lastAnn) == null) {
                annMod.addAnnotation(lastAnn, pos);
            } else if (lastAnn.getType().equals(CoverageTypes.NO_COVERAGE)
                    && annotation.getType().equals(CoverageTypes.FULL_COVERAGE)) {
View Full Code Here

            if (lastAnn == null) {
                annMod.addAnnotation(annotation, pos);
                coverage.addAnnotation(editor.getTitle(), lr, annotation);
            } else if (annMod.getPosition(lastAnn) == null) {
                annMod.addAnnotation(lastAnn, pos);
            } else if (lastAnn.getType().equals(CoverageTypes.NO_COVERAGE)
                    && annotation.getType().equals(CoverageTypes.FULL_COVERAGE)) {

                annMod.removeAnnotation(lastAnn);
                annMod.addAnnotation(annotation, pos);
View Full Code Here

                annMod.addAnnotation(lastAnn, pos);
            } else if (lastAnn.getType().equals(CoverageTypes.NO_COVERAGE)
                    && annotation.getType().equals(CoverageTypes.FULL_COVERAGE)) {

                annMod.removeAnnotation(lastAnn);
                annMod.addAnnotation(annotation, pos);
                coverage.addAnnotation(editor.getTitle(), lr, annotation);
            }

        } catch (final BadLocationException e) {
            log.error(e);
View Full Code Here

                annotationMap.put(callMatchingLine, position);
            }
            ((IAnnotationModelExtension) annotationModel).replaceAnnotations(
                    new Annotation[] { oldAnnotation }, annotationMap);
        } else {
            annotationModel.addAnnotation(callMatchingLine, position);
        }
    }

    private class MarkCallLocation {
        private String description;
View Full Code Here

        } else {
          // removeOccurrenceAnnotations();
          Iterator iter = annotationMap.entrySet().iterator();
          while (iter.hasNext()) {
            Map.Entry mapEntry = (Map.Entry) iter.next();
            annotationModel.addAnnotation(
                (Annotation) mapEntry.getKey(),
                (Position) mapEntry.getValue());
          }
        }
        fOccurrenceAnnotations = (Annotation[]) annotationMap.keySet()
View Full Code Here

  private void addAnnotations(Map<Annotation, Position> annotationToPositionMap) {
    IAnnotationModel model = getDocumentProvider().getAnnotationModel(getEditorInput());
    for (Annotation a : annotationToPositionMap.keySet()) {
      Position p = annotationToPositionMap.get(a);
      model.addAnnotation(a, p);
    }
  }

  @Override
  protected void initializeKeyBindingScopes() {
View Full Code Here

    final Iterator<AnnotationFS> mAnnotations = mDocument.getCAS().getAnnotationIndex()
            .iterator();

    while (mAnnotations.hasNext()) {
      AnnotationFS annotationFS = mAnnotations.next();
      annotationModel.addAnnotation(new EclipseAnnotationPeer(annotationFS), new Position(
              annotationFS.getBegin(), annotationFS.getEnd() - annotationFS.getBegin()));
    }
  }
 
  /**
 
View Full Code Here

    SearchRequestor requestor = new SearchRequestor() {
      @Override
      public void acceptSearchMatch(final SearchMatch match) {
        IAnnotationModel model = textEditor.getDocumentProvider().getAnnotationModel(textEditor.getEditorInput());
        Annotation annotation = new Annotation("org.eclipse.jdt.ui.occurrences", false, "wicket id constant");
        model.addAnnotation(annotation, new Position(match.getOffset(), match.getLength()));
      }
    };

    SearchEngine searchEngine = new SearchEngine();
    try {
View Full Code Here

      }
      for (PositionedMessage pm : fMessages) {
        Annotation annotation = new Annotation(fAnnotationType, false,
            pm.message);

        model.addAnnotation(annotation, pm.pos);
        fAnnotations.add(annotation);
      }
    }
    // System.out.println("Annotation model updated.");
    fMessages.clear();
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.