Mercurial > projects > dwt-addons
comparison dwtx/jface/text/ListLineTracker.d @ 159:7926b636c282
...
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Wed, 27 Aug 2008 01:57:58 +0200 |
parents | 25f1f92fa3df |
children | 1a5b8f8129df |
comparison
equal
deleted
inserted
replaced
158:25f1f92fa3df | 159:7926b636c282 |
---|---|
388 * @see dwtx.jface.text.ILineTracker#computeNumberOfLines(java.lang.String) | 388 * @see dwtx.jface.text.ILineTracker#computeNumberOfLines(java.lang.String) |
389 */ | 389 */ |
390 public final int computeNumberOfLines(String text) { | 390 public final int computeNumberOfLines(String text) { |
391 int count= 0; | 391 int count= 0; |
392 int start= 0; | 392 int start= 0; |
393 AbstractLineTracker.DelimiterInfo delimiterInfo= nextDelimiterInfo(text, start); | 393 AbstractLineTracker_DelimiterInfo delimiterInfo= nextDelimiterInfo(text, start); |
394 while (delimiterInfo !is null && delimiterInfo.delimiterIndex > -1) { | 394 while (delimiterInfo !is null && delimiterInfo.delimiterIndex > -1) { |
395 ++count; | 395 ++count; |
396 start= delimiterInfo.delimiterIndex + delimiterInfo.delimiterLength; | 396 start= delimiterInfo.delimiterIndex + delimiterInfo.delimiterLength; |
397 delimiterInfo= nextDelimiterInfo(text, start); | 397 delimiterInfo= nextDelimiterInfo(text, start); |
398 } | 398 } |
424 * | 424 * |
425 * @param text the text to be searched | 425 * @param text the text to be searched |
426 * @param offset the offset in the given text | 426 * @param offset the offset in the given text |
427 * @return the information of the first found delimiter or <code>null</code> | 427 * @return the information of the first found delimiter or <code>null</code> |
428 */ | 428 */ |
429 protected abstract AbstractLineTracker.DelimiterInfo nextDelimiterInfo(String text, int offset); | 429 protected abstract AbstractLineTracker_DelimiterInfo nextDelimiterInfo(String text, int offset); |
430 | 430 |
431 /** | 431 /** |
432 * Creates the line structure for the given text. Newly created lines are inserted into the line | 432 * Creates the line structure for the given text. Newly created lines are inserted into the line |
433 * structure starting at the given position. Returns the number of newly created lines. | 433 * structure starting at the given position. Returns the number of newly created lines. |
434 * | 434 * |
440 */ | 440 */ |
441 private int createLines(String text, int insertPosition, int offset) { | 441 private int createLines(String text, int insertPosition, int offset) { |
442 | 442 |
443 int count= 0; | 443 int count= 0; |
444 int start= 0; | 444 int start= 0; |
445 AbstractLineTracker.DelimiterInfo delimiterInfo= nextDelimiterInfo(text, 0); | 445 AbstractLineTracker_DelimiterInfo delimiterInfo= nextDelimiterInfo(text, 0); |
446 | 446 |
447 while (delimiterInfo !is null && delimiterInfo.delimiterIndex > -1) { | 447 while (delimiterInfo !is null && delimiterInfo.delimiterIndex > -1) { |
448 | 448 |
449 int index= delimiterInfo.delimiterIndex + (delimiterInfo.delimiterLength - 1); | 449 int index= delimiterInfo.delimiterIndex + (delimiterInfo.delimiterLength - 1); |
450 | 450 |