Package org.eclipse.jface.text.source

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


            editor.getEditorInput());
    final IModelElement element = editor.getInputModelElement();
    final IScriptProject scriptProject = element.getScriptProject();
    List proposals = null;
    for (int i = 0; i < annotations.length; i++) {
      final Annotation annotation = annotations[i];
      ICompletionProposal proposal = null;
      if (annotation instanceof MarkerAnnotation) {
        MarkerAnnotation mAnnot = (MarkerAnnotation) annotation;
        IMarker marker = mAnnot.getMarker();
        if (isFixable(marker)) {
View Full Code Here


      } catch (Exception e) {
      }
      List<ASTNode> result = refFinder.getResult();
      myAnnotations = new HashMap<Annotation, Position>(result.size());
      for (ASTNode each : result) {
        Annotation annotation = new Annotation(SearchPlugin.SEARCH_ANNOTATION_TYPE, true, null);
        Position position = null;
        int sourceStart = each.sourceStart();
        int sourceEnd = each.sourceEnd();
        if (each instanceof RutaAction) {
          RutaAction e = (RutaAction) each;
View Full Code Here

    } catch (Exception e) {
    }
    RutaRule rule = visitor.getResult();
    myAnnotations = new HashMap<Annotation, Position>();
    if (rule != null) {
      Annotation annotation = new Annotation(SearchPlugin.SEARCH_ANNOTATION_TYPE, true, null);
      int sourceStart = rule.sourceStart();
      int sourceEnd = rule.sourceEnd();
      Position position = new Position(sourceStart, sourceEnd - sourceStart);
      getSourceViewer().revealRange(sourceStart, sourceEnd - sourceStart);
      myAnnotations.put(annotation, position);
View Full Code Here

    Iterator iter = model.getAnnotationIterator();
    int layer = Integer.MIN_VALUE;

    while (iter.hasNext()) {
      Annotation annotation = (Annotation) iter.next();
      if (annotation.isMarkedDeleted())
        continue;

      int annotationLayer = layer;
      if (annotationAccess != null) {
        annotationLayer = annotationAccess.getLayer(annotation);
View Full Code Here

      highlight(0, 0); // TODO: only if removed annotation was selected

      IAnnotationModelExtension annotationModel = (IAnnotationModelExtension) getDocumentProvider().getAnnotationModel(getEditorInput());
     
      Annotation removeAnnotations[] = new Annotation[deletedAnnotations.size()];
      int removeAnnotationsIndex = 0;
      for (AnnotationFS annotation : deletedAnnotations) {
        removeAnnotations[removeAnnotationsIndex++] = new EclipseAnnotationPeer(annotation);
      }
     
View Full Code Here

      highlight(0, 0); // TODO: only if removed annotation was selected

      IAnnotationModelExtension annotationModel = (IAnnotationModelExtension) getDocumentProvider().getAnnotationModel(getEditorInput());
     
      Annotation removeAnnotations[] = new Annotation[deletedAnnotations.size()];
      int removeAnnotationsIndex = 0;
      for (AnnotationFS annotation : deletedAnnotations) {
        removeAnnotations[removeAnnotationsIndex++] = new EclipseAnnotationPeer(annotation);
      }
     
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();
View Full Code Here

          .toArray(new Annotation[fAnnotations.size()]);

      modelExt.replaceAnnotations(oldAnnotations, Collections.EMPTY_MAP);
    } else {
      for (Iterator i = model.getAnnotationIterator(); i.hasNext();) {
        Annotation a = (Annotation) i.next();

        if (a.getType().equals(fAnnotationType)) {
          model.removeAnnotation(a);
        }
      }
    }
    // System.out.println("Annotations removed.");
View Full Code Here

      Annotation[] oldAnnotations = fAnnotations
          .toArray(new Annotation[fAnnotations.size()]);
      Map<Annotation, Position> newAnnotations = new HashMap<Annotation, Position>(
          fMessages.size());
      for (PositionedMessage pm : fMessages) {
        Annotation anno = new Annotation(fAnnotationType, false,
            pm.message);
        newAnnotations.put(anno, pm.pos);
        fAnnotations.add(anno);
      }
      modelExt.replaceAnnotations(oldAnnotations, newAnnotations);
    } else {
      for (Iterator i = model.getAnnotationIterator(); i.hasNext();) {
        Annotation a = (Annotation) i.next();

        if (a.getType().equals(fAnnotationType)) {
          model.removeAnnotation(a);
        }
      }
      for (PositionedMessage pm : fMessages) {
        Annotation annotation = new Annotation(fAnnotationType, false,
            pm.message);

        model.addAnnotation(annotation, pm.pos);
        fAnnotations.add(annotation);
      }
View Full Code Here

      }
    }
  }
 
  public Annotation gotoAnnotation(boolean forward) {
    Annotation result = super.gotoAnnotation(forward);
    if(result != null)
      fSelectionChangedFromGoto = true;
    return result;
  }
View Full Code Here

TOP

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

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.