Mercurial > projects > dwt-addons
annotate dwtx/jface/text/source/IAnnotationModel.d @ 153:f70d9508c95c
Fix java Collection imports
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Mon, 25 Aug 2008 00:27:31 +0200 |
parents | c4fb132a086c |
children |
rev | line source |
---|---|
129 | 1 /******************************************************************************* |
2 * Copyright (c) 2000, 2008 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 * Port to the D programming language: | |
11 * Frank Benoit <benoit@tionex.de> | |
12 *******************************************************************************/ | |
13 module dwtx.jface.text.source.IAnnotationModel; | |
14 | |
131 | 15 import dwtx.jface.text.source.ISharedTextColors; // packageimport |
16 import dwtx.jface.text.source.ILineRange; // packageimport | |
17 import dwtx.jface.text.source.IAnnotationPresentation; // packageimport | |
18 import dwtx.jface.text.source.IVerticalRulerInfoExtension; // packageimport | |
19 import dwtx.jface.text.source.ICharacterPairMatcher; // packageimport | |
20 import dwtx.jface.text.source.TextInvocationContext; // packageimport | |
21 import dwtx.jface.text.source.LineChangeHover; // packageimport | |
22 import dwtx.jface.text.source.IChangeRulerColumn; // packageimport | |
23 import dwtx.jface.text.source.IAnnotationMap; // packageimport | |
24 import dwtx.jface.text.source.IAnnotationModelListenerExtension; // packageimport | |
25 import dwtx.jface.text.source.ISourceViewerExtension2; // packageimport | |
26 import dwtx.jface.text.source.IAnnotationHover; // packageimport | |
27 import dwtx.jface.text.source.ContentAssistantFacade; // packageimport | |
28 import dwtx.jface.text.source.IAnnotationAccess; // packageimport | |
29 import dwtx.jface.text.source.IVerticalRulerExtension; // packageimport | |
30 import dwtx.jface.text.source.IVerticalRulerColumn; // packageimport | |
31 import dwtx.jface.text.source.LineNumberRulerColumn; // packageimport | |
32 import dwtx.jface.text.source.MatchingCharacterPainter; // packageimport | |
33 import dwtx.jface.text.source.IAnnotationModelExtension; // packageimport | |
34 import dwtx.jface.text.source.ILineDifferExtension; // packageimport | |
35 import dwtx.jface.text.source.DefaultCharacterPairMatcher; // packageimport | |
36 import dwtx.jface.text.source.LineNumberChangeRulerColumn; // packageimport | |
37 import dwtx.jface.text.source.IAnnotationAccessExtension; // packageimport | |
38 import dwtx.jface.text.source.ISourceViewer; // packageimport | |
39 import dwtx.jface.text.source.AnnotationModel; // packageimport | |
40 import dwtx.jface.text.source.ILineDifferExtension2; // packageimport | |
41 import dwtx.jface.text.source.IAnnotationModelListener; // packageimport | |
42 import dwtx.jface.text.source.IVerticalRuler; // packageimport | |
43 import dwtx.jface.text.source.DefaultAnnotationHover; // packageimport | |
44 import dwtx.jface.text.source.SourceViewer; // packageimport | |
45 import dwtx.jface.text.source.SourceViewerConfiguration; // packageimport | |
46 import dwtx.jface.text.source.AnnotationBarHoverManager; // packageimport | |
47 import dwtx.jface.text.source.CompositeRuler; // packageimport | |
48 import dwtx.jface.text.source.ImageUtilities; // packageimport | |
49 import dwtx.jface.text.source.VisualAnnotationModel; // packageimport | |
50 import dwtx.jface.text.source.ISourceViewerExtension3; // packageimport | |
51 import dwtx.jface.text.source.ILineDiffInfo; // packageimport | |
52 import dwtx.jface.text.source.VerticalRulerEvent; // packageimport | |
53 import dwtx.jface.text.source.ChangeRulerColumn; // packageimport | |
54 import dwtx.jface.text.source.ILineDiffer; // packageimport | |
55 import dwtx.jface.text.source.AnnotationModelEvent; // packageimport | |
56 import dwtx.jface.text.source.AnnotationColumn; // packageimport | |
57 import dwtx.jface.text.source.AnnotationRulerColumn; // packageimport | |
58 import dwtx.jface.text.source.IAnnotationHoverExtension; // packageimport | |
59 import dwtx.jface.text.source.AbstractRulerColumn; // packageimport | |
60 import dwtx.jface.text.source.ISourceViewerExtension; // packageimport | |
61 import dwtx.jface.text.source.AnnotationMap; // packageimport | |
62 import dwtx.jface.text.source.IVerticalRulerInfo; // packageimport | |
63 import dwtx.jface.text.source.IAnnotationModelExtension2; // packageimport | |
64 import dwtx.jface.text.source.LineRange; // packageimport | |
65 import dwtx.jface.text.source.IAnnotationAccessExtension2; // packageimport | |
66 import dwtx.jface.text.source.VerticalRuler; // packageimport | |
67 import dwtx.jface.text.source.JFaceTextMessages; // packageimport | |
68 import dwtx.jface.text.source.IOverviewRuler; // packageimport | |
69 import dwtx.jface.text.source.Annotation; // packageimport | |
70 import dwtx.jface.text.source.IVerticalRulerListener; // packageimport | |
71 import dwtx.jface.text.source.ISourceViewerExtension4; // packageimport | |
72 import dwtx.jface.text.source.AnnotationPainter; // packageimport | |
73 import dwtx.jface.text.source.IAnnotationHoverExtension2; // packageimport | |
74 import dwtx.jface.text.source.OverviewRuler; // packageimport | |
75 import dwtx.jface.text.source.OverviewRulerHoverManager; // packageimport | |
76 | |
77 | |
129 | 78 import dwt.dwthelper.utils; |
79 | |
153
f70d9508c95c
Fix java Collection imports
Frank Benoit <benoit@tionex.de>
parents:
131
diff
changeset
|
80 import dwtx.dwtxhelper.Collection; |
129 | 81 |
82 import dwtx.jface.text.IDocument; | |
83 import dwtx.jface.text.Position; | |
84 | |
85 | |
86 /** | |
87 * This interface defines the model for managing annotations attached to a document. | |
88 * The model maintains a set of annotations for a given document and notifies registered annotation | |
89 * model listeners about annotation model changes. It also provides methods | |
90 * for querying the current position of an annotation managed | |
91 * by this model. | |
92 * <p> | |
93 * In order to provide backward compatibility for clients of <code>IAnnotationModel</code>, extension | |
94 * interfaces are used to provide a means of evolution. The following extension interfaces | |
95 * exist: | |
96 * <ul> | |
97 * <li> {@link dwtx.jface.text.source.IAnnotationModelExtension} since version 3.0 introducing the concept | |
98 * of model piggybacking annotation models, modification time stamps, and enhanced manipulation methods. | |
99 * </li> | |
100 * <li> {@link dwtx.jface.text.source.IAnnotationModelExtension2} since version 3.4 allows to retrieve | |
101 * annotations within a given region. | |
102 * </li> | |
103 * </ul> | |
104 * </p> | |
105 * | |
106 * Clients may implement this interface or use the default implementation provided | |
107 * by <code>AnnotationModel</code>. | |
108 * | |
109 * @see dwtx.jface.text.source.IAnnotationModelExtension | |
110 * @see dwtx.jface.text.source.IAnnotationModelExtension2 | |
111 * @see dwtx.jface.text.source.Annotation | |
112 * @see dwtx.jface.text.source.IAnnotationModelListener | |
113 */ | |
114 public interface IAnnotationModel { | |
115 | |
116 /** | |
117 * Registers the annotation model listener with this annotation model. | |
118 * After registration listener is informed about each change of this model. | |
119 * If the listener is already registered nothing happens. | |
120 * | |
121 * @param listener the listener to be registered, may not be <code>null</code> | |
122 */ | |
123 void addAnnotationModelListener(IAnnotationModelListener listener); | |
124 | |
125 /** | |
126 * Removes the listener from the model's list of annotation model listeners. | |
127 * If the listener is not registered with the model nothing happens. | |
128 * | |
129 * @param listener the listener to be removed, may not be <code>null</code> | |
130 */ | |
131 void removeAnnotationModelListener(IAnnotationModelListener listener); | |
132 | |
133 /** | |
134 * Connects the annotation model to a document. The annotations managed | |
135 * by this model must subsequently update according to the changes applied | |
136 * to the document. Once an annotation model is connected to a document, | |
137 * all further <code>connect</code> calls must mention the document the | |
138 * model is already connected to. An annotation model primarily uses | |
139 * <code>connect</code> and <code>disconnect</code> for reference counting | |
140 * the document. Reference counting frees the clients from keeping tracker | |
141 * whether a model has already been connected to a document. | |
142 * | |
143 * @param document the document the model gets connected to, | |
144 * may not be <code>null</code> | |
145 * | |
146 * @see #disconnect(IDocument) | |
147 */ | |
148 void connect(IDocument document); | |
149 | |
150 /** | |
151 * Disconnects this model from a document. After that, document changes no longer matter. | |
152 * An annotation model may only be disconnected from a document to which it has been | |
153 * connected before. If the model reference counts the connections to a document, | |
154 * the connection to the document may only be terminated if the reference count does | |
155 * down to 0. | |
156 * | |
157 * @param document the document the model gets disconnected from, | |
158 * may not be <code>null</code> | |
159 * | |
160 * @see #connect(IDocument) for further specification details | |
161 */ | |
162 void disconnect(IDocument document); | |
163 | |
164 /** | |
165 * Adds a annotation to this annotation model. The annotation is associated with | |
166 * with the given position which describes the range covered by the annotation. | |
167 * All registered annotation model listeners are informed about the change. | |
168 * If the model is connected to a document, the position is automatically | |
169 * updated on document changes. If the annotation is already managed by | |
170 * this annotation model or is not a valid position in the connected document | |
171 * nothing happens. | |
172 * <p> | |
173 * <strong>Performance hint:</strong> Use {@link IAnnotationModelExtension#replaceAnnotations(Annotation[], java.util.Map)} | |
174 * if several annotations are added and/or removed. | |
175 * </p> | |
176 * | |
177 * @param annotation the annotation to add, may not be <code>null</code> | |
178 * @param position the position describing the range covered by this annotation, | |
179 * may not be <code>null</code> | |
180 */ | |
181 void addAnnotation(Annotation annotation, Position position); | |
182 | |
183 /** | |
184 * Removes the given annotation from the model. I.e. the annotation is no | |
185 * longer managed by this model. The position associated with the annotation | |
186 * is no longer updated on document changes. If the annotation is not | |
187 * managed by this model, nothing happens. | |
188 * <p> | |
189 * <strong>Performance hint:</strong> Use {@link IAnnotationModelExtension#replaceAnnotations(Annotation[], java.util.Map)} | |
190 * if several annotations are removed and/or added. | |
191 * </p> | |
192 * | |
193 * @param annotation the annotation to be removed from this model, | |
194 * may not be <code>null</code> | |
195 */ | |
196 void removeAnnotation(Annotation annotation); | |
197 | |
198 /** | |
199 * Returns all annotations managed by this model. | |
200 * | |
201 * @return all annotations managed by this model (element type: {@link Annotation}) | |
202 */ | |
203 Iterator getAnnotationIterator(); | |
204 | |
205 /** | |
206 * Returns the position associated with the given annotation. | |
207 * | |
208 * @param annotation the annotation whose position should be returned | |
209 * @return the position of the given annotation or <code>null</code> if no | |
210 * associated annotation exists | |
211 */ | |
212 Position getPosition(Annotation annotation); | |
213 } | |
214 |