Mercurial > projects > dwt-addons
comparison dwtx/jface/text/contentassist/PopupCloser.d @ 140:26688fec6d23
Following dsss compile errors
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 24 Aug 2008 03:23:46 +0200 |
parents | b6bad70d540a |
children | 25f1f92fa3df |
comparison
equal
deleted
inserted
replaced
139:93a6ec48fd28 | 140:26688fec6d23 |
---|---|
110 * @param table the table to be tracked | 110 * @param table the table to be tracked |
111 */ | 111 */ |
112 public void install(ContentAssistant contentAssistant, Table table) { | 112 public void install(ContentAssistant contentAssistant, Table table) { |
113 install(contentAssistant, table, null); | 113 install(contentAssistant, table, null); |
114 } | 114 } |
115 | 115 |
116 /** | 116 /** |
117 * Installs this closer on the given table opened by the given content assistant. | 117 * Installs this closer on the given table opened by the given content assistant. |
118 * | 118 * |
119 * @param contentAssistant the content assistant | 119 * @param contentAssistant the content assistant |
120 * @param table the table to be tracked | 120 * @param table the table to be tracked |
123 */ | 123 */ |
124 public void install(ContentAssistant contentAssistant, Table table, AdditionalInfoController additionalInfoController) { | 124 public void install(ContentAssistant contentAssistant, Table table, AdditionalInfoController additionalInfoController) { |
125 fContentAssistant= contentAssistant; | 125 fContentAssistant= contentAssistant; |
126 fTable= table; | 126 fTable= table; |
127 fAdditionalInfoController= additionalInfoController; | 127 fAdditionalInfoController= additionalInfoController; |
128 | 128 |
129 if (Helper.okToUse(fTable)) { | 129 if (Helper.okToUse(fTable)) { |
130 fShell= fTable.getShell(); | 130 fShell= fTable.getShell(); |
131 fDisplay= fShell.getDisplay(); | 131 fDisplay= fShell.getDisplay(); |
132 | 132 |
133 fShell.addShellListener(this); | 133 fShell.addShellListener(this); |
134 fTable.addFocusListener(this); | 134 fTable.addFocusListener(this); |
135 fScrollbar= fTable.getVerticalBar(); | 135 fScrollbar= fTable.getVerticalBar(); |
136 if (fScrollbar !is null) | 136 if (fScrollbar !is null) |
137 fScrollbar.addSelectionListener(this); | 137 fScrollbar.addSelectionListener(this); |
138 | 138 |
139 fDisplay.addFilter(DWT.Activate, this); | 139 fDisplay.addFilter(DWT.Activate, this); |
140 fDisplay.addFilter(DWT.MouseWheel, this); | 140 fDisplay.addFilter(DWT.MouseWheel, this); |
141 | 141 |
142 fDisplay.addFilter(DWT.Deactivate, this); | 142 fDisplay.addFilter(DWT.Deactivate, this); |
143 | 143 |
144 fDisplay.addFilter(DWT.MouseUp, this); | 144 fDisplay.addFilter(DWT.MouseUp, this); |
145 } | 145 } |
146 } | 146 } |
147 | 147 |
148 /** | 148 /** |
158 if (Helper.okToUse(fTable)) | 158 if (Helper.okToUse(fTable)) |
159 fTable.removeFocusListener(this); | 159 fTable.removeFocusListener(this); |
160 if (fDisplay !is null && ! fDisplay.isDisposed()) { | 160 if (fDisplay !is null && ! fDisplay.isDisposed()) { |
161 fDisplay.removeFilter(DWT.Activate, this); | 161 fDisplay.removeFilter(DWT.Activate, this); |
162 fDisplay.removeFilter(DWT.MouseWheel, this); | 162 fDisplay.removeFilter(DWT.MouseWheel, this); |
163 | 163 |
164 fDisplay.removeFilter(DWT.Deactivate, this); | 164 fDisplay.removeFilter(DWT.Deactivate, this); |
165 | 165 |
166 fDisplay.removeFilter(DWT.MouseUp, this); | 166 fDisplay.removeFilter(DWT.MouseUp, this); |
167 } | 167 } |
168 } | 168 } |
169 | 169 |
170 /* | 170 /* |
230 case DWT.MouseWheel: | 230 case DWT.MouseWheel: |
231 if (fAdditionalInfoController is null) | 231 if (fAdditionalInfoController is null) |
232 return; | 232 return; |
233 if (event.widget is fShell || event.widget is fTable || event.widget is fScrollbar) | 233 if (event.widget is fShell || event.widget is fTable || event.widget is fScrollbar) |
234 return; | 234 return; |
235 | 235 |
236 if (fAdditionalInfoController.getInternalAccessor().getInformationControlReplacer() is null) | 236 if (fAdditionalInfoController.getInternalAccessor().getInformationControlReplacer() is null) |
237 fAdditionalInfoController.hideInformationControl(); | 237 fAdditionalInfoController.hideInformationControl(); |
238 else if (!fAdditionalInfoController.getInternalAccessor().isReplaceInProgress()) { | 238 else if (!fAdditionalInfoController.getInternalAccessor().isReplaceInProgress()) { |
239 IInformationControl infoControl= fAdditionalInfoController.getCurrentInformationControl2(); | 239 IInformationControl infoControl= fAdditionalInfoController.getCurrentInformationControl2(); |
240 // During isReplaceInProgress(), events can come from the replacing information control | 240 // During isReplaceInProgress(), events can come from the replacing information control |
241 if (event.widget instanceof Control && infoControl instanceof IInformationControlExtension5) { | 241 if (cast(Control)event.widget && cast(IInformationControlExtension5)infoControl ) { |
242 Control control= cast(Control) event.widget; | 242 Control control= cast(Control) event.widget; |
243 IInformationControlExtension5 iControl5= cast(IInformationControlExtension5) infoControl; | 243 IInformationControlExtension5 iControl5= cast(IInformationControlExtension5) infoControl; |
244 if (!(iControl5.containsControl(control))) | 244 if (!(iControl5.containsControl(control))) |
245 fAdditionalInfoController.hideInformationControl(); | 245 fAdditionalInfoController.hideInformationControl(); |
246 else if (event.type is DWT.MouseWheel) | 246 else if (event.type is DWT.MouseWheel) |
248 } else if (infoControl !is null && infoControl.isFocusControl()) { | 248 } else if (infoControl !is null && infoControl.isFocusControl()) { |
249 fAdditionalInfoController.getInternalAccessor().replaceInformationControl(true); | 249 fAdditionalInfoController.getInternalAccessor().replaceInformationControl(true); |
250 } | 250 } |
251 } | 251 } |
252 break; | 252 break; |
253 | 253 |
254 case DWT.MouseUp: | 254 case DWT.MouseUp: |
255 if (fAdditionalInfoController is null || fAdditionalInfoController.getInternalAccessor().isReplaceInProgress()) | 255 if (fAdditionalInfoController is null || fAdditionalInfoController.getInternalAccessor().isReplaceInProgress()) |
256 break; | 256 break; |
257 if (event.widget instanceof Control) { | 257 if (cast(Control)event.widget) { |
258 Control control= cast(Control) event.widget; | 258 Control control= cast(Control) event.widget; |
259 IInformationControl infoControl= fAdditionalInfoController.getCurrentInformationControl2(); | 259 IInformationControl infoControl= fAdditionalInfoController.getCurrentInformationControl2(); |
260 if ( cast(IInformationControlExtension5)infoControl ) { | 260 if ( cast(IInformationControlExtension5)infoControl ) { |
261 final IInformationControlExtension5 iControl5= cast(IInformationControlExtension5) infoControl; | 261 final IInformationControlExtension5 iControl5= cast(IInformationControlExtension5) infoControl; |
262 if (iControl5.containsControl(control)) { | 262 if (iControl5.containsControl(control)) { |
269 public void run() { | 269 public void run() { |
270 delayedICP.setDelayedInputChangeListener(null); | 270 delayedICP.setDelayedInputChangeListener(null); |
271 } | 271 } |
272 }); | 272 }); |
273 } | 273 } |
274 | 274 |
275 // XXX: workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=212392 : | 275 // XXX: workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=212392 : |
276 control.getShell().getDisplay().asyncExec(new class() Runnable { | 276 control.getShell().getDisplay().asyncExec(new class() Runnable { |
277 public void run() { | 277 public void run() { |
278 fAdditionalInfoController.getInternalAccessor().replaceInformationControl(true); | 278 fAdditionalInfoController.getInternalAccessor().replaceInformationControl(true); |
279 } | 279 } |
280 }); | 280 }); |
281 } | 281 } |
282 } | 282 } |
283 } | 283 } |
284 break; | 284 break; |
285 | 285 |
286 case DWT.Deactivate: | 286 case DWT.Deactivate: |
287 if (fAdditionalInfoController is null) | 287 if (fAdditionalInfoController is null) |
288 break; | 288 break; |
289 InformationControlReplacer replacer= fAdditionalInfoController.getInternalAccessor().getInformationControlReplacer(); | 289 InformationControlReplacer replacer= fAdditionalInfoController.getInternalAccessor().getInformationControlReplacer(); |
290 if (replacer !is null && fContentAssistant !is null) { | 290 if (replacer !is null && fContentAssistant !is null) { |
291 IInformationControl iControl= replacer.getCurrentInformationControl2(); | 291 IInformationControl iControl= replacer.getCurrentInformationControl2(); |
292 if (event.widget instanceof Control && iControl instanceof IInformationControlExtension5) { | 292 if (cast(Control)event.widget && cast(IInformationControlExtension5)iControl ) { |
293 Control control= cast(Control) event.widget; | 293 Control control= cast(Control) event.widget; |
294 IInformationControlExtension5 iControl5= cast(IInformationControlExtension5) iControl; | 294 IInformationControlExtension5 iControl5= cast(IInformationControlExtension5) iControl; |
295 if (iControl5.containsControl(control)) { | 295 if (iControl5.containsControl(control)) { |
296 control.getDisplay().asyncExec(new class() Runnable { | 296 control.getDisplay().asyncExec(new class() Runnable { |
297 public void run() { | 297 public void run() { |