Changes:
[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 org.eclipse.swt.graphics.Image;
16 import org.eclipse.swt.widgets.Display;
17
18 /**
19  * Interface of annotations representing markers
20  * and problems.
21  * 
22  * @see org.eclipse.core.resources.IMarker
23  * @see org.eclipse.jdt.core.compiler.IProblem
24  */
25 public interface IJavaAnnotation {
26         
27         AnnotationType getAnnotationType();
28         
29         boolean isTemporary();
30         
31         String getMessage();
32         
33         String[] getArguments();
34         
35         int getId();
36         
37         
38         Image getImage(Display display);
39         
40         /**
41          * Returns whether this annotation is relavant.
42          * <p>
43          * If the annotation is overlaid then it is not
44          * relevant. After all overlays have been removed
45          * the annotation might either become relevant again
46          * or stay irrelevant.
47          * </p>
48          * 
49          * @return <code>true</code> if relevant
50          * @see #hasOverlay()
51          */
52         boolean isRelevant();
53         
54         /**
55          * Returns whether this annotation is overlaid.
56          * 
57          * @return <code>true</code> if overlaid
58          */
59         boolean hasOverlay();
60         
61         /**
62          * Returns an iterator for iterating over the
63          * annotation which are overlaid by this annotation.
64          * 
65          * @return an iterator over the overlaid annotaions
66          */
67         Iterator getOverlaidIterator();
68         
69         /**
70          * Adds the given annotation to the list of
71          * annotations which are overlaid by this annotations.
72          *  
73          * @param annotation    the problem annoation
74          */
75         void addOverlaid(IJavaAnnotation annotation);
76         
77         /**
78          * Removes the given annotation from the list of
79          * annotations which are overlaid by this annotation.
80          *  
81          * @param annotation    the problem annoation
82          */
83         void removeOverlaid(IJavaAnnotation annotation);
84         
85         /**
86          * Tells whether this annotation is a problem
87          * annotation.
88          * 
89          * @return <code>true</code> if it is a problem annotation
90          */
91         boolean isProblem();
92 }