5382a0fe925899fd28b7096dd0b93fec6bfb4636
[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
22  * and problems.
23  * 
24  * @see org.eclipse.core.resources.IMarker
25  * @see org.eclipse.jdt.core.compiler.IProblem
26  */
27 public interface IJavaAnnotation {
28         
29         /**
30          * @see org.eclipse.jface.text.source.Annotation#getType()
31          */
32         String getType();
33         
34         /**
35          * @see org.eclipse.jface.text.source.Annotation#isPersistent()
36          */
37         boolean isPersistent();
38         
39         /**
40          * @see org.eclipse.jface.text.source.Annotation#isMarkedDeleted()
41          */
42         boolean isMarkedDeleted();
43         
44         /**
45          * @see org.eclipse.jface.text.source.Annotation#getText() 
46          */
47         String getText();
48         
49         /**
50          * Returns whether this annotation is overlaid.
51          * 
52          * @return <code>true</code> if overlaid
53          */
54         boolean hasOverlay();
55         
56         /**
57          * Returns the overlay of this annotation.
58          * 
59          * @return the annotation's overlay
60          * @since 3.0
61          */
62         IJavaAnnotation getOverlay();
63         
64         /**
65          * Returns an iterator for iterating over the
66          * annotation which are overlaid by this annotation.
67          * 
68          * @return an iterator over the overlaid annotaions
69          */
70         Iterator getOverlaidIterator();
71         
72         /**
73          * Adds the given annotation to the list of
74          * annotations which are overlaid by this annotations.
75          *  
76          * @param annotation    the problem annoation
77          */
78         void addOverlaid(IJavaAnnotation annotation);
79         
80         /**
81          * Removes the given annotation from the list of
82          * annotations which are overlaid by this annotation.
83          *  
84          * @param annotation    the problem annoation
85          */
86         void removeOverlaid(IJavaAnnotation annotation);
87         
88         /**
89          * Tells whether this annotation is a problem
90          * 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 annotation is set
98          * or <code>null</code> if no corresponding co0mpilationunit exists.
99          */
100         ICompilationUnit getCompilationUnit();
101         
102         String[] getArguments();
103         
104         int getId();
105         
106         Image getImage(Display display);
107 }