comparison dwtx/jface/text/AbstractLineTracker.d @ 140:26688fec6d23

Following dsss compile errors
author Frank Benoit <benoit@tionex.de>
date Sun, 24 Aug 2008 03:23:46 +0200
parents 25170b5a8951
children 75302ef3f92f
comparison
equal deleted inserted replaced
139:93a6ec48fd28 140:26688fec6d23
178 */ 178 */
179 public abstract class AbstractLineTracker : ILineTracker, ILineTrackerExtension { 179 public abstract class AbstractLineTracker : ILineTracker, ILineTrackerExtension {
180 180
181 /** 181 /**
182 * Tells whether this class is in debug mode. 182 * Tells whether this class is in debug mode.
183 * 183 *
184 * @since 3.1 184 * @since 3.1
185 */ 185 */
186 private static final bool DEBUG= false; 186 private static final bool DEBUG= false;
187 187
188 /** 188 /**
196 public String delimiter; 196 public String delimiter;
197 } 197 }
198 198
199 /** 199 /**
200 * Representation of replace and set requests. 200 * Representation of replace and set requests.
201 * 201 *
202 * @since 3.1 202 * @since 3.1
203 */ 203 */
204 protected static class Request { 204 protected static class Request {
205 public final int offset; 205 public final int offset;
206 public final int length; 206 public final int length;
223 } 223 }
224 } 224 }
225 225
226 /** 226 /**
227 * The active rewrite session. 227 * The active rewrite session.
228 * 228 *
229 * @since 3.1 229 * @since 3.1
230 */ 230 */
231 private DocumentRewriteSession fActiveRewriteSession; 231 private DocumentRewriteSession fActiveRewriteSession;
232 /** 232 /**
233 * The list of pending requests. 233 * The list of pending requests.
234 * 234 *
235 * @since 3.1 235 * @since 3.1
236 */ 236 */
237 private List fPendingRequests; 237 private List fPendingRequests;
238 /** 238 /**
239 * The implementation that this tracker delegates to. 239 * The implementation that this tracker delegates to.
240 * 240 *
241 * @since 3.2 241 * @since 3.2
242 */ 242 */
243 private ILineTracker fDelegate= new class() ListLineTracker { 243 private ILineTracker fDelegate= new class() ListLineTracker {
244 public String[] getLegalLineDelimiters() { 244 public String[] getLegalLineDelimiters() {
245 return this.outer.getLegalLineDelimiters(); 245 return this.outer.getLegalLineDelimiters();
362 fDelegate.replace(offset, length, text); 362 fDelegate.replace(offset, length, text);
363 } 363 }
364 364
365 /** 365 /**
366 * Converts the implementation to be a {@link TreeLineTracker} if it isn't yet. 366 * Converts the implementation to be a {@link TreeLineTracker} if it isn't yet.
367 * 367 *
368 * @since 3.2 368 * @since 3.2
369 */ 369 */
370 private void checkImplementation() { 370 private void checkImplementation() {
371 if (fNeedsConversion) { 371 if (fNeedsConversion) {
372 fNeedsConversion= false; 372 fNeedsConversion= false;
383 } 383 }
384 384
385 /** 385 /**
386 * Returns the information about the first delimiter found in the given text starting at the 386 * Returns the information about the first delimiter found in the given text starting at the
387 * given offset. 387 * given offset.
388 * 388 *
389 * @param text the text to be searched 389 * @param text the text to be searched
390 * @param offset the offset in the given text 390 * @param offset the offset in the given text
391 * @return the information of the first found delimiter or <code>null</code> 391 * @return the information of the first found delimiter or <code>null</code>
392 */ 392 */
393 protected abstract DelimiterInfo nextDelimiterInfo(String text, int offset); 393 protected abstract DelimiterInfo nextDelimiterInfo(String text, int offset);
415 } 415 }
416 } 416 }
417 417
418 /** 418 /**
419 * Tells whether there's an active rewrite session. 419 * Tells whether there's an active rewrite session.
420 * 420 *
421 * @return <code>true</code> if there is an active rewrite session, <code>false</code> 421 * @return <code>true</code> if there is an active rewrite session, <code>false</code>
422 * otherwise 422 * otherwise
423 * @since 3.1 423 * @since 3.1
424 */ 424 */
425 protected final bool hasActiveRewriteSession() { 425 protected final bool hasActiveRewriteSession() {
426 return fActiveRewriteSession !is null; 426 return fActiveRewriteSession !is null;
427 } 427 }
428 428
429 /** 429 /**
430 * Flushes the active rewrite session. 430 * Flushes the active rewrite session.
431 * 431 *
432 * @throws BadLocationException in case the recorded requests cannot be processed correctly 432 * @throws BadLocationException in case the recorded requests cannot be processed correctly
433 * @since 3.1 433 * @since 3.1
434 */ 434 */
435 protected final void flushRewriteSession() { 435 protected final void flushRewriteSession() {
436 if cast(DEBUG) 436 if (DEBUG)
437 System.out.println("AbstractLineTracker: Flushing rewrite session: " + fActiveRewriteSession); //$NON-NLS-1$ 437 System.out_.println("AbstractLineTracker: Flushing rewrite session: " + fActiveRewriteSession); //$NON-NLS-1$
438 438
439 Iterator e= fPendingRequests.iterator(); 439 Iterator e= fPendingRequests.iterator();
440 440
441 fPendingRequests= null; 441 fPendingRequests= null;
442 fActiveRewriteSession= null; 442 fActiveRewriteSession= null;
450 } 450 }
451 } 451 }
452 452
453 /** 453 /**
454 * Checks the presence of a rewrite session and flushes it. 454 * Checks the presence of a rewrite session and flushes it.
455 * 455 *
456 * @throws BadLocationException in case flushing does not succeed 456 * @throws BadLocationException in case flushing does not succeed
457 * @since 3.1 457 * @since 3.1
458 */ 458 */
459 protected final void checkRewriteSession() { 459 protected final void checkRewriteSession() {
460 if (hasActiveRewriteSession()) 460 if (hasActiveRewriteSession())