comparison dwtx/jface/preference/PreferenceNode.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 b3c8e32d406f
children
comparison
equal deleted inserted replaced
103:2d6540440fe6 104:04b47443bb01
14 14
15 import dwtx.jface.preference.IPreferenceNode; 15 import dwtx.jface.preference.IPreferenceNode;
16 import dwtx.jface.preference.IPreferencePage; 16 import dwtx.jface.preference.IPreferencePage;
17 17
18 18
19 import tango.util.collection.ArraySeq;
20 // import java.util.List; 19 // import java.util.List;
21 20
22 import dwt.graphics.Image; 21 import dwt.graphics.Image;
23 import dwtx.core.runtime.Assert; 22 import dwtx.core.runtime.Assert;
24 import dwtx.jface.resource.ImageDescriptor; 23 import dwtx.jface.resource.ImageDescriptor;
25 24
26 import dwt.dwthelper.utils; 25 import dwt.dwthelper.utils;
26 import dwtx.dwtxhelper.Collection;
27 27
28 /** 28 /**
29 * A concrete implementation of a node in a preference dialog tree. This class 29 * A concrete implementation of a node in a preference dialog tree. This class
30 * also supports lazy creation of the node's preference page. 30 * also supports lazy creation of the node's preference page.
31 */ 31 */
37 37
38 /** 38 /**
39 * The list of subnodes (immediate children) of this node (element type: 39 * The list of subnodes (immediate children) of this node (element type:
40 * <code>IPreferenceNode</code>). 40 * <code>IPreferenceNode</code>).
41 */ 41 */
42 private ArraySeq!(Object) subNodes; 42 private List subNodes;
43 43
44 /** 44 /**
45 * Name of a class that implements <code>IPreferencePage</code>, or 45 * Name of a class that implements <code>IPreferencePage</code>, or
46 * <code>null</code> if none. 46 * <code>null</code> if none.
47 */ 47 */
126 /* 126 /*
127 * (non-Javadoc) Method declared on IPreferenceNode. 127 * (non-Javadoc) Method declared on IPreferenceNode.
128 */ 128 */
129 public void add(IPreferenceNode node) { 129 public void add(IPreferenceNode node) {
130 if (subNodes is null) { 130 if (subNodes is null) {
131 subNodes = new ArraySeq!(Object); 131 subNodes = new ArrayList();
132 } 132 }
133 subNodes.append(cast(Object)node); 133 subNodes.add(cast(Object)node);
134 } 134 }
135 135
136 /** 136 /**
137 * Creates a new instance of the given class <code>className</code>. 137 * Creates a new instance of the given class <code>className</code>.
138 * 138 *
272 */ 272 */
273 public bool remove(IPreferenceNode node) { 273 public bool remove(IPreferenceNode node) {
274 if (subNodes is null) { 274 if (subNodes is null) {
275 return false; 275 return false;
276 } 276 }
277 bool res = subNodes.contains(cast(Object)node); 277 return subNodes.remove(cast(Object)node);
278 subNodes.remove(cast(Object)node);
279 return res;
280 } 278 }
281 279
282 /** 280 /**
283 * Set the current page to be newPage. 281 * Set the current page to be newPage.
284 * 282 *