Package org.eclipse.jface.text.source

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


            int end = document.getLineOffset(bottom);
            if (end == -1 || end < start)
                throw new BadLocationException("End line -1 or less than start");
            SarosAnnotation annotation = new ViewportAnnotation(source);
            Position position = new Position(start, end - start);
            model.addAnnotation(annotation, position);
        } catch (BadLocationException e) {
            log.warn("Internal Error:", e);
        }
    }
View Full Code Here


        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

  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 IAnnotationModel model = viewer.getAnnotationModel();
    if(model != null) {
      if(viewer instanceof ProjectionViewer) {
        ((ProjectionViewer)viewer).getProjectionAnnotationModel().expandAll(region.getOffset(), region.getLength());
      }
      model.addAnnotation(annotation, position);
      isAnnotationDisplayed = true;
    }   
  }
}
View Full Code Here

                        try {
                            IDocument document = editor.getDocumentProvider().getDocument(editor.getEditorInput());
                            int offset = document.getLineOffset(start);
                            int endOffset = document.getLineOffset(end + 1);
                            Position position = new Position(offset, endOffset - offset);
                            model.addAnnotation(new ProjectionAnnotation(), position);
                        } catch (BadLocationException x) {
                            // ignore
                        }
                    }
                }
View Full Code Here

    final Iterator<AnnotationFS> mAnnotations = getDocument().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

                  collapsedAnnotations.add(ap.annotation());
              }
             
          }
          else {
              aModel.addAnnotation(ap.annotation(),p);
          }
      }
     
      // Now collapse the annotations that were collapsed before
      Object[] annotations = collapsedAnnotations.toArray();
View Full Code Here

                        ScenarioAnnotation annotation = new ScenarioAnnotation();
                        annotation.setText("Could not match text with Cucumber annotation");
                        annotation.setType("org.eclipse.ui.workbench.texteditor.warning");

                        int startIndex = currentLineString.indexOf(trimmedLine);
                        annotationModel.addAnnotation(annotation, new Position(lineOffset + startIndex, lineLength
                            - startIndex));

                        currentAnnotations.put(currentLine, annotation);
                    }
                }
View Full Code Here

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

                                    annotationMap);
                } else {
                    removeTwigOccurrenceAnnotations();
                    for (Map.Entry<Annotation, Position> entry : annotationMap
                            .entrySet()) {
                        annotationModel.addAnnotation(entry.getKey(),
                                entry.getValue());
                    }
                }
                fOccurrenceAnnotations = annotationMap.keySet().toArray(
                        new Annotation[annotationMap.keySet().size()]);
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.