2 * Copyright (c) 2002-2004 Widespace, OU and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v10.html
9 * Igor Malinin - initial contribution
11 * $Id: XMLAnnotationIterator.java,v 1.1 2004-09-02 18:28:03 jsurfer Exp $
13 package net.sourceforge.phpeclipse.xml.ui.internal.text;
15 import java.util.Iterator;
17 import org.eclipse.jface.text.source.Annotation;
18 import org.eclipse.jface.text.source.IAnnotationModel;
22 * @author Igor Malinin
24 public class XMLAnnotationIterator implements Iterator {
25 private boolean skipIrrelevants;
27 private Iterator iterator;
28 private Annotation next;
30 public XMLAnnotationIterator(
31 IAnnotationModel model, boolean skipIrrelevants
33 this.skipIrrelevants = skipIrrelevants;
35 iterator = model.getAnnotationIterator();
40 while (iterator.hasNext()) {
41 Annotation next = (Annotation) iterator.next();
42 if (next instanceof XMLAnnotation) {
43 if (skipIrrelevants) {
44 if (!next.isMarkedDeleted()) {
59 * @see java.util.Iterator#hasNext()
61 public boolean hasNext() {
62 return (next != null);
66 * @see java.util.Iterator#next()
68 public Object next() {
77 * @see java.util.Iterator#remove()
79 public void remove() {
80 throw new UnsupportedOperationException();