Mercurial > projects > dwt-addons
comparison dwtx/jface/text/CopyOnWriteTextStore.d @ 162:1a5b8f8129df
...
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Mon, 08 Sep 2008 00:51:37 +0200 |
parents | 75302ef3f92f |
children |
comparison
equal
deleted
inserted
replaced
161:f8d52b926852 | 162:1a5b8f8129df |
---|---|
59 import dwtx.jface.text.IRegion; // packageimport | 59 import dwtx.jface.text.IRegion; // packageimport |
60 import dwtx.jface.text.IInformationControlExtension2; // packageimport | 60 import dwtx.jface.text.IInformationControlExtension2; // packageimport |
61 import dwtx.jface.text.IDocumentExtension4; // packageimport | 61 import dwtx.jface.text.IDocumentExtension4; // packageimport |
62 import dwtx.jface.text.IDocumentExtension2; // packageimport | 62 import dwtx.jface.text.IDocumentExtension2; // packageimport |
63 import dwtx.jface.text.IDocumentPartitionerExtension2; // packageimport | 63 import dwtx.jface.text.IDocumentPartitionerExtension2; // packageimport |
64 import dwtx.jface.text.Assert; // packageimport | |
65 import dwtx.jface.text.DefaultInformationControl; // packageimport | 64 import dwtx.jface.text.DefaultInformationControl; // packageimport |
66 import dwtx.jface.text.IWidgetTokenOwnerExtension; // packageimport | 65 import dwtx.jface.text.IWidgetTokenOwnerExtension; // packageimport |
67 import dwtx.jface.text.DocumentClone; // packageimport | 66 import dwtx.jface.text.DocumentClone; // packageimport |
68 import dwtx.jface.text.DefaultUndoManager; // packageimport | 67 import dwtx.jface.text.DefaultUndoManager; // packageimport |
69 import dwtx.jface.text.IFindReplaceTarget; // packageimport | 68 import dwtx.jface.text.IFindReplaceTarget; // packageimport |
186 | 185 |
187 /** | 186 /** |
188 * Create an empty text store. | 187 * Create an empty text store. |
189 */ | 188 */ |
190 private this() { | 189 private this() { |
191 super(); | 190 // super(); |
192 } | 191 } |
193 | 192 |
194 /** | 193 /** |
195 * Create a text store with initial content. | 194 * Create a text store with initial content. |
196 * @param text the initial content | 195 * @param text the initial content |
197 */ | 196 */ |
198 private this(String text) { | 197 private this(String text) { |
199 super(); | 198 // super(); |
200 set(text); | 199 set(text); |
201 } | 200 } |
202 | 201 |
203 /* | 202 /* |
204 * @see dwtx.jface.text.ITextStore#get(int) | 203 * @see dwtx.jface.text.ITextStore#get(int) |
237 } | 236 } |
238 | 237 |
239 } | 238 } |
240 | 239 |
241 /** The underlying "real" text store */ | 240 /** The underlying "real" text store */ |
242 protected ITextStore fTextStore= new StringTextStore(); | 241 protected ITextStore fTextStore; |
243 | 242 |
244 /** A modifiable <code>ITextStore</code> instance */ | 243 /** A modifiable <code>ITextStore</code> instance */ |
245 private const ITextStore fModifiableTextStore; | 244 private const ITextStore fModifiableTextStore; |
246 | 245 |
247 /** | 246 /** |
248 * Creates an empty text store. The given text store will be used upon first | 247 * Creates an empty text store. The given text store will be used upon first |
249 * modification attempt. | 248 * modification attempt. |
250 * | 249 * |
251 * @param modifiableTextStore | 250 * @param modifiableTextStore |
252 * a modifiable <code>ITextStore</code> instance, may not be | 251 * a modifiable <code>ITextStore</code> instance, may not be |
253 * <code>null</code> | 252 * <code>null</code> |
254 */ | 253 */ |
255 public this(ITextStore modifiableTextStore) { | 254 public this(ITextStore modifiableTextStore) { |
256 Assert.isNotNull(modifiableTextStore); | 255 Assert.isNotNull(cast(Object)modifiableTextStore); |
256 fTextStore= new StringTextStore(); | |
257 fTextStore= new StringTextStore(); | 257 fTextStore= new StringTextStore(); |
258 fModifiableTextStore= modifiableTextStore; | 258 fModifiableTextStore= modifiableTextStore; |
259 } | 259 } |
260 | 260 |
261 /* | 261 /* |