Mercurial > projects > dwt-addons
comparison dwtx/jface/text/AbstractInformationControl.d @ 161:f8d52b926852
...
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Wed, 27 Aug 2008 14:49:30 +0200 |
parents | a9566845f1cb |
children |
comparison
equal
deleted
inserted
replaced
160:3678e4f1a766 | 161:f8d52b926852 |
---|---|
58 import dwtx.jface.text.IRegion; // packageimport | 58 import dwtx.jface.text.IRegion; // packageimport |
59 import dwtx.jface.text.IInformationControlExtension2; // packageimport | 59 import dwtx.jface.text.IInformationControlExtension2; // packageimport |
60 import dwtx.jface.text.IDocumentExtension4; // packageimport | 60 import dwtx.jface.text.IDocumentExtension4; // packageimport |
61 import dwtx.jface.text.IDocumentExtension2; // packageimport | 61 import dwtx.jface.text.IDocumentExtension2; // packageimport |
62 import dwtx.jface.text.IDocumentPartitionerExtension2; // packageimport | 62 import dwtx.jface.text.IDocumentPartitionerExtension2; // packageimport |
63 import dwtx.jface.text.Assert; // packageimport | 63 // import dwtx.jface.text.Assert; // packageimport |
64 import dwtx.jface.text.DefaultInformationControl; // packageimport | 64 import dwtx.jface.text.DefaultInformationControl; // packageimport |
65 import dwtx.jface.text.IWidgetTokenOwnerExtension; // packageimport | 65 import dwtx.jface.text.IWidgetTokenOwnerExtension; // packageimport |
66 import dwtx.jface.text.DocumentClone; // packageimport | 66 import dwtx.jface.text.DocumentClone; // packageimport |
67 import dwtx.jface.text.DefaultUndoManager; // packageimport | 67 import dwtx.jface.text.DefaultUndoManager; // packageimport |
68 import dwtx.jface.text.IFindReplaceTarget; // packageimport | 68 import dwtx.jface.text.IFindReplaceTarget; // packageimport |
151 import dwtx.jface.text.DocumentRewriteSessionType; // packageimport | 151 import dwtx.jface.text.DocumentRewriteSessionType; // packageimport |
152 import dwtx.jface.text.TextAttribute; // packageimport | 152 import dwtx.jface.text.TextAttribute; // packageimport |
153 import dwtx.jface.text.ITextViewerExtension4; // packageimport | 153 import dwtx.jface.text.ITextViewerExtension4; // packageimport |
154 import dwtx.jface.text.ITypedRegion; // packageimport | 154 import dwtx.jface.text.ITypedRegion; // packageimport |
155 | 155 |
156 | |
157 import dwt.dwthelper.utils; | 156 import dwt.dwthelper.utils; |
158 | |
159 | |
160 | |
161 | 157 |
162 import dwt.DWT; | 158 import dwt.DWT; |
163 import dwt.events.DisposeListener; | 159 import dwt.events.DisposeListener; |
164 import dwt.events.FocusEvent; | 160 import dwt.events.FocusEvent; |
165 import dwt.events.FocusListener; | 161 import dwt.events.FocusListener; |
234 private ToolBar fToolBar; | 230 private ToolBar fToolBar; |
235 | 231 |
236 /** Listener for shell activation and deactivation. */ | 232 /** Listener for shell activation and deactivation. */ |
237 private Listener fShellListener; | 233 private Listener fShellListener; |
238 /** All focus listeners registered to this information control. */ | 234 /** All focus listeners registered to this information control. */ |
239 private ListenerList fFocusListeners= new ListenerList(ListenerList.IDENTITY); | 235 private ListenerList fFocusListeners; |
240 | 236 |
241 /** Size constraints, x is the maxWidth and y is the maxHeight, or <code>null</code> if not set. */ | 237 /** Size constraints, x is the maxWidth and y is the maxHeight, or <code>null</code> if not set. */ |
242 private Point fSizeConstraints; | 238 private Point fSizeConstraints; |
243 /** The size of the resize handle if already set, -1 otherwise */ | 239 /** The size of the resize handle if already set, -1 otherwise */ |
244 private int fResizeHandleSize; | 240 private int fResizeHandleSize; |
303 * @param toolBarManager the manager or <code>null</code> if toolbar is not desired | 299 * @param toolBarManager the manager or <code>null</code> if toolbar is not desired |
304 * | 300 * |
305 * @deprecated clients should use one of the public constructors | 301 * @deprecated clients should use one of the public constructors |
306 */ | 302 */ |
307 this(Shell parentShell, int shellStyle, String statusFieldText, ToolBarManager toolBarManager) { | 303 this(Shell parentShell, int shellStyle, String statusFieldText, ToolBarManager toolBarManager) { |
304 | |
305 fFocusListeners= new ListenerList(ListenerList.IDENTITY); | |
306 | |
308 Assert.isTrue(statusFieldText is null || toolBarManager is null); | 307 Assert.isTrue(statusFieldText is null || toolBarManager is null); |
309 fResizeHandleSize= -1; | 308 fResizeHandleSize= -1; |
310 fToolBarManager= toolBarManager; | 309 fToolBarManager= toolBarManager; |
311 | 310 |
312 if ((shellStyle & DWT.NO_TRIM) !is 0) | 311 if ((shellStyle & DWT.NO_TRIM) !is 0) |
809 } | 808 } |
810 }; | 809 }; |
811 fShell.addListener(DWT.Deactivate, fShellListener); | 810 fShell.addListener(DWT.Deactivate, fShellListener); |
812 fShell.addListener(DWT.Activate, fShellListener); | 811 fShell.addListener(DWT.Activate, fShellListener); |
813 } | 812 } |
814 fFocusListeners.add(listener); | 813 fFocusListeners.add(cast(Object)listener); |
815 } | 814 } |
816 | 815 |
817 /** | 816 /** |
818 * {@inheritDoc} | 817 * {@inheritDoc} |
819 * This method is not intended to be overridden by subclasses. | 818 * This method is not intended to be overridden by subclasses. |
820 */ | 819 */ |
821 public void removeFocusListener(FocusListener listener) { | 820 public void removeFocusListener(FocusListener listener) { |
822 fFocusListeners.remove(listener); | 821 fFocusListeners.remove(cast(Object)listener); |
823 if (fFocusListeners.isEmpty()) { | 822 if (fFocusListeners.isEmpty()) { |
824 fShell.removeListener(DWT.Activate, fShellListener); | 823 fShell.removeListener(DWT.Activate, fShellListener); |
825 fShell.removeListener(DWT.Deactivate, fShellListener); | 824 fShell.removeListener(DWT.Deactivate, fShellListener); |
826 fShellListener= null; | 825 fShellListener= null; |
827 } | 826 } |