Mercurial > projects > dwt-addons
comparison dwtx/text/edits/UndoCollector.d @ 130:b56e9be9fe88
ctors to this
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 24 Aug 2008 00:30:47 +0200 |
parents | eb30df5ca28b |
children | c4fb132a086c |
comparison
equal
deleted
inserted
replaced
129:eb30df5ca28b | 130:b56e9be9fe88 |
---|---|
25 class UndoCollector : IDocumentListener { | 25 class UndoCollector : IDocumentListener { |
26 | 26 |
27 protected UndoEdit undo; | 27 protected UndoEdit undo; |
28 private int fOffset; | 28 private int fOffset; |
29 private int fLength; | 29 private int fLength; |
30 | 30 |
31 /** | 31 /** |
32 * @since 3.1 | 32 * @since 3.1 |
33 */ | 33 */ |
34 private String fLastCurrentText; | 34 private String fLastCurrentText; |
35 | 35 |
36 public UndoCollector(TextEdit root) { | 36 public this(TextEdit root) { |
37 fOffset= root.getOffset(); | 37 fOffset= root.getOffset(); |
38 fLength= root.getLength(); | 38 fLength= root.getLength(); |
39 } | 39 } |
40 | 40 |
41 public void connect(IDocument document) { | 41 public void connect(IDocument document) { |
66 try { | 66 try { |
67 currentText= event.getDocument().get(offset, currentLength); | 67 currentText= event.getDocument().get(offset, currentLength); |
68 } catch (BadLocationException cannotHappen) { | 68 } catch (BadLocationException cannotHappen) { |
69 Assert.isTrue(false, "Can't happen"); //$NON-NLS-1$ | 69 Assert.isTrue(false, "Can't happen"); //$NON-NLS-1$ |
70 } | 70 } |
71 | 71 |
72 /* | 72 /* |
73 * see https://bugs.eclipse.org/bugs/show_bug.cgi?id=93634 | 73 * see https://bugs.eclipse.org/bugs/show_bug.cgi?id=93634 |
74 * If the same string is replaced on many documents (e.g. rename | 74 * If the same string is replaced on many documents (e.g. rename |
75 * package), the size of the undo can be reduced by using the same | 75 * package), the size of the undo can be reduced by using the same |
76 * String instance in all edits, instead of using the unique String | 76 * String instance in all edits, instead of using the unique String |