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.2 2006-10-21 23:14:13 pombredanne 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;
21 * @author Igor Malinin
23 public class XMLAnnotationIterator implements Iterator {
24 private boolean skipIrrelevants;
26 private Iterator iterator;
28 private Annotation next;
30 public XMLAnnotationIterator(IAnnotationModel model, boolean skipIrrelevants) {
31 this.skipIrrelevants = skipIrrelevants;
33 iterator = model.getAnnotationIterator();
38 while (iterator.hasNext()) {
39 Annotation next = (Annotation) iterator.next();
40 if (next instanceof XMLAnnotation) {
41 if (skipIrrelevants) {
42 if (!next.isMarkedDeleted()) {
57 * @see java.util.Iterator#hasNext()
59 public boolean hasNext() {
60 return (next != null);
64 * @see java.util.Iterator#next()
66 public Object next() {
75 * @see java.util.Iterator#remove()
77 public void remove() {
78 throw new UnsupportedOperationException();