KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > ui > javaeditor > IJavaAnnotation


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.internal.ui.javaeditor;
12
13 import java.util.Iterator JavaDoc;
14
15 import org.eclipse.jdt.core.ICompilationUnit;
16 import org.eclipse.jdt.core.compiler.CategorizedProblem;
17
18
19 /**
20  * Interface of annotations representing markers
21  * and problems.
22  *
23  * @see org.eclipse.core.resources.IMarker
24  * @see org.eclipse.jdt.core.compiler.IProblem
25  */

26 public interface IJavaAnnotation {
27
28     /**
29      * @see org.eclipse.jface.text.source.Annotation#getType()
30      */

31     String JavaDoc 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 JavaDoc 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
65      * annotation which are overlaid by this annotation.
66      *
67      * @return an iterator over the overlaid annotations
68      */

69     Iterator JavaDoc getOverlaidIterator();
70
71     /**
72      * Adds the given annotation to the list of
73      * annotations which are overlaid by this annotations.
74      *
75      * @param annotation the problem annotation
76      */

77     void addOverlaid(IJavaAnnotation annotation);
78
79     /**
80      * Removes the given annotation from the list of
81      * annotations which are overlaid by this annotation.
82      *
83      * @param annotation the problem annotation
84      */

85     void removeOverlaid(IJavaAnnotation annotation);
86
87     /**
88      * Tells whether this annotation is a problem
89      * annotation.
90      *
91      * @return <code>true</code> if it is a problem annotation
92      */

93     boolean isProblem();
94
95     /**
96      * Returns the compilation unit corresponding to the document on which the annotation is set
97      * or <code>null</code> if no corresponding compilation unit exists.
98      */

99     ICompilationUnit getCompilationUnit();
100
101     /**
102      * Returns the problem arguments or <code>null</code> if no problem arguments can be evaluated.
103      *
104      * @return returns the problem arguments or <code>null</code> if no problem
105      * arguments can be evaluated.
106      */

107     String JavaDoc[] getArguments();
108
109     /**
110      * Returns the problem id or <code>-1</code> if no problem id can be evaluated.
111      *
112      * @return returns the problem id or <code>-1</code>
113      */

114     int getId();
115
116     /**
117      * Returns the marker type associated to this problem or <code>null<code> if no marker type
118      * can be evaluated. See also {@link CategorizedProblem#getMarkerType()}.
119      *
120      * @return the type of the marker which would be associated to the problem or
121      * <code>null<code> if no marker type can be evaluated.
122      */

123     String JavaDoc getMarkerType();
124 }
125
Popular Tags