Mercurial > projects > dwt-addons
annotate dwtx/jface/text/IDocumentInformationMapping.d @ 139:93a6ec48fd28
Regexp throws removal in interfaces
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 24 Aug 2008 02:31:41 +0200 |
parents | c4fb132a086c |
children |
rev | line source |
---|---|
129 | 1 /******************************************************************************* |
2 * Copyright (c) 2000, 2005 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.IDocumentInformationMapping; | |
14 | |
131 | 15 import dwtx.jface.text.IDocumentPartitioningListener; // packageimport |
16 import dwtx.jface.text.DefaultTextHover; // packageimport | |
17 import dwtx.jface.text.AbstractInformationControl; // packageimport | |
18 import dwtx.jface.text.TextUtilities; // packageimport | |
19 import dwtx.jface.text.IInformationControlCreatorExtension; // packageimport | |
20 import dwtx.jface.text.AbstractInformationControlManager; // packageimport | |
21 import dwtx.jface.text.ITextViewerExtension2; // packageimport | |
22 import dwtx.jface.text.IDocumentPartitioner; // packageimport | |
23 import dwtx.jface.text.DefaultIndentLineAutoEditStrategy; // packageimport | |
24 import dwtx.jface.text.ITextSelection; // packageimport | |
25 import dwtx.jface.text.Document; // packageimport | |
26 import dwtx.jface.text.FindReplaceDocumentAdapterContentProposalProvider; // packageimport | |
27 import dwtx.jface.text.ITextListener; // packageimport | |
28 import dwtx.jface.text.BadPartitioningException; // packageimport | |
29 import dwtx.jface.text.ITextViewerExtension5; // packageimport | |
30 import dwtx.jface.text.IDocumentPartitionerExtension3; // packageimport | |
31 import dwtx.jface.text.IUndoManager; // packageimport | |
32 import dwtx.jface.text.ITextHoverExtension2; // packageimport | |
33 import dwtx.jface.text.IRepairableDocument; // packageimport | |
34 import dwtx.jface.text.IRewriteTarget; // packageimport | |
35 import dwtx.jface.text.DefaultPositionUpdater; // packageimport | |
36 import dwtx.jface.text.RewriteSessionEditProcessor; // packageimport | |
37 import dwtx.jface.text.TextViewerHoverManager; // packageimport | |
38 import dwtx.jface.text.DocumentRewriteSession; // packageimport | |
39 import dwtx.jface.text.TextViewer; // packageimport | |
40 import dwtx.jface.text.ITextViewerExtension8; // packageimport | |
41 import dwtx.jface.text.RegExMessages; // packageimport | |
42 import dwtx.jface.text.IDelayedInputChangeProvider; // packageimport | |
43 import dwtx.jface.text.ITextOperationTargetExtension; // packageimport | |
44 import dwtx.jface.text.IWidgetTokenOwner; // packageimport | |
45 import dwtx.jface.text.IViewportListener; // packageimport | |
46 import dwtx.jface.text.GapTextStore; // packageimport | |
47 import dwtx.jface.text.MarkSelection; // packageimport | |
48 import dwtx.jface.text.IDocumentPartitioningListenerExtension; // packageimport | |
49 import dwtx.jface.text.IDocumentAdapterExtension; // packageimport | |
50 import dwtx.jface.text.IInformationControlExtension; // packageimport | |
51 import dwtx.jface.text.IDocumentPartitioningListenerExtension2; // packageimport | |
52 import dwtx.jface.text.DefaultDocumentAdapter; // packageimport | |
53 import dwtx.jface.text.ITextViewerExtension3; // packageimport | |
54 import dwtx.jface.text.IInformationControlCreator; // packageimport | |
55 import dwtx.jface.text.TypedRegion; // packageimport | |
56 import dwtx.jface.text.ISynchronizable; // packageimport | |
57 import dwtx.jface.text.IMarkRegionTarget; // packageimport | |
58 import dwtx.jface.text.TextViewerUndoManager; // packageimport | |
59 import dwtx.jface.text.IRegion; // packageimport | |
60 import dwtx.jface.text.IInformationControlExtension2; // packageimport | |
61 import dwtx.jface.text.IDocumentExtension4; // packageimport | |
62 import dwtx.jface.text.IDocumentExtension2; // packageimport | |
63 import dwtx.jface.text.IDocumentPartitionerExtension2; // packageimport | |
64 import dwtx.jface.text.Assert; // packageimport | |
65 import dwtx.jface.text.DefaultInformationControl; // packageimport | |
66 import dwtx.jface.text.IWidgetTokenOwnerExtension; // packageimport | |
67 import dwtx.jface.text.DocumentClone; // packageimport | |
68 import dwtx.jface.text.DefaultUndoManager; // packageimport | |
69 import dwtx.jface.text.IFindReplaceTarget; // packageimport | |
70 import dwtx.jface.text.IAutoEditStrategy; // packageimport | |
71 import dwtx.jface.text.ILineTrackerExtension; // packageimport | |
72 import dwtx.jface.text.IUndoManagerExtension; // packageimport | |
73 import dwtx.jface.text.TextSelection; // packageimport | |
74 import dwtx.jface.text.DefaultAutoIndentStrategy; // packageimport | |
75 import dwtx.jface.text.IAutoIndentStrategy; // packageimport | |
76 import dwtx.jface.text.IPainter; // packageimport | |
77 import dwtx.jface.text.IInformationControl; // packageimport | |
78 import dwtx.jface.text.IInformationControlExtension3; // packageimport | |
79 import dwtx.jface.text.ITextViewerExtension6; // packageimport | |
80 import dwtx.jface.text.IInformationControlExtension4; // packageimport | |
81 import dwtx.jface.text.DefaultLineTracker; // packageimport | |
82 import dwtx.jface.text.IDocumentInformationMappingExtension; // packageimport | |
83 import dwtx.jface.text.IRepairableDocumentExtension; // packageimport | |
84 import dwtx.jface.text.ITextHover; // packageimport | |
85 import dwtx.jface.text.FindReplaceDocumentAdapter; // packageimport | |
86 import dwtx.jface.text.ILineTracker; // packageimport | |
87 import dwtx.jface.text.Line; // packageimport | |
88 import dwtx.jface.text.ITextViewerExtension; // packageimport | |
89 import dwtx.jface.text.IDocumentAdapter; // packageimport | |
90 import dwtx.jface.text.TextEvent; // packageimport | |
91 import dwtx.jface.text.BadLocationException; // packageimport | |
92 import dwtx.jface.text.AbstractDocument; // packageimport | |
93 import dwtx.jface.text.AbstractLineTracker; // packageimport | |
94 import dwtx.jface.text.TreeLineTracker; // packageimport | |
95 import dwtx.jface.text.ITextPresentationListener; // packageimport | |
96 import dwtx.jface.text.Region; // packageimport | |
97 import dwtx.jface.text.ITextViewer; // packageimport | |
98 import dwtx.jface.text.MarginPainter; // packageimport | |
99 import dwtx.jface.text.IPaintPositionManager; // packageimport | |
100 import dwtx.jface.text.TextPresentation; // packageimport | |
101 import dwtx.jface.text.IFindReplaceTargetExtension; // packageimport | |
102 import dwtx.jface.text.ISlaveDocumentManagerExtension; // packageimport | |
103 import dwtx.jface.text.ISelectionValidator; // packageimport | |
104 import dwtx.jface.text.IDocumentExtension; // packageimport | |
105 import dwtx.jface.text.PropagatingFontFieldEditor; // packageimport | |
106 import dwtx.jface.text.ConfigurableLineTracker; // packageimport | |
107 import dwtx.jface.text.SlaveDocumentEvent; // packageimport | |
108 import dwtx.jface.text.IDocumentListener; // packageimport | |
109 import dwtx.jface.text.PaintManager; // packageimport | |
110 import dwtx.jface.text.IFindReplaceTargetExtension3; // packageimport | |
111 import dwtx.jface.text.ITextDoubleClickStrategy; // packageimport | |
112 import dwtx.jface.text.IDocumentExtension3; // packageimport | |
113 import dwtx.jface.text.Position; // packageimport | |
114 import dwtx.jface.text.TextMessages; // packageimport | |
115 import dwtx.jface.text.CopyOnWriteTextStore; // packageimport | |
116 import dwtx.jface.text.WhitespaceCharacterPainter; // packageimport | |
117 import dwtx.jface.text.IPositionUpdater; // packageimport | |
118 import dwtx.jface.text.DefaultTextDoubleClickStrategy; // packageimport | |
119 import dwtx.jface.text.ListLineTracker; // packageimport | |
120 import dwtx.jface.text.ITextInputListener; // packageimport | |
121 import dwtx.jface.text.BadPositionCategoryException; // packageimport | |
122 import dwtx.jface.text.IWidgetTokenKeeperExtension; // packageimport | |
123 import dwtx.jface.text.IInputChangedListener; // packageimport | |
124 import dwtx.jface.text.ITextOperationTarget; // packageimport | |
125 import dwtx.jface.text.IDocumentInformationMappingExtension2; // packageimport | |
126 import dwtx.jface.text.ITextViewerExtension7; // packageimport | |
127 import dwtx.jface.text.IInformationControlExtension5; // packageimport | |
128 import dwtx.jface.text.IDocumentRewriteSessionListener; // packageimport | |
129 import dwtx.jface.text.JFaceTextUtil; // packageimport | |
130 import dwtx.jface.text.AbstractReusableInformationControlCreator; // packageimport | |
131 import dwtx.jface.text.TabsToSpacesConverter; // packageimport | |
132 import dwtx.jface.text.CursorLinePainter; // packageimport | |
133 import dwtx.jface.text.ITextHoverExtension; // packageimport | |
134 import dwtx.jface.text.IEventConsumer; // packageimport | |
135 import dwtx.jface.text.IDocument; // packageimport | |
136 import dwtx.jface.text.IWidgetTokenKeeper; // packageimport | |
137 import dwtx.jface.text.DocumentCommand; // packageimport | |
138 import dwtx.jface.text.TypedPosition; // packageimport | |
139 import dwtx.jface.text.IEditingSupportRegistry; // packageimport | |
140 import dwtx.jface.text.IDocumentPartitionerExtension; // packageimport | |
141 import dwtx.jface.text.AbstractHoverInformationControlManager; // packageimport | |
142 import dwtx.jface.text.IEditingSupport; // packageimport | |
143 import dwtx.jface.text.IMarkSelection; // packageimport | |
144 import dwtx.jface.text.ISlaveDocumentManager; // packageimport | |
145 import dwtx.jface.text.DocumentEvent; // packageimport | |
146 import dwtx.jface.text.DocumentPartitioningChangedEvent; // packageimport | |
147 import dwtx.jface.text.ITextStore; // packageimport | |
148 import dwtx.jface.text.JFaceTextMessages; // packageimport | |
149 import dwtx.jface.text.DocumentRewriteSessionEvent; // packageimport | |
150 import dwtx.jface.text.SequentialRewriteTextStore; // packageimport | |
151 import dwtx.jface.text.DocumentRewriteSessionType; // packageimport | |
152 import dwtx.jface.text.TextAttribute; // packageimport | |
153 import dwtx.jface.text.ITextViewerExtension4; // packageimport | |
154 import dwtx.jface.text.ITypedRegion; // packageimport | |
155 | |
156 | |
129 | 157 import dwt.dwthelper.utils; |
158 | |
159 | |
160 /** | |
161 * A <code>IDocumentInformationMapping</code> represents a mapping between the coordinates of two | |
162 * <code>IDocument</code> objects: the original and the image. The document information mapping | |
163 * can translate document information such as line numbers or character ranges given for the original into | |
164 * the corresponding information of the image and vice versa. | |
165 * | |
166 * In order to provided backward compatibility for clients of <code>IDocumentInformationMapping</code>, extension | |
167 * interfaces are used to provide a means of evolution. The following extension interfaces | |
168 * exist: | |
169 * <ul> | |
170 * <li> {@link dwtx.jface.text.IDocumentInformationMappingExtension} since version 3.0 extending the | |
171 * degree of detail of the mapping information.</li> | |
172 * <li> {@link dwtx.jface.text.IDocumentInformationMappingExtension2} since version 3.1, adding lenient | |
173 * image region computation.</li> | |
174 * </ul> | |
175 * | |
176 * @since 2.1 | |
177 */ | |
178 public interface IDocumentInformationMapping { | |
179 | |
180 /** | |
181 * Returns the minimal region of the original document that completely comprises all of the image document | |
182 * or <code>null</code> if there is no such region. | |
183 * | |
184 * @return the minimal region of the original document comprising the image document or <code>null</code> | |
185 */ | |
186 IRegion getCoverage(); | |
187 | |
188 /** | |
189 * Returns the offset in the original document that corresponds to the given offset in the image document | |
190 * or <code>-1</code> if there is no such offset | |
191 * | |
192 * @param imageOffset the offset in the image document | |
193 * @return the corresponding offset in the original document or <code>-1</code> | |
194 * @throws BadLocationException if <code>imageOffset</code> is not a valid offset in the image document | |
195 */ | |
139
93a6ec48fd28
Regexp throws removal in interfaces
Frank Benoit <benoit@tionex.de>
parents:
131
diff
changeset
|
196 int toOriginOffset(int imageOffset) ; |
129 | 197 |
198 /** | |
199 * Returns the minimal region of the original document that completely comprises the given region of the | |
200 * image document or <code>null</code> if there is no such region. | |
201 * | |
202 * @param imageRegion the region of the image document | |
203 * @return the minimal region of the original document comprising the given region of the image document or <code>null</code> | |
204 * @throws BadLocationException if <code>imageRegion</code> is not a valid region of the image document | |
205 */ | |
139
93a6ec48fd28
Regexp throws removal in interfaces
Frank Benoit <benoit@tionex.de>
parents:
131
diff
changeset
|
206 IRegion toOriginRegion(IRegion imageRegion) ; |
129 | 207 |
208 /** | |
209 * Returns the range of lines of the original document that corresponds to the given line of the image document or | |
210 * <code>null</code> if there are no such lines. | |
211 * | |
212 * @param imageLine the line of the image document | |
213 * @return the corresponding lines of the original document or <code>null</code> | |
214 * @throws BadLocationException if <code>imageLine</code> is not a valid line number in the image document | |
215 */ | |
139
93a6ec48fd28
Regexp throws removal in interfaces
Frank Benoit <benoit@tionex.de>
parents:
131
diff
changeset
|
216 IRegion toOriginLines(int imageLine) ; |
129 | 217 |
218 /** | |
219 * Returns the line of the original document that corresponds to the given line of the image document or | |
220 * <code>-1</code> if there is no such line. | |
221 * | |
222 * @param imageLine the line of the image document | |
223 * @return the corresponding line of the original document or <code>-1</code> | |
224 * @throws BadLocationException if <code>imageLine</code> is not a valid line number in the image document | |
225 */ | |
139
93a6ec48fd28
Regexp throws removal in interfaces
Frank Benoit <benoit@tionex.de>
parents:
131
diff
changeset
|
226 int toOriginLine(int imageLine) ; |
129 | 227 |
228 | |
229 | |
230 /** | |
231 * Returns the offset in the image document that corresponds to the given offset in the original document | |
232 * or <code>-1</code> if there is no such offset | |
233 * | |
234 * @param originOffset the offset in the original document | |
235 * @return the corresponding offset in the image document or <code>-1</code> | |
236 * @throws BadLocationException if <code>originOffset</code> is not a valid offset in the original document | |
237 */ | |
139
93a6ec48fd28
Regexp throws removal in interfaces
Frank Benoit <benoit@tionex.de>
parents:
131
diff
changeset
|
238 int toImageOffset(int originOffset) ; |
129 | 239 |
240 /** | |
241 * Returns the minimal region of the image document that completely comprises the given region of the | |
242 * original document or <code>null</code> if there is no such region. | |
243 * | |
244 * @param originRegion the region of the original document | |
245 * @return the minimal region of the image document comprising the given region of the original document or <code>null</code> | |
246 * @throws BadLocationException if <code>originRegion</code> is not a valid region of the original document | |
247 */ | |
139
93a6ec48fd28
Regexp throws removal in interfaces
Frank Benoit <benoit@tionex.de>
parents:
131
diff
changeset
|
248 IRegion toImageRegion(IRegion originRegion) ; |
129 | 249 |
250 /** | |
251 * Returns the line of the image document that corresponds to the given line of the original document or | |
252 * <code>-1</code> if there is no such line. | |
253 * | |
254 * @param originLine the line of the original document | |
255 * @return the corresponding line of the image document or <code>-1</code> | |
256 * @throws BadLocationException if <code>originLine</code> is not a valid line number in the original document | |
257 */ | |
139
93a6ec48fd28
Regexp throws removal in interfaces
Frank Benoit <benoit@tionex.de>
parents:
131
diff
changeset
|
258 int toImageLine(int originLine) ; |
129 | 259 |
260 /** | |
261 * Returns the line of the image document whose corresponding line in the original document | |
262 * is closest to the given line in the original document. | |
263 * | |
264 * @param originLine the line in the original document | |
265 * @return the line in the image document that corresponds best to the given line in the original document | |
266 * @throws BadLocationException if <code>originLine</code>is not a valid line in the original document | |
267 */ | |
139
93a6ec48fd28
Regexp throws removal in interfaces
Frank Benoit <benoit@tionex.de>
parents:
131
diff
changeset
|
268 int toClosestImageLine(int originLine) ; |
129 | 269 } |