KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ant > internal > ui > editor > text > IXMLAnnotation


1 /*******************************************************************************
2  * Copyright (c) 2000, 2004 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 org.eclipse.ant.internal.ui.editor.text;
12
13 import java.util.Iterator JavaDoc;
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 IXMLAnnotation {
26     public static final String JavaDoc ERROR_ANNOTATION_TYPE= "org.eclipse.ui.workbench.texteditor.error"; //$NON-NLS-1$
27
public static final String JavaDoc WARNING_ANNOTATION_TYPE= "org.eclipse.ui.workbench.texteditor.warning"; //$NON-NLS-1$
28
public static final String JavaDoc INFO_ANNOTATION_TYPE= "org.eclipse.ui.workbench.texteditor.info"; //$NON-NLS-1$
29

30     /**
31      * Returns the type of this annotation.
32      *
33      * @return the type of the annotation or <code>null</code> if it has none.
34      */

35     public String JavaDoc getType();
36     
37     /**
38      * Returns whether this annotation is temporary rather than persistent.
39      *
40      * @return <code>true</code> if temporary <code>false</code> otherwise
41      */

42     public boolean isTemporary();
43     
44     /**
45      * Returns the message assocaited with this annotation.
46      *
47      * @return the message for this annotation
48      */

49     public String JavaDoc getMessage();
50     
51     /**
52      * Returns an image for this annotation.
53      *
54      * @param display the display for which the image is requested
55      * @return the image for this annotation
56      */

57     public Image getImage(Display display);
58     
59     /**
60      * Returns whether this annotation is relavant.
61      * <p>
62      * If the annotation is overlaid then it is not
63      * relevant. After all overlays have been removed
64      * the annotation might either become relevant again
65      * or stay irrelevant.
66      * </p>
67      *
68      * @return <code>true</code> if relevant
69      * @see #hasOverlay()
70      */

71     public boolean isRelevant();
72     
73     /**
74      * Returns whether this annotation is overlaid.
75      *
76      * @return <code>true</code> if overlaid
77      */

78     public boolean hasOverlay();
79     
80     /**
81      * Returns an iterator for iterating over the
82      * annotation which are overlaid by this annotation.
83      *
84      * @return an iterator over the overlaid annotaions
85      */

86     public Iterator JavaDoc getOverlaidIterator();
87     
88     /**
89      * Adds the given annotation to the list of
90      * annotations which overlaid by this annotations.
91      *
92      * @param annotation the problem annoation
93      */

94     public void addOverlaid(IXMLAnnotation annotation);
95     
96     /**
97      * Removes the given annotation from the list of
98      * annotations which are overlaid by this annotation.
99      *
100      * @param annotation the problem annoation
101      */

102     public void removeOverlaid(IXMLAnnotation annotation);
103     
104     /**
105      * Tells whether this annotation is a problem
106      * annotation.
107      *
108      * @return <code>true</code> if it is a problem annotation
109      */

110     public boolean isProblem();
111 }
112
Popular Tags