Package org.eclipse.jface.text.source

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


            @SuppressWarnings("rawtypes")
            final Iterator it = annMod.getAnnotationIterator();

            while (it.hasNext()) {
                final Annotation annotation = (Annotation) it.next();
                if (annotation.getType().equals(CoverageTypes.FULL_COVERAGE)
                        || annotation.getType().equals(CoverageTypes.NO_COVERAGE)) {
                    annMod.removeAnnotation(annotation);
                }
            }
        }
    }
View Full Code Here


    public Annotation gotoAnnotation(final boolean forward) {
        final ITextSelection selection = (ITextSelection) editor.getSelectionProvider()
                .getSelection();
        final Position position = new Position(0, 0);
        final Annotation annotation = getNextAnnotation(selection.getOffset(),
                selection.getLength(), forward, position);
        editor.setStatusLineErrorMessage(null);
        editor.setStatusLineMessage(null);
        if (annotation != null) {
            updateAnnotationViews(annotation);
            editor.selectAndReveal(position.getOffset(), position.getLength());
            editor.setStatusLineMessage(annotation.getText());
        }
        return annotation;
    }
View Full Code Here

     * is copied into the provided position.
     */
    private Annotation getNextAnnotation(final int offset, final int length,
            final boolean forward, final Position annotationPosition) {

        Annotation nextAnnotation = null;
        Position nextAnnotationPosition = null;
        Annotation containingAnnotation = null;
        Position containingAnnotationPosition = null;
        boolean currentAnnotation = false;

        final IDocument document = editor.getDocumentProvider().getDocument(
                editor.getEditorInput());
        final int endOfDocument = document.getLength();
        int distance = Integer.MAX_VALUE;

        final IAnnotationModel model = editor.getDocumentProvider().getAnnotationModel(
                editor.getEditorInput());
        final Iterator<Annotation> e = new ErlangAnnotationIterator(model, true, true);
        while (e.hasNext()) {
            final Annotation a = e.next();
            if (a instanceof IErlangAnnotation && ((IErlangAnnotation) a).hasOverlay()
                    || !isNavigationTarget(a)) {
                continue;
            }

View Full Code Here

     *
     * @param type
     * @return
     */
    public static Annotation create(final String type) {
        return new Annotation(type, true, "");
    }
View Full Code Here

                .getDocument(), pos.getStartLine());

        final Position position = new Position(location.getOffset(), location.getLength());
        final String description = location.getDescription();

        final Annotation oldAnnotation = callMatchingLine;
        if (position.getOffset() != 0) {
            callMatchingLine = new Annotation("org.erlide.test_support.trace.call",
                    false, description);
        } else {
            callMatchingLine = null;
        }
View Full Code Here

    }

    Iterator annotationIterator = annotationModel.getAnnotationIterator();
    List oldAnnotations = new ArrayList();
    while (annotationIterator.hasNext()) {
      Annotation annotation = (Annotation) annotationIterator.next();
      if (ANNOTATION_TYPE.equals(annotation.getType())) {
        annotation.markDeleted(true);
        /**
         * Sometimes it is supported, sometime's it is not. Confusing.
         */
        try {
          annotationIterator.remove();
View Full Code Here

        } catch (BadLocationException ex) {
          // Skip this match
          continue;
        }

        annotationMap.put(new Annotation(
            "org.eclipse.jdt.ui.occurrences", false, message), //$NON-NLS-1$
            position);
      }

      if (isCanceled())
View Full Code Here

                    // if(errorPart instanceof LdifUnknownPart) {
                    // errorOffset = container.getOffset();
                    // errorLength = container.getLength();
                    // errorText = new StringBuffer(container.toString());
                    // }
                    Annotation annotation = new Annotation( ERROR_ANNOTATION_TYPE, true, errorText.toString() );
                    Position position = new Position( errorOffset, errorLength );
                    positionList.add( position );
                    viewer.getAnnotationModel().addAnnotation( annotation, position );
                }
View Full Code Here

//            }
        }
    }

    private static void createAnnotation(IFile file, final IAnnotationModel annotationModel, final String message, final int offset, final int length) {
        Annotation annotation = new DRLProblemAnnotation(message);
        Position position = new Position(0, 1);
//        Position position = new Position(offset, length);
        annotationModel.addAnnotation(annotation, position);
    }
View Full Code Here

   
    public static void removeAnnotationsFor(IAnnotationModel annotationModel) {
        @SuppressWarnings("rawtypes")
        Iterator iterator = annotationModel.getAnnotationIterator();
        while (iterator.hasNext()) {
            Annotation annotation = (Annotation) iterator.next();
            if (annotation instanceof DRLProblemAnnotation) {
                annotationModel.removeAnnotation(annotation);
            }
        }
    }
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.