comparison dwtx/ui/forms/ManagedForm.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 5d489b9f966c
children
comparison
equal deleted inserted replaced
103:2d6540440fe6 104:04b47443bb01
23 import dwtx.ui.forms.widgets.ScrolledForm; 23 import dwtx.ui.forms.widgets.ScrolledForm;
24 import dwtx.ui.internal.forms.MessageManager; 24 import dwtx.ui.internal.forms.MessageManager;
25 25
26 import dwt.dwthelper.utils; 26 import dwt.dwthelper.utils;
27 import dwt.dwthelper.Runnable; 27 import dwt.dwthelper.Runnable;
28 import tango.util.collection.ArraySeq; 28 import dwtx.dwtxhelper.Collection;
29 import tango.core.Thread; 29 import tango.core.Thread;
30 30
31 /** 31 /**
32 * Managed form wraps a form widget and adds life cycle methods for form parts. 32 * Managed form wraps a form widget and adds life cycle methods for form parts.
33 * A form part is a portion of the form that participates in form life cycle 33 * A form part is a portion of the form that participates in form life cycle
59 59
60 private bool initialized; 60 private bool initialized;
61 61
62 private MessageManager messageManager; 62 private MessageManager messageManager;
63 63
64 private ArraySeq!(Object) parts; 64 private Vector parts;
65 65
66 /** 66 /**
67 * Creates a managed form in the provided parent. Form toolkit and widget 67 * Creates a managed form in the provided parent. Form toolkit and widget
68 * will be created and owned by this object. 68 * will be created and owned by this object.
69 * 69 *
70 * @param parent 70 * @param parent
71 * the parent widget 71 * the parent widget
72 */ 72 */
73 public this(Composite parent) { 73 public this(Composite parent) {
74 parts = new ArraySeq!(Object); 74 parts = new Vector();
75 toolkit = new FormToolkit(parent.getDisplay()); 75 toolkit = new FormToolkit(parent.getDisplay());
76 ownsToolkit = true; 76 ownsToolkit = true;
77 form = toolkit.createScrolledForm(parent); 77 form = toolkit.createScrolledForm(parent);
78 } 78 }
79 79
82 * 82 *
83 * @param toolkit 83 * @param toolkit
84 * @param form 84 * @param form
85 */ 85 */
86 public this(FormToolkit toolkit, ScrolledForm form) { 86 public this(FormToolkit toolkit, ScrolledForm form) {
87 parts = new ArraySeq!(Object); 87 parts = new Vector();
88 this.form = form; 88 this.form = form;
89 this.toolkit = toolkit; 89 this.toolkit = toolkit;
90 } 90 }
91 91
92 /* 92 /*
93 * (non-Javadoc) 93 * (non-Javadoc)
94 * 94 *
95 * @see dwtx.ui.forms.IManagedForm#addPart(dwtx.ui.forms.IFormPart) 95 * @see dwtx.ui.forms.IManagedForm#addPart(dwtx.ui.forms.IFormPart)
96 */ 96 */
97 public void addPart(IFormPart part) { 97 public void addPart(IFormPart part) {
98 parts.append(cast(Object)part); 98 parts.add(cast(Object)part);
99 part.initialize(this); 99 part.initialize(this);
100 } 100 }
101 101
102 /* 102 /*
103 * (non-Javadoc) 103 * (non-Javadoc)