fix #774 infinite loop in net.sourceforge.phpeclipse.builder.IdentifierIndexManager...
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / phpeditor / IJavaAnnotation.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2003 IBM Corporation 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
7  * 
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  *******************************************************************************/
11 package net.sourceforge.phpeclipse.phpeditor;
12
13 import java.util.Iterator;
14
15 import net.sourceforge.phpdt.core.ICompilationUnit;
16
17 import org.eclipse.swt.graphics.Image;
18 import org.eclipse.swt.widgets.Display;
19
20 /**
21  * Interface of annotations representing markers and problems.
22  * 
23  * @see org.eclipse.core.resources.IMarker
24  * @see net.sourceforge.phpdt.core.compiler.IProblem
25  */
26 public interface IJavaAnnotation {
27
28         /**
29          * @see org.eclipse.jface.text.source.Annotation#getType()
30          */
31         String getType();
32
33         /**
34          * @see org.eclipse.jface.text.source.Annotation#isPersistent()
35          */
36         boolean isPersistent();
37
38         /**
39          * @see org.eclipse.jface.text.source.Annotation#isMarkedDeleted()
40          */
41         boolean isMarkedDeleted();
42
43         /**
44          * @see org.eclipse.jface.text.source.Annotation#getText()
45          */
46         String getText();
47
48         /**
49          * Returns whether this annotation is overlaid.
50          * 
51          * @return <code>true</code> if overlaid
52          */
53         boolean hasOverlay();
54
55         /**
56          * Returns the overlay of this annotation.
57          * 
58          * @return the annotation's overlay
59          * @since 3.0
60          */
61         IJavaAnnotation getOverlay();
62
63         /**
64          * Returns an iterator for iterating over the annotation which are overlaid
65          * by this annotation.
66          * 
67          * @return an iterator over the overlaid annotaions
68          */
69         Iterator getOverlaidIterator();
70
71         /**
72          * Adds the given annotation to the list of annotations which are overlaid
73          * by this annotations.
74          * 
75          * @param annotation
76          *            the problem annoation
77          */
78         void addOverlaid(IJavaAnnotation annotation);
79
80         /**
81          * Removes the given annotation from the list of annotations which are
82          * overlaid by this annotation.
83          * 
84          * @param annotation
85          *            the problem annoation
86          */
87         void removeOverlaid(IJavaAnnotation annotation);
88
89         /**
90          * Tells whether this annotation is a problem annotation.
91          * 
92          * @return <code>true</code> if it is a problem annotation
93          */
94         boolean isProblem();
95
96         /**
97          * Returns the compilation unit corresponding to the document on which the
98          * annotation is set or <code>null</code> if no corresponding
99          * co0mpilationunit exists.
100          */
101         ICompilationUnit getCompilationUnit();
102
103         String[] getArguments();
104
105         int getId();
106
107         Image getImage(Display display);
108 }