Mercurial > projects > dwt-addons
annotate dwtx/jface/text/PaintManager.d @ 172:d994a8b2cdf7
again compile fixes
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Wed, 10 Sep 2008 23:14:02 +0200 |
parents | 1a5b8f8129df |
children |
rev | line source |
---|---|
129 | 1 /******************************************************************************* |
2 * Copyright (c) 2000, 2005 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.PaintManager; | |
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.IFindReplaceTargetExtension3; // packageimport | |
111 import dwtx.jface.text.ITextDoubleClickStrategy; // packageimport | |
112 import dwtx.jface.text.IDocumentExtension3; // packageimport | |
113 import dwtx.jface.text.Position; // packageimport | |
114 import dwtx.jface.text.TextMessages; // packageimport | |
115 import dwtx.jface.text.CopyOnWriteTextStore; // packageimport | |
116 import dwtx.jface.text.WhitespaceCharacterPainter; // packageimport | |
117 import dwtx.jface.text.IPositionUpdater; // packageimport | |
118 import dwtx.jface.text.DefaultTextDoubleClickStrategy; // packageimport | |
119 import dwtx.jface.text.ListLineTracker; // 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 | |
153
f70d9508c95c
Fix java Collection imports
Frank Benoit <benoit@tionex.de>
parents:
135
diff
changeset
|
160 import dwtx.dwtxhelper.Collection; |
f70d9508c95c
Fix java Collection imports
Frank Benoit <benoit@tionex.de>
parents:
135
diff
changeset
|
161 |
f70d9508c95c
Fix java Collection imports
Frank Benoit <benoit@tionex.de>
parents:
135
diff
changeset
|
162 |
129 | 163 |
164 import dwt.custom.StyledText; | |
165 import dwt.events.KeyEvent; | |
166 import dwt.events.KeyListener; | |
167 import dwt.events.MouseEvent; | |
168 import dwt.events.MouseListener; | |
169 import dwt.widgets.Control; | |
170 import dwtx.jface.viewers.ISelectionChangedListener; | |
171 import dwtx.jface.viewers.ISelectionProvider; | |
172 import dwtx.jface.viewers.SelectionChangedEvent; | |
173 | |
174 | |
175 /** | |
176 * Manages the {@link dwtx.jface.text.IPainter} object registered with an | |
177 * {@link dwtx.jface.text.ITextViewer}. | |
178 * <p> | |
179 * Clients usually instantiate and configure objects of this type.</p> | |
180 * | |
181 * @since 2.1 | |
182 */ | |
183 public final class PaintManager : KeyListener, MouseListener, ISelectionChangedListener, ITextListener, ITextInputListener { | |
184 | |
185 /** | |
186 * Position updater used by the position manager. This position updater differs from the default position | |
187 * updater in that it extends a position when an insertion happens at the position's offset and right behind | |
188 * the position. | |
189 */ | |
190 static class PaintPositionUpdater : DefaultPositionUpdater { | |
191 | |
192 /** | |
193 * Creates the position updater for the given category. | |
194 * | |
195 * @param category the position category | |
196 */ | |
133
7d818bd32d63
Fix ctors to this with gvim regexp
Frank Benoit <benoit@tionex.de>
parents:
131
diff
changeset
|
197 protected this(String category) { |
129 | 198 super(category); |
199 } | |
200 | |
201 /** | |
202 * If an insertion happens at a position's offset, the | |
203 * position is extended rather than shifted. Also, if something is added | |
204 * right behind the end of the position, the position is extended rather | |
205 * than kept stable. | |
206 */ | |
207 protected void adaptToInsert() { | |
208 | |
209 int myStart= fPosition.offset; | |
210 int myEnd= fPosition.offset + fPosition.length; | |
211 myEnd= Math.max(myStart, myEnd); | |
212 | |
213 int yoursStart= fOffset; | |
214 int yoursEnd= fOffset + fReplaceLength;// - 1; | |
215 yoursEnd= Math.max(yoursStart, yoursEnd); | |
216 | |
217 if (myEnd < yoursStart) | |
218 return; | |
219 | |
220 if (myStart <= yoursStart) | |
221 fPosition.length += fReplaceLength; | |
222 else | |
223 fPosition.offset += fReplaceLength; | |
224 } | |
225 } | |
226 | |
227 /** | |
228 * The paint position manager used by this paint manager. The paint position | |
229 * manager is installed on a single document and control the creation/disposed | |
230 * and updating of a position category that will be used for managing positions. | |
231 */ | |
232 static class PositionManager : IPaintPositionManager { | |
233 | |
234 // /** The document this position manager works on */ | |
235 private IDocument fDocument; | |
236 /** The position updater used for the managing position category */ | |
237 private IPositionUpdater fPositionUpdater; | |
238 /** The managing position category */ | |
239 private String fCategory; | |
240 | |
241 /** | |
242 * Creates a new position manager. Initializes the managing | |
243 * position category using its class name and its hash value. | |
244 */ | |
133
7d818bd32d63
Fix ctors to this with gvim regexp
Frank Benoit <benoit@tionex.de>
parents:
131
diff
changeset
|
245 public this() { |
162 | 246 fCategory= this.classinfo.name ~ Integer.toString(toHash()); |
129 | 247 fPositionUpdater= new PaintPositionUpdater(fCategory); |
248 } | |
249 | |
250 /** | |
251 * Installs this position manager in the given document. The position manager stays | |
252 * active until <code>uninstall</code> or <code>dispose</code> | |
253 * is called. | |
254 * | |
255 * @param document the document to be installed on | |
256 */ | |
257 public void install(IDocument document) { | |
258 fDocument= document; | |
259 fDocument.addPositionCategory(fCategory); | |
260 fDocument.addPositionUpdater(fPositionUpdater); | |
261 } | |
262 | |
263 /** | |
264 * Disposes this position manager. The position manager is automatically | |
265 * removed from the document it has previously been installed | |
266 * on. | |
267 */ | |
268 public void dispose() { | |
269 uninstall(fDocument); | |
270 } | |
271 | |
272 /** | |
273 * Uninstalls this position manager form the given document. If the position | |
274 * manager has no been installed on this document, this method is without effect. | |
275 * | |
276 * @param document the document form which to uninstall | |
277 */ | |
278 public void uninstall(IDocument document) { | |
279 if (document is fDocument && document !is null) { | |
280 try { | |
281 fDocument.removePositionUpdater(fPositionUpdater); | |
282 fDocument.removePositionCategory(fCategory); | |
283 } catch (BadPositionCategoryException x) { | |
284 // should not happen | |
285 } | |
286 fDocument= null; | |
287 } | |
288 } | |
289 | |
290 /* | |
291 * @see IPositionManager#addManagedPosition(Position) | |
292 */ | |
293 public void managePosition(Position position) { | |
294 try { | |
295 fDocument.addPosition(fCategory, position); | |
296 } catch (BadPositionCategoryException x) { | |
297 // should not happen | |
298 } catch (BadLocationException x) { | |
299 // should not happen | |
300 } | |
301 } | |
302 | |
303 /* | |
304 * @see IPositionManager#removeManagedPosition(Position) | |
305 */ | |
306 public void unmanagePosition(Position position) { | |
307 try { | |
308 fDocument.removePosition(fCategory, position); | |
309 } catch (BadPositionCategoryException x) { | |
310 // should not happen | |
311 } | |
312 } | |
313 } | |
314 | |
315 | |
316 /** The painters managed by this paint manager. */ | |
162 | 317 private List fPainters; |
129 | 318 /** The position manager used by this paint manager */ |
319 private PositionManager fManager; | |
320 /** The associated text viewer */ | |
321 private ITextViewer fTextViewer; | |
322 | |
323 /** | |
324 * Creates a new paint manager for the given text viewer. | |
325 * | |
326 * @param textViewer the text viewer associated to this newly created paint manager | |
327 */ | |
133
7d818bd32d63
Fix ctors to this with gvim regexp
Frank Benoit <benoit@tionex.de>
parents:
131
diff
changeset
|
328 public this(ITextViewer textViewer) { |
162 | 329 fPainters= new ArrayList(2); |
129 | 330 fTextViewer= textViewer; |
331 } | |
332 | |
333 | |
334 /** | |
335 * Adds the given painter to the list of painters managed by this paint manager. | |
336 * If the painter is already registered with this paint manager, this method is | |
337 * without effect. | |
338 * | |
339 * @param painter the painter to be added | |
340 */ | |
341 public void addPainter(IPainter painter) { | |
162 | 342 if (!fPainters.contains(cast(Object)painter)) { |
343 fPainters.add(cast(Object)painter); | |
129 | 344 if (fPainters.size() is 1) |
345 install(); | |
346 painter.setPositionManager(fManager); | |
347 painter.paint(IPainter.INTERNAL); | |
348 } | |
349 } | |
350 | |
351 /** | |
352 * Removes the given painter from the list of painters managed by this | |
353 * paint manager. If the painter has not previously been added to this | |
354 * paint manager, this method is without effect. | |
355 * | |
356 * @param painter the painter to be removed | |
357 */ | |
358 public void removePainter(IPainter painter) { | |
162 | 359 if (fPainters.remove(cast(Object)painter)) { |
129 | 360 painter.deactivate(true); |
361 painter.setPositionManager(null); | |
362 } | |
363 if (fPainters.size() is 0) | |
364 dispose(); | |
365 } | |
366 | |
367 /** | |
368 * Installs/activates this paint manager. Is called as soon as the | |
369 * first painter is to be managed by this paint manager. | |
370 */ | |
371 private void install() { | |
372 | |
373 fManager= new PositionManager(); | |
374 if (fTextViewer.getDocument() !is null) | |
375 fManager.install(fTextViewer.getDocument()); | |
376 | |
377 fTextViewer.addTextInputListener(this); | |
378 | |
379 addListeners(); | |
380 } | |
381 | |
382 /** | |
383 * Installs our listener set on the text viewer and the text widget, | |
384 * respectively. | |
385 */ | |
386 private void addListeners() { | |
387 ISelectionProvider provider= fTextViewer.getSelectionProvider(); | |
388 provider.addSelectionChangedListener(this); | |
389 | |
390 fTextViewer.addTextListener(this); | |
391 | |
392 StyledText text= fTextViewer.getTextWidget(); | |
393 text.addKeyListener(this); | |
394 text.addMouseListener(this); | |
395 } | |
396 | |
397 /** | |
398 * Disposes this paint manager. The paint manager uninstalls itself | |
399 * and clears all registered painters. This method is also called when the | |
400 * last painter is removed from the list of managed painters. | |
401 */ | |
402 public void dispose() { | |
403 | |
404 if (fManager !is null) { | |
405 fManager.dispose(); | |
406 fManager= null; | |
407 } | |
408 | |
409 for (Iterator e = fPainters.iterator(); e.hasNext();) | |
134 | 410 (cast(IPainter) e.next()).dispose(); |
129 | 411 fPainters.clear(); |
412 | |
413 fTextViewer.removeTextInputListener(this); | |
414 | |
415 removeListeners(); | |
416 } | |
417 | |
418 /** | |
419 * Removes our set of listeners from the text viewer and widget, | |
420 * respectively. | |
421 */ | |
422 private void removeListeners() { | |
423 ISelectionProvider provider= fTextViewer.getSelectionProvider(); | |
424 if (provider !is null) | |
425 provider.removeSelectionChangedListener(this); | |
426 | |
427 fTextViewer.removeTextListener(this); | |
428 | |
429 StyledText text= fTextViewer.getTextWidget(); | |
430 if (text !is null && !text.isDisposed()) { | |
431 text.removeKeyListener(this); | |
432 text.removeMouseListener(this); | |
433 } | |
434 } | |
435 | |
436 /** | |
437 * Triggers all registered painters for the given reason. | |
438 * | |
439 * @param reason the reason | |
440 * @see IPainter | |
441 */ | |
442 private void paint(int reason) { | |
443 for (Iterator e = fPainters.iterator(); e.hasNext();) | |
134 | 444 (cast(IPainter) e.next()).paint(reason); |
129 | 445 } |
446 | |
447 /* | |
448 * @see KeyListener#keyPressed(KeyEvent) | |
449 */ | |
450 public void keyPressed(KeyEvent e) { | |
451 paint(IPainter.KEY_STROKE); | |
452 } | |
453 | |
454 /* | |
455 * @see KeyListener#keyReleased(KeyEvent) | |
456 */ | |
457 public void keyReleased(KeyEvent e) { | |
458 } | |
459 | |
460 /* | |
461 * @see MouseListener#mouseDoubleClick(MouseEvent) | |
462 */ | |
463 public void mouseDoubleClick(MouseEvent e) { | |
464 } | |
465 | |
466 /* | |
467 * @see MouseListener#mouseDown(MouseEvent) | |
468 */ | |
469 public void mouseDown(MouseEvent e) { | |
470 paint(IPainter.MOUSE_BUTTON); | |
471 } | |
472 | |
473 /* | |
474 * @see MouseListener#mouseUp(MouseEvent) | |
475 */ | |
476 public void mouseUp(MouseEvent e) { | |
477 } | |
478 | |
479 /* | |
480 * @see ISelectionChangedListener#selectionChanged(SelectionChangedEvent) | |
481 */ | |
482 public void selectionChanged(SelectionChangedEvent event) { | |
483 paint(IPainter.SELECTION); | |
484 } | |
485 | |
486 /* | |
487 * @see ITextListener#textChanged(TextEvent) | |
488 */ | |
489 public void textChanged(TextEvent event) { | |
490 | |
491 if (!event.getViewerRedrawState()) | |
492 return; | |
493 | |
494 Control control= fTextViewer.getTextWidget(); | |
495 if (control !is null) { | |
135 | 496 control.getDisplay().asyncExec(new class() Runnable { |
129 | 497 public void run() { |
498 if (fTextViewer !is null) | |
499 paint(IPainter.TEXT_CHANGE); | |
500 } | |
501 }); | |
502 } | |
503 } | |
504 | |
505 /* | |
506 * @see ITextInputListener#inputDocumentAboutToBeChanged(IDocument, IDocument) | |
507 */ | |
508 public void inputDocumentAboutToBeChanged(IDocument oldInput, IDocument newInput) { | |
509 if (oldInput !is null) { | |
510 for (Iterator e = fPainters.iterator(); e.hasNext();) | |
134 | 511 (cast(IPainter) e.next()).deactivate(false); |
129 | 512 fManager.uninstall(oldInput); |
513 removeListeners(); | |
514 } | |
515 } | |
516 | |
517 /* | |
518 * @see ITextInputListener#inputDocumentChanged(IDocument, IDocument) | |
519 */ | |
520 public void inputDocumentChanged(IDocument oldInput, IDocument newInput) { | |
521 if (newInput !is null) { | |
522 fManager.install(newInput); | |
523 paint(IPainter.TEXT_CHANGE); | |
524 addListeners(); | |
525 } | |
526 } | |
527 } | |
528 |