Package org.eclipse.jface.text.source.projection

Examples of org.eclipse.jface.text.source.projection.ProjectionAnnotation


  }
 
  public void addProjectionAnnotations(ProjectionAnnotationModel model) {
   
    if(headerSectionPosition != null) {
      model.addAnnotation(new ProjectionAnnotation(), new Position(headerSectionPosition.offset, headerSectionPosition.length));
    }
    if(bodySectionPosition != null) {
      model.addAnnotation(new ProjectionAnnotation(), new Position(bodySectionPosition.offset, bodySectionPosition.length));
    }
  }
View Full Code Here


        }

        for ( Iterator iter = positionToAnnotationMap.keySet().iterator(); iter.hasNext(); )
        {
            Position position = ( Position ) iter.next();
            ProjectionAnnotation annotation = ( ProjectionAnnotation ) positionToAnnotationMap.get( position );
            annotationsToAddMap.put( annotation, position );
        }
    }
View Full Code Here

                        if ( line.isFolded() )
                        {
                            Position position = new Position( line.getOffset(), line.getLength() );
                            // ProjectionAnnotation annotation = new
                            // ProjectionAnnotation(true);
                            ProjectionAnnotation annotation = new ProjectionAnnotation( FOLD_WRAPPEDLINES );
                            positionToAnnotationMap.put( position, annotation );
                        }
                    }
                }

                if ( containerStartLine < containerEndLine )
                {
                    int start = document.getLineOffset( containerStartLine );
                    int end = document.getLineOffset( containerEndLine ) + document.getLineLength( containerEndLine );
                    Position position = new Position( start, end - start );
                    // ProjectionAnnotation annotation = new
                    // ProjectionAnnotation(container instanceof
                    // LdifCommentContainer);
                    ProjectionAnnotation annotation = new ProjectionAnnotation( FOLD_RECORDS
                        || ( FOLD_COMMENTS && container instanceof LdifCommentContainer ) );
                    positionToAnnotationMap.put( position, annotation );
                }
            }
        }
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

    if (model != null) {
      try {
        IDocument document = viewer.getDocument();
        Iterator e = model.getAnnotationIterator();
        while (e.hasNext()) {
          ProjectionAnnotation annotation = (ProjectionAnnotation) e
              .next();
          if (!annotation.isCollapsed())
            continue;

          Position position = model.getPosition(annotation);
          if (position == null)
            continue;
View Full Code Here

  public void updateFoldingStructure( List<Position> positions )
  {
    Map<Annotation, Position> newAnnotations = new HashMap<Annotation, Position>();
    for( Position p : positions ) {
      newAnnotations.put( new ProjectionAnnotation(), p );
    }
    annotationModel.modifyAnnotations(oldAnnotations, newAnnotations, null);
    oldAnnotations = newAnnotations.keySet().toArray( new Annotation[0] );
  }
View Full Code Here

        // Now collapse anything that should be collapsed
        Iterator x = markerMap.keySet().iterator();

        while (x.hasNext()) {
          ProjectionAnnotation p = (ProjectionAnnotation) x.next();
          boolean collapsed = ((Boolean) markerMap.get(p)).booleanValue();
          if (collapsed) {
            model.collapse(p);
          }
        }
View Full Code Here

    private void scrubAnnotations() {
        Iterator iter = model.getAnnotationIterator();
       
        while (iter.hasNext()) {
            Object o = iter.next();
            ProjectionAnnotation annotation = (ProjectionAnnotation)o;
            if (!(annotation instanceof TagProjectionAnnotation)
                    && !annotation.isCollapsed()) {
        /* Changed the requirement here as there were problems relating
         * to ticket #143
         *
         * We should remove all annotations as they are going to be
         * re-created as part of the addMarksToModel function call that
View Full Code Here

    // ((ITextSelection)editor.getSelectionProvider().getSelection()).getOffset();
    // int selectionLength =
    // ((ITextSelection)editor.getSelectionProvider().getSelection()).getLength();

    while (i.hasNext()) {
      ProjectionAnnotation annotation = (ProjectionAnnotation) i.next();

      if (collapsing == null) {
        if (annotation.isCollapsed()) {
          collapsing = new Boolean(false);
        } else {
          collapsing = new Boolean(true);
        }
View Full Code Here

        // Check to see if there's anything selected. If not we want to
        // find the fold that contains the cursor
        boolean findContainer = selection.getLength() > 0 ? false : true;

        ProjectionAnnotation containingAnnotation = null;
        Position oldPosition = null;

        Iterator i = model.getAnnotationIterator();
        while (i.hasNext()) {
          ProjectionAnnotation annotation = (ProjectionAnnotation) i.next();

          Position position = model.getPosition(annotation);
          if (position.offset >= start && position.offset <= end) {
            annotations.add(annotation);
            // If there's nothing selected we can exit once we find
View Full Code Here

TOP

Related Classes of org.eclipse.jface.text.source.projection.ProjectionAnnotation

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.