Examples of ProjectionAnnotation


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

    // this will hold the new annotations along
    // with their corresponding positions
    HashMap<ProjectionAnnotation, Position> newAnnotations = new HashMap<ProjectionAnnotation, Position>();

    for (int i = 0; i < positions.size(); i++) {
      ProjectionAnnotation annotation = new ProjectionAnnotation();
      newAnnotations.put(annotation, positions.get(i));
      annotations[i] = annotation;
    }

    annotationModel.modifyAnnotations(oldAnnotations, newAnnotations, null);
View Full Code Here

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

            Annotation[] annotations = new Annotation[positions.size()];
            // this will hold the new annotations along
            // with their corresponding positions
            HashMap<Annotation, Position> newAnnotations = new HashMap<Annotation, Position>();
            for (int i = 0; i < positions.size(); i++) {
                ProjectionAnnotation annotation = new ProjectionAnnotation();
                newAnnotations.put(annotation, positions.get(i));
                annotations[i] = annotation;
            }
            annotationModel.modifyAnnotations(oldAnnotations, newAnnotations, null);
            oldAnnotations = annotations;
View Full Code Here

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

            /*
             * store the position and annotation - the position is needed to create the fold, while
             * the annotation is needed to remove it
             */
            Tuple t = new Tuple(new Position(offset, length), new ProjectionAnnotation(collapse));
            tuples.add(t);
        }
    }
View Full Code Here

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

        }

        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

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

                        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

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

      int startIdx = matcher.start();
      if(startIdx < 0) {
        continue;
      }
     
      model.addAnnotation(new ProjectionAnnotation(), new Position(seg.position.offset, (startIdx - seg.position.offset + seg.matched.length())));
    }
  }
View Full Code Here

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

        }

        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

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

                        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

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

    }

    // create a Map of folding regions to add
    Map<Annotation, Position> annotationsToAdd = new HashMap<Annotation, Position>();
    for (Position pos : foldingRegionsToAdd) {
      annotationsToAdd.put(new ProjectionAnnotation(), pos);
    }

    // remove / add annotations
    Annotation[] arr = new Annotation[0];
    fAnnotationModel.replaceAnnotations(annotationsToRemove.toArray(arr), annotationsToAdd);
View Full Code Here

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

    //with their corresponding positions
    HashMap<ProjectionAnnotation, Position> newAnnotations = new HashMap<ProjectionAnnotation, Position>();
   
    for(int i =0;i<positions.size();i++)
    {
      ProjectionAnnotation annotation = new ProjectionAnnotation();
      newAnnotations.put(annotation,positions.get(i));
      annotations[i]=annotation;
    }
   
    annotationModel.modifyAnnotations(oldAnnotations,newAnnotations,null);
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.