129
|
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 * Port to the D programming language:
|
|
11 * Frank Benoit <benoit@tionex.de>
|
|
12 *******************************************************************************/
|
|
13 module dwtx.jface.text.ListLineTracker;
|
|
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.IDocumentInformationMapping; // packageimport
|
|
99 import dwtx.jface.text.MarginPainter; // packageimport
|
|
100 import dwtx.jface.text.IPaintPositionManager; // packageimport
|
|
101 import dwtx.jface.text.TextPresentation; // packageimport
|
|
102 import dwtx.jface.text.IFindReplaceTargetExtension; // packageimport
|
|
103 import dwtx.jface.text.ISlaveDocumentManagerExtension; // packageimport
|
|
104 import dwtx.jface.text.ISelectionValidator; // packageimport
|
|
105 import dwtx.jface.text.IDocumentExtension; // packageimport
|
|
106 import dwtx.jface.text.PropagatingFontFieldEditor; // packageimport
|
|
107 import dwtx.jface.text.ConfigurableLineTracker; // packageimport
|
|
108 import dwtx.jface.text.SlaveDocumentEvent; // packageimport
|
|
109 import dwtx.jface.text.IDocumentListener; // packageimport
|
|
110 import dwtx.jface.text.PaintManager; // packageimport
|
|
111 import dwtx.jface.text.IFindReplaceTargetExtension3; // packageimport
|
|
112 import dwtx.jface.text.ITextDoubleClickStrategy; // packageimport
|
|
113 import dwtx.jface.text.IDocumentExtension3; // packageimport
|
|
114 import dwtx.jface.text.Position; // packageimport
|
|
115 import dwtx.jface.text.TextMessages; // packageimport
|
|
116 import dwtx.jface.text.CopyOnWriteTextStore; // packageimport
|
|
117 import dwtx.jface.text.WhitespaceCharacterPainter; // packageimport
|
|
118 import dwtx.jface.text.IPositionUpdater; // packageimport
|
|
119 import dwtx.jface.text.DefaultTextDoubleClickStrategy; // 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 import java.util.ArrayList;
|
|
160 import java.util.List;
|
|
161
|
|
162 import dwtx.jface.text.AbstractLineTracker.DelimiterInfo;
|
|
163
|
|
164 /**
|
|
165 * Abstract, read-only implementation of <code>ILineTracker</code>. It lets the definition of
|
|
166 * line delimiters to subclasses. Assuming that '\n' is the only line delimiter, this abstract
|
|
167 * implementation defines the following line scheme:
|
|
168 * <ul>
|
|
169 * <li> "" -> [0,0]
|
|
170 * <li> "a" -> [0,1]
|
|
171 * <li> "\n" -> [0,1], [1,0]
|
|
172 * <li> "a\n" -> [0,2], [2,0]
|
|
173 * <li> "a\nb" -> [0,2], [2,1]
|
|
174 * <li> "a\nbc\n" -> [0,2], [2,3], [5,0]
|
|
175 * </ul>
|
|
176 * This class must be subclassed.
|
|
177 *
|
|
178 * @since 3.2
|
|
179 */
|
|
180 abstract class ListLineTracker : ILineTracker {
|
|
181
|
|
182 /** The line information */
|
|
183 private final List fLines= new ArrayList();
|
|
184 /** The length of the tracked text */
|
|
185 private int fTextLength;
|
|
186
|
|
187 /**
|
|
188 * Creates a new line tracker.
|
|
189 */
|
|
190 protected ListLineTracker() {
|
|
191 }
|
|
192
|
|
193 /**
|
|
194 * Binary search for the line at a given offset.
|
|
195 *
|
|
196 * @param offset the offset whose line should be found
|
|
197 * @return the line of the offset
|
|
198 */
|
|
199 private int findLine(int offset) {
|
|
200
|
|
201 if (fLines.size() is 0)
|
|
202 return -1;
|
|
203
|
|
204 int left= 0;
|
|
205 int right= fLines.size() - 1;
|
|
206 int mid= 0;
|
|
207 Line line= null;
|
|
208
|
|
209 while (left < right) {
|
|
210
|
|
211 mid= (left + right) / 2;
|
|
212
|
|
213 line= (Line) fLines.get(mid);
|
|
214 if (offset < line.offset) {
|
|
215 if (left is mid)
|
|
216 right= left;
|
|
217 else
|
|
218 right= mid - 1;
|
|
219 } else if (offset > line.offset) {
|
|
220 if (right is mid)
|
|
221 left= right;
|
|
222 else
|
|
223 left= mid + 1;
|
|
224 } else if (offset is line.offset) {
|
|
225 left= right= mid;
|
|
226 }
|
|
227 }
|
|
228
|
|
229 line= (Line) fLines.get(left);
|
|
230 if (line.offset > offset)
|
|
231 --left;
|
|
232 return left;
|
|
233 }
|
|
234
|
|
235 /**
|
|
236 * Returns the number of lines covered by the specified text range.
|
|
237 *
|
|
238 * @param startLine the line where the text range starts
|
|
239 * @param offset the start offset of the text range
|
|
240 * @param length the length of the text range
|
|
241 * @return the number of lines covered by this text range
|
|
242 * @exception BadLocationException if range is undefined in this tracker
|
|
243 */
|
|
244 private int getNumberOfLines(int startLine, int offset, int length) throws BadLocationException {
|
|
245
|
|
246 if (length is 0)
|
|
247 return 1;
|
|
248
|
|
249 int target= offset + length;
|
|
250
|
|
251 Line l= (Line) fLines.get(startLine);
|
|
252
|
|
253 if (l.delimiter is null)
|
|
254 return 1;
|
|
255
|
|
256 if (l.offset + l.length > target)
|
|
257 return 1;
|
|
258
|
|
259 if (l.offset + l.length is target)
|
|
260 return 2;
|
|
261
|
|
262 return getLineNumberOfOffset(target) - startLine + 1;
|
|
263 }
|
|
264
|
|
265 /*
|
|
266 * @see dwtx.jface.text.ILineTracker#getLineLength(int)
|
|
267 */
|
|
268 public final int getLineLength(int line) throws BadLocationException {
|
|
269 int lines= fLines.size();
|
|
270
|
|
271 if (line < 0 || line > lines)
|
|
272 throw new BadLocationException();
|
|
273
|
|
274 if (lines is 0 || lines is line)
|
|
275 return 0;
|
|
276
|
|
277 Line l= (Line) fLines.get(line);
|
|
278 return l.length;
|
|
279 }
|
|
280
|
|
281 /*
|
|
282 * @see dwtx.jface.text.ILineTracker#getLineNumberOfOffset(int)
|
|
283 */
|
|
284 public final int getLineNumberOfOffset(int position) throws BadLocationException {
|
|
285 if (position < 0 || position > fTextLength)
|
|
286 throw new BadLocationException();
|
|
287
|
|
288 if (position is fTextLength) {
|
|
289
|
|
290 int lastLine= fLines.size() - 1;
|
|
291 if (lastLine < 0)
|
|
292 return 0;
|
|
293
|
|
294 Line l= (Line) fLines.get(lastLine);
|
|
295 return (l.delimiter !is null ? lastLine + 1 : lastLine);
|
|
296 }
|
|
297
|
|
298 return findLine(position);
|
|
299 }
|
|
300
|
|
301 /*
|
|
302 * @see dwtx.jface.text.ILineTracker#getLineInformationOfOffset(int)
|
|
303 */
|
|
304 public final IRegion getLineInformationOfOffset(int position) throws BadLocationException {
|
|
305 if (position > fTextLength)
|
|
306 throw new BadLocationException();
|
|
307
|
|
308 if (position is fTextLength) {
|
|
309 int size= fLines.size();
|
|
310 if (size is 0)
|
|
311 return new Region(0, 0);
|
|
312 Line l= (Line) fLines.get(size - 1);
|
|
313 return (l.delimiter !is null ? new Line(fTextLength, 0) : new Line(fTextLength - l.length, l.length));
|
|
314 }
|
|
315
|
|
316 return getLineInformation(findLine(position));
|
|
317 }
|
|
318
|
|
319 /*
|
|
320 * @see dwtx.jface.text.ILineTracker#getLineInformation(int)
|
|
321 */
|
|
322 public final IRegion getLineInformation(int line) throws BadLocationException {
|
|
323 int lines= fLines.size();
|
|
324
|
|
325 if (line < 0 || line > lines)
|
|
326 throw new BadLocationException();
|
|
327
|
|
328 if (lines is 0)
|
|
329 return new Line(0, 0);
|
|
330
|
|
331 if (line is lines) {
|
|
332 Line l= (Line) fLines.get(line - 1);
|
|
333 return new Line(l.offset + l.length, 0);
|
|
334 }
|
|
335
|
|
336 Line l= (Line) fLines.get(line);
|
|
337 return (l.delimiter !is null ? new Line(l.offset, l.length - l.delimiter.length()) : l);
|
|
338 }
|
|
339
|
|
340 /*
|
|
341 * @see dwtx.jface.text.ILineTracker#getLineOffset(int)
|
|
342 */
|
|
343 public final int getLineOffset(int line) throws BadLocationException {
|
|
344 int lines= fLines.size();
|
|
345
|
|
346 if (line < 0 || line > lines)
|
|
347 throw new BadLocationException();
|
|
348
|
|
349 if (lines is 0)
|
|
350 return 0;
|
|
351
|
|
352 if (line is lines) {
|
|
353 Line l= (Line) fLines.get(line - 1);
|
|
354 if (l.delimiter !is null)
|
|
355 return l.offset + l.length;
|
|
356 throw new BadLocationException();
|
|
357 }
|
|
358
|
|
359 Line l= (Line) fLines.get(line);
|
|
360 return l.offset;
|
|
361 }
|
|
362
|
|
363 /*
|
|
364 * @see dwtx.jface.text.ILineTracker#getNumberOfLines()
|
|
365 */
|
|
366 public final int getNumberOfLines() {
|
|
367 int lines= fLines.size();
|
|
368
|
|
369 if (lines is 0)
|
|
370 return 1;
|
|
371
|
|
372 Line l= (Line) fLines.get(lines - 1);
|
|
373 return (l.delimiter !is null ? lines + 1 : lines);
|
|
374 }
|
|
375
|
|
376 /*
|
|
377 * @see dwtx.jface.text.ILineTracker#getNumberOfLines(int, int)
|
|
378 */
|
|
379 public final int getNumberOfLines(int position, int length) throws BadLocationException {
|
|
380
|
|
381 if (position < 0 || position + length > fTextLength)
|
|
382 throw new BadLocationException();
|
|
383
|
|
384 if (length is 0) // optimization
|
|
385 return 1;
|
|
386
|
|
387 return getNumberOfLines(getLineNumberOfOffset(position), position, length);
|
|
388 }
|
|
389
|
|
390 /*
|
|
391 * @see dwtx.jface.text.ILineTracker#computeNumberOfLines(java.lang.String)
|
|
392 */
|
|
393 public final int computeNumberOfLines(String text) {
|
|
394 int count= 0;
|
|
395 int start= 0;
|
|
396 DelimiterInfo delimiterInfo= nextDelimiterInfo(text, start);
|
|
397 while (delimiterInfo !is null && delimiterInfo.delimiterIndex > -1) {
|
|
398 ++count;
|
|
399 start= delimiterInfo.delimiterIndex + delimiterInfo.delimiterLength;
|
|
400 delimiterInfo= nextDelimiterInfo(text, start);
|
|
401 }
|
|
402 return count;
|
|
403 }
|
|
404
|
|
405 /*
|
|
406 * @see dwtx.jface.text.ILineTracker#getLineDelimiter(int)
|
|
407 */
|
|
408 public final String getLineDelimiter(int line) throws BadLocationException {
|
|
409 int lines= fLines.size();
|
|
410
|
|
411 if (line < 0 || line > lines)
|
|
412 throw new BadLocationException();
|
|
413
|
|
414 if (lines is 0)
|
|
415 return null;
|
|
416
|
|
417 if (line is lines)
|
|
418 return null;
|
|
419
|
|
420 Line l= (Line) fLines.get(line);
|
|
421 return l.delimiter;
|
|
422 }
|
|
423
|
|
424 /**
|
|
425 * Returns the information about the first delimiter found in the given text starting at the
|
|
426 * given offset.
|
|
427 *
|
|
428 * @param text the text to be searched
|
|
429 * @param offset the offset in the given text
|
|
430 * @return the information of the first found delimiter or <code>null</code>
|
|
431 */
|
|
432 protected abstract DelimiterInfo nextDelimiterInfo(String text, int offset);
|
|
433
|
|
434 /**
|
|
435 * Creates the line structure for the given text. Newly created lines are inserted into the line
|
|
436 * structure starting at the given position. Returns the number of newly created lines.
|
|
437 *
|
|
438 * @param text the text for which to create a line structure
|
|
439 * @param insertPosition the position at which the newly created lines are inserted into the
|
|
440 * tracker's line structure
|
|
441 * @param offset the offset of all newly created lines
|
|
442 * @return the number of newly created lines
|
|
443 */
|
|
444 private int createLines(String text, int insertPosition, int offset) {
|
|
445
|
|
446 int count= 0;
|
|
447 int start= 0;
|
|
448 DelimiterInfo delimiterInfo= nextDelimiterInfo(text, 0);
|
|
449
|
|
450 while (delimiterInfo !is null && delimiterInfo.delimiterIndex > -1) {
|
|
451
|
|
452 int index= delimiterInfo.delimiterIndex + (delimiterInfo.delimiterLength - 1);
|
|
453
|
|
454 if (insertPosition + count >= fLines.size())
|
|
455 fLines.add(new Line(offset + start, offset + index, delimiterInfo.delimiter));
|
|
456 else
|
|
457 fLines.add(insertPosition + count, new Line(offset + start, offset + index, delimiterInfo.delimiter));
|
|
458
|
|
459 ++count;
|
|
460 start= index + 1;
|
|
461 delimiterInfo= nextDelimiterInfo(text, start);
|
|
462 }
|
|
463
|
|
464 if (start < text.length()) {
|
|
465 if (insertPosition + count < fLines.size()) {
|
|
466 // there is a line below the current
|
|
467 Line l= (Line) fLines.get(insertPosition + count);
|
|
468 int delta= text.length() - start;
|
|
469 l.offset-= delta;
|
|
470 l.length+= delta;
|
|
471 } else {
|
|
472 fLines.add(new Line(offset + start, offset + text.length() - 1, null));
|
|
473 ++count;
|
|
474 }
|
|
475 }
|
|
476
|
|
477 return count;
|
|
478 }
|
|
479
|
|
480 /*
|
|
481 * @see dwtx.jface.text.ILineTracker#replace(int, int, java.lang.String)
|
|
482 */
|
|
483 public final void replace(int position, int length, String text) throws BadLocationException {
|
|
484 throw new UnsupportedOperationException();
|
|
485 }
|
|
486
|
|
487 /*
|
|
488 * @see dwtx.jface.text.ILineTracker#set(java.lang.String)
|
|
489 */
|
|
490 public final void set(String text) {
|
|
491 fLines.clear();
|
|
492 if (text !is null) {
|
|
493 fTextLength= text.length();
|
|
494 createLines(text, 0, 0);
|
|
495 }
|
|
496 }
|
|
497
|
|
498 /**
|
|
499 * Returns the internal data structure, a {@link List} of {@link Line}s. Used only by
|
|
500 * {@link TreeLineTracker#TreeLineTracker(ListLineTracker)}.
|
|
501 *
|
|
502 * @return the internal list of lines.
|
|
503 */
|
|
504 final List getLines() {
|
|
505 return fLines;
|
|
506 }
|
|
507 }
|