Mercurial > projects > dwt-addons
comparison dwtx/jface/window/Window.d @ 104:04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
These new wrappers now use the tango.util.containers instead of the tango.util.collections.
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Thu, 07 Aug 2008 15:01:33 +0200 |
parents | 46a6e0e6ccd4 |
children |
comparison
equal
deleted
inserted
replaced
103:2d6540440fe6 | 104:04b47443bb01 |
---|---|
14 | 14 |
15 import dwtx.jface.window.IShellProvider; | 15 import dwtx.jface.window.IShellProvider; |
16 import dwtx.jface.window.WindowManager; | 16 import dwtx.jface.window.WindowManager; |
17 import dwtx.jface.window.SameShellProvider; | 17 import dwtx.jface.window.SameShellProvider; |
18 | 18 |
19 import tango.util.collection.ArraySeq; | |
20 | 19 |
21 import dwt.DWT; | 20 import dwt.DWT; |
22 import dwt.events.ShellAdapter; | 21 import dwt.events.ShellAdapter; |
23 import dwt.events.ShellEvent; | 22 import dwt.events.ShellEvent; |
24 import dwt.events.ShellListener; | 23 import dwt.events.ShellListener; |
39 import dwtx.jface.util.Geometry; | 38 import dwtx.jface.util.Geometry; |
40 import dwtx.jface.util.IPropertyChangeListener; | 39 import dwtx.jface.util.IPropertyChangeListener; |
41 import dwtx.jface.util.PropertyChangeEvent; | 40 import dwtx.jface.util.PropertyChangeEvent; |
42 | 41 |
43 import dwt.dwthelper.utils; | 42 import dwt.dwthelper.utils; |
43 import dwtx.dwtxhelper.Collection; | |
44 import tango.io.Stdout; | 44 import tango.io.Stdout; |
45 | 45 |
46 /** | 46 /** |
47 * A JFace window is an object that has no visual representation (no widgets) | 47 * A JFace window is an object that has no visual representation (no widgets) |
48 * until it is told to open. | 48 * until it is told to open. |
327 * <p> | 327 * <p> |
328 * This framework method may be extended (<code>super.close</code> must | 328 * This framework method may be extended (<code>super.close</code> must |
329 * be called). | 329 * be called). |
330 * </p> | 330 * </p> |
331 * <p> | 331 * <p> |
332 * Note that in order to prevent recursive calls to this method | 332 * Note that in order to prevent recursive calls to this method |
333 * it does not call <code>Shell#close()</code>. As a result <code>ShellListener</code>s | 333 * it does not call <code>Shell#close()</code>. As a result <code>ShellListener</code>s |
334 * will not receive a <code>shellClosed</code> event. | 334 * will not receive a <code>shellClosed</code> event. |
335 * </p> | 335 * </p> |
336 * | 336 * |
337 * @return <code>true</code> if the window is (or was already) closed, and | 337 * @return <code>true</code> if the window is (or was already) closed, and |
338 * <code>false</code> if it is still open | 338 * <code>false</code> if it is still open |
382 // and some code that did nothing if the stored image was already | 382 // and some code that did nothing if the stored image was already |
383 // disposed. | 383 // disposed. |
384 // The equivalent in the multi-image version seems to be to remove the | 384 // The equivalent in the multi-image version seems to be to remove the |
385 // disposed images from the array passed to the shell. | 385 // disposed images from the array passed to the shell. |
386 if (defaultImages !is null && defaultImages.length > 0) { | 386 if (defaultImages !is null && defaultImages.length > 0) { |
387 auto nonDisposedImages = new ArraySeq!(Image); | 387 ArrayList nonDisposedImages = new ArrayList(defaultImages.length); |
388 nonDisposedImages.capacity(defaultImages.length); | |
389 for (int i = 0; i < defaultImages.length; ++i) { | 388 for (int i = 0; i < defaultImages.length; ++i) { |
390 if (defaultImages[i] !is null && !defaultImages[i].isDisposed()) { | 389 if (defaultImages[i] !is null && !defaultImages[i].isDisposed()) { |
391 nonDisposedImages.append(defaultImages[i]); | 390 nonDisposedImages.add(defaultImages[i]); |
392 } | 391 } |
393 } | 392 } |
394 | 393 |
395 if (nonDisposedImages.size() <= 0) { | 394 if (nonDisposedImages.size() <= 0) { |
396 Stderr.formatln("Window.configureShell: images disposed"); //$NON-NLS-1$ | 395 Stderr.formatln("Window.configureShell: images disposed"); //$NON-NLS-1$ |
397 } else { | 396 } else { |
398 newShell.setImages(nonDisposedImages.toArray()); | 397 newShell.setImages(arraycast!(Image)(nonDisposedImages.toArray())); |
399 } | 398 } |
400 } | 399 } |
401 | 400 |
402 Layout layout = getLayout(); | 401 Layout layout = getLayout(); |
403 if (layout !is null) { | 402 if (layout !is null) { |