Mercurial > projects > dwt-addons
comparison dwtx/jface/dialogs/PopupDialog.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 | 7ffeace6c47f |
children |
comparison
equal
deleted
inserted
replaced
103:2d6540440fe6 | 104:04b47443bb01 |
---|---|
15 | 15 |
16 import dwtx.jface.dialogs.IDialogConstants; | 16 import dwtx.jface.dialogs.IDialogConstants; |
17 import dwtx.jface.dialogs.IDialogSettings; | 17 import dwtx.jface.dialogs.IDialogSettings; |
18 import dwtx.jface.dialogs.Dialog; | 18 import dwtx.jface.dialogs.Dialog; |
19 | 19 |
20 import tango.util.collection.ArraySeq; | |
21 import tango.util.collection.model.Seq; | |
22 import tango.util.collection.model.SeqView; | |
23 | 20 |
24 import dwt.DWT; | 21 import dwt.DWT; |
25 import dwt.events.DisposeEvent; | 22 import dwt.events.DisposeEvent; |
26 import dwt.events.DisposeListener; | 23 import dwt.events.DisposeListener; |
27 import dwt.events.MouseAdapter; | 24 import dwt.events.MouseAdapter; |
53 import dwtx.jface.layout.GridLayoutFactory; | 50 import dwtx.jface.layout.GridLayoutFactory; |
54 import dwtx.jface.resource.JFaceResources; | 51 import dwtx.jface.resource.JFaceResources; |
55 import dwtx.jface.window.Window; | 52 import dwtx.jface.window.Window; |
56 | 53 |
57 import dwt.dwthelper.utils; | 54 import dwt.dwthelper.utils; |
55 import dwtx.dwtxhelper.Collection; | |
58 import dwt.dwthelper.Runnable; | 56 import dwt.dwthelper.Runnable; |
59 | 57 |
60 /** | 58 /** |
61 * A lightweight, transient dialog that is popped up to show contextual or | 59 * A lightweight, transient dialog that is popped up to show contextual or |
62 * temporal information and is easily dismissed. Clients control whether the | 60 * temporal information and is easily dismissed. Clients control whether the |
1449 * @param exclusions | 1447 * @param exclusions |
1450 * a list of controls who are to be excluded from getting their | 1448 * a list of controls who are to be excluded from getting their |
1451 * color assigned | 1449 * color assigned |
1452 */ | 1450 */ |
1453 private void applyForegroundColor(Color color, Control control, | 1451 private void applyForegroundColor(Color color, Control control, |
1454 SeqView!(Control) exclusions) { | 1452 List exclusions) { |
1455 if (!exclusions.contains(control)) { | 1453 if (!exclusions.contains(control)) { |
1456 control.setForeground(color); | 1454 control.setForeground(color); |
1457 } | 1455 } |
1458 if ( auto comp = cast(Composite)control ) { | 1456 if ( auto comp = cast(Composite)control ) { |
1459 Control[] children = comp.getChildren(); | 1457 Control[] children = comp.getChildren(); |
1474 * @param exclusions | 1472 * @param exclusions |
1475 * a list of controls who are to be excluded from getting their | 1473 * a list of controls who are to be excluded from getting their |
1476 * color assigned | 1474 * color assigned |
1477 */ | 1475 */ |
1478 private void applyBackgroundColor(Color color, Control control, | 1476 private void applyBackgroundColor(Color color, Control control, |
1479 SeqView!(Control) exclusions) { | 1477 List exclusions) { |
1480 if (!exclusions.contains(control)) { | 1478 if (!exclusions.contains(control)) { |
1481 control.setBackground(color); | 1479 control.setBackground(color); |
1482 } | 1480 } |
1483 if (auto comp = cast(Composite)control ) { | 1481 if (auto comp = cast(Composite)control ) { |
1484 Control[] children = comp.getChildren(); | 1482 Control[] children = comp.getChildren(); |
1528 * <code>super.getForegroundColorExclusions</code> to aggregate the list. | 1526 * <code>super.getForegroundColorExclusions</code> to aggregate the list. |
1529 * | 1527 * |
1530 * | 1528 * |
1531 * @return the List of controls | 1529 * @return the List of controls |
1532 */ | 1530 */ |
1533 protected SeqView!(Control) getForegroundColorExclusions() { | 1531 protected List getForegroundColorExclusions() { |
1534 auto list = new ArraySeq!(Control); | 1532 List list = new ArrayList(3); |
1535 list.capacity(3); | |
1536 if (infoLabel !is null) { | 1533 if (infoLabel !is null) { |
1537 list.append(infoLabel); | 1534 list.add(infoLabel); |
1538 } | 1535 } |
1539 if (titleSeparator !is null) { | 1536 if (titleSeparator !is null) { |
1540 list.append(titleSeparator); | 1537 list.add(titleSeparator); |
1541 } | 1538 } |
1542 if (infoSeparator !is null) { | 1539 if (infoSeparator !is null) { |
1543 list.append(infoSeparator); | 1540 list.add(infoSeparator); |
1544 } | 1541 } |
1545 return list; | 1542 return list; |
1546 } | 1543 } |
1547 | 1544 |
1548 /** | 1545 /** |
1550 * reset. Subclasses may extend this method, but should always call | 1547 * reset. Subclasses may extend this method, but should always call |
1551 * <code>super.getBackgroundColorExclusions</code> to aggregate the list. | 1548 * <code>super.getBackgroundColorExclusions</code> to aggregate the list. |
1552 * | 1549 * |
1553 * @return the List of controls | 1550 * @return the List of controls |
1554 */ | 1551 */ |
1555 protected SeqView!(Control) getBackgroundColorExclusions() { | 1552 protected List getBackgroundColorExclusions() { |
1556 auto list = new ArraySeq!(Control); | 1553 List list = new ArrayList(2); |
1557 list.capacity(2); | |
1558 if (titleSeparator !is null) { | 1554 if (titleSeparator !is null) { |
1559 list.append(titleSeparator); | 1555 list.add(titleSeparator); |
1560 } | 1556 } |
1561 if (infoSeparator !is null) { | 1557 if (infoSeparator !is null) { |
1562 list.append(infoSeparator); | 1558 list.add(infoSeparator); |
1563 } | 1559 } |
1564 return list; | 1560 return list; |
1565 } | 1561 } |
1566 | 1562 |
1567 /** | 1563 /** |