public void markCollapsed() { /* workaround for BUG85874 */ // do not mark collapsed if annotation is not visible if (fIsVisible) { super.markCollapsed(); } } }
/** * Changes the state of the given annotation to collapsed. An appropriate * annotation model change event is sent out. * * @param annotation the annotation */ public void collapse(Annotation annotation) { if (annotation instanceof ProjectionAnnotation) { ProjectionAnnotation projection= (ProjectionAnnotation) annotation; if (!projection.isCollapsed()) { projection.markCollapsed(); modifyAnnotation(projection, true); } } }
/** * Changes the state of the given annotation to collapsed. An appropriate * annotation model change event is sent out. * * @param annotation the annotation */ public void collapse(Annotation annotation) { if (annotation instanceof ProjectionAnnotation) { ProjectionAnnotation projection= (ProjectionAnnotation) annotation; if (!projection.isCollapsed()) { projection.markCollapsed(); modifyAnnotation(projection, true); } } }
/** * Toggles the expansion state of the given annotation. An appropriate * annotation model change event is sent out. * * @param annotation the annotation */ public void toggleExpansionState(Annotation annotation) { if (annotation instanceof ProjectionAnnotation) { ProjectionAnnotation projection= (ProjectionAnnotation) annotation; if (projection.isCollapsed()) projection.markExpanded(); else projection.markCollapsed(); modifyAnnotation(projection, true); } }
/** * Toggles the expansion state of the given annotation. An appropriate * annotation model change event is sent out. * * @param annotation the annotation */ public void toggleExpansionState(Annotation annotation) { if (annotation instanceof ProjectionAnnotation) { ProjectionAnnotation projection= (ProjectionAnnotation) annotation; if (projection.isCollapsed()) projection.markExpanded(); else projection.markCollapsed(); modifyAnnotation(projection, true); } }
/** * Collapses all annotations that overlap with the given range and are collapsed. * * @param offset the range offset * @param length the range length * @return <code>true</code> if any annotation has been collapse, <code>false</code> * otherwise * @since 3.2 */ public boolean collapseAll(int offset, int length) { boolean collapsing= false; Iterator<Annotation> iterator= getAnnotationIterator(); while (iterator.hasNext()) { ProjectionAnnotation annotation= (ProjectionAnnotation) iterator.next(); if (!annotation.isCollapsed()) { Position position= getPosition(annotation); if (position != null && position.overlapsWith(offset, length) /* || is a delete at the boundary */ ) { annotation.markCollapsed(); modifyAnnotation(annotation, false); collapsing= true; } } } if (collapsing) fireModelChanged(); return collapsing; }
/** * Collapses all annotations that overlap with the given range and are collapsed. * * @param offset the range offset * @param length the range length * @return <code>true</code> if any annotation has been collapse, <code>false</code> * otherwise * @since 3.2 */ public boolean collapseAll(int offset, int length) { boolean collapsing= false; Iterator<Annotation> iterator= getAnnotationIterator(); while (iterator.hasNext()) { ProjectionAnnotation annotation= (ProjectionAnnotation) iterator.next(); if (!annotation.isCollapsed()) { Position position= getPosition(annotation); if (position != null && position.overlapsWith(offset, length) /* || is a delete at the boundary */ ) { annotation.markCollapsed(); modifyAnnotation(annotation, false); collapsing= true; } } } if (collapsing) fireModelChanged(); return collapsing; }