Mercurial > projects > dwt-addons
annotate dwtx/jface/viewers/CheckboxTreeViewer.d @ 70:46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Thu, 22 May 2008 01:36:46 +0200 |
parents | ea8ff534f622 |
children | 7ffeace6c47f |
rev | line source |
---|---|
10 | 1 /******************************************************************************* |
2 * Copyright (c) 2000, 2007 IBM Corporation and others. | |
3 * All rights reserved. This program and the accompanying materials | |
4 * are made available under the terms of the Eclipse Public License v1.0 | |
5 * which accompanies this distribution, and is available at | |
6 * http://www.eclipse.org/legal/epl-v10.html | |
7 * | |
8 * Contributors: | |
9 * IBM Corporation - initial API and implementation | |
10 * Port to the D programming language: | |
11 * Frank Benoit <benoit@tionex.de> | |
12 *******************************************************************************/ | |
13 module dwtx.jface.viewers.CheckboxTreeViewer; | |
14 | |
15 import dwtx.jface.viewers.TreeViewer; | |
16 import dwtx.jface.viewers.ICheckable; | |
17 import dwtx.jface.viewers.ICheckStateListener; | |
18 import dwtx.jface.viewers.CustomHashtable; | |
19 import dwtx.jface.viewers.CheckStateChangedEvent; | |
20 | |
21 import tango.util.collection.ArraySeq; | |
22 import tango.util.collection.model.Seq; | |
23 | |
24 import dwt.DWT; | |
25 import dwt.events.SelectionEvent; | |
26 import dwt.widgets.Composite; | |
27 import dwt.widgets.Control; | |
28 import dwt.widgets.Item; | |
29 import dwt.widgets.Tree; | |
30 import dwt.widgets.TreeItem; | |
31 import dwt.widgets.Widget; | |
32 import dwtx.core.runtime.Assert; | |
33 import dwtx.core.runtime.ListenerList; | |
34 import dwtx.jface.util.SafeRunnable; | |
35 | |
36 import dwt.dwthelper.utils; | |
37 import dwt.dwthelper.Runnable; | |
38 | |
39 /** | |
40 * A concrete tree-structured viewer based on an DWT <code>Tree</code> | |
41 * control with checkboxes on each node. | |
42 * <p> | |
43 * This class is not intended to be subclassed outside the viewer framework. | |
44 * It is designed to be instantiated with a pre-existing DWT tree control and configured | |
45 * with a domain-specific content provider, label provider, element filter (optional), | |
46 * and element sorter (optional). | |
47 * </p> | |
48 */ | |
49 public class CheckboxTreeViewer : TreeViewer, ICheckable { | |
43
ea8ff534f622
Fix override and super aliases
Frank Benoit <benoit@tionex.de>
parents:
39
diff
changeset
|
50 alias TreeViewer.preservingSelection preservingSelection; |
10 | 51 |
52 /** | |
53 * List of check state listeners (element type: <code>ICheckStateListener</code>). | |
54 */ | |
55 private ListenerList checkStateListeners; | |
56 | |
57 /** | |
58 * Last item clicked on, or <code>null</code> if none. | |
59 */ | |
60 private TreeItem lastClickedItem = null; | |
61 | |
62 /** | |
63 * Creates a tree viewer on a newly-created tree control under the given parent. | |
64 * The tree control is created using the DWT style bits: <code>CHECK</code> and <code>BORDER</code>. | |
65 * The viewer has no input, no content provider, a default label provider, | |
66 * no sorter, and no filters. | |
67 * | |
68 * @param parent the parent control | |
69 */ | |
70 public this(Composite parent) { | |
71 this(parent, DWT.BORDER); | |
72 } | |
73 | |
74 /** | |
75 * Creates a tree viewer on a newly-created tree control under the given parent. | |
76 * The tree control is created using the given DWT style bits, plus the <code>CHECK</code> style bit. | |
77 * The viewer has no input, no content provider, a default label provider, | |
78 * no sorter, and no filters. | |
79 * | |
80 * @param parent the parent control | |
81 * @param style the DWT style bits | |
82 */ | |
83 public this(Composite parent, int style) { | |
84 this(new Tree(parent, DWT.CHECK | style)); | |
85 } | |
86 | |
87 /** | |
88 * Creates a tree viewer on the given tree control. | |
89 * The <code>DWT.CHECK</code> style bit must be set on the given tree control. | |
90 * The viewer has no input, no content provider, a default label provider, | |
91 * no sorter, and no filters. | |
92 * | |
93 * @param tree the tree control | |
94 */ | |
95 public this(Tree tree) { | |
96 checkStateListeners = new ListenerList(); | |
97 super(tree); | |
98 } | |
99 | |
100 /* (non-Javadoc) | |
101 * Method declared on ICheckable. | |
102 */ | |
103 public void addCheckStateListener(ICheckStateListener listener) { | |
104 checkStateListeners.add(cast(Object)listener); | |
105 } | |
106 | |
107 /** | |
108 * Applies the checked and grayed states of the given widget and its | |
109 * descendents. | |
110 * | |
111 * @param checked a set of elements (element type: <code>Object</code>) | |
112 * @param grayed a set of elements (element type: <code>Object</code>) | |
113 * @param widget the widget | |
114 */ | |
115 private void applyState(CustomHashtable checked, CustomHashtable grayed, | |
116 Widget widget) { | |
117 Item[] items = getChildren(widget); | |
118 for (int i = 0; i < items.length; i++) { | |
119 Item item = items[i]; | |
120 if ( auto ti = cast(TreeItem) item ) { | |
121 Object data = item.getData(); | |
122 if (data !is null) { | |
123 ti.setChecked(checked.containsKey(data)); | |
124 ti.setGrayed(grayed.containsKey(data)); | |
125 } | |
126 } | |
127 applyState(checked, grayed, item); | |
128 } | |
129 } | |
130 | |
131 /** | |
132 * Notifies any check state listeners that the check state of an element has changed. | |
133 * Only listeners registered at the time this method is called are notified. | |
134 * | |
135 * @param event a check state changed event | |
136 * | |
137 * @see ICheckStateListener#checkStateChanged | |
138 */ | |
139 protected void fireCheckStateChanged(CheckStateChangedEvent event) { | |
140 Object[] array = checkStateListeners.getListeners(); | |
141 for (int i = 0; i < array.length; i++) { | |
39 | 142 SafeRunnable.run(new class(cast(ICheckStateListener) array[i]) SafeRunnable { |
10 | 143 ICheckStateListener l; |
39 | 144 this(ICheckStateListener a){ |
145 l = a; | |
10 | 146 } |
147 public void run() { | |
148 l.checkStateChanged(event); | |
149 } | |
150 }); | |
151 } | |
152 | |
153 } | |
154 | |
155 /** | |
156 * Gathers the checked and grayed states of the given widget and its | |
157 * descendents. | |
158 * | |
159 * @param checked a writable set of elements (element type: <code>Object</code>) | |
160 * @param grayed a writable set of elements (element type: <code>Object</code>) | |
161 * @param widget the widget | |
162 */ | |
163 private void gatherState(CustomHashtable checked, CustomHashtable grayed, | |
164 Widget widget) { | |
165 Item[] items = getChildren(widget); | |
166 for (int i = 0; i < items.length; i++) { | |
167 Item item = items[i]; | |
168 if ( auto ti = cast(TreeItem) item ) { | |
169 Object data = item.getData(); | |
170 if (data !is null) { | |
171 if (ti.getChecked()) { | |
172 checked.put(data, data); | |
173 } | |
174 if (ti.getGrayed()) { | |
175 grayed.put(data, data); | |
176 } | |
177 } | |
178 } | |
179 gatherState(checked, grayed, item); | |
180 } | |
181 } | |
182 | |
183 /* (non-Javadoc) | |
184 * Method declared on ICheckable. | |
185 */ | |
186 public bool getChecked(Object element) { | |
187 Widget widget = findItem(element); | |
188 if ( auto ti = cast(TreeItem) widget ) { | |
189 return ti.getChecked(); | |
190 } | |
191 return false; | |
192 } | |
193 | |
194 /** | |
195 * Returns a list of checked elements in this viewer's tree, | |
196 * including currently hidden ones that are marked as | |
197 * checked but are under a collapsed ancestor. | |
198 * <p> | |
199 * This method is typically used when preserving the interesting | |
200 * state of a viewer; <code>setCheckedElements</code> is used during the restore. | |
201 * </p> | |
202 * | |
203 * @return the array of checked elements | |
204 * | |
205 * @see #setCheckedElements | |
206 */ | |
207 public Object[] getCheckedElements() { | |
208 ArraySeq!(Object) v = new ArraySeq!(Object); | |
209 Control tree = getControl(); | |
210 internalCollectChecked(v, tree); | |
211 return v.toArray(); | |
212 } | |
213 | |
214 /** | |
215 * Returns the grayed state of the given element. | |
216 * | |
217 * @param element the element | |
218 * @return <code>true</code> if the element is grayed, | |
219 * and <code>false</code> if not grayed | |
220 */ | |
221 public bool getGrayed(Object element) { | |
222 Widget widget = findItem(element); | |
223 if ( auto ti = cast(TreeItem) widget ) { | |
224 return ti.getGrayed(); | |
225 } | |
226 return false; | |
227 } | |
228 | |
229 /** | |
230 * Returns a list of grayed elements in this viewer's tree, | |
231 * including currently hidden ones that are marked as | |
232 * grayed but are under a collapsed ancestor. | |
233 * <p> | |
234 * This method is typically used when preserving the interesting | |
235 * state of a viewer; <code>setGrayedElements</code> is used during the restore. | |
236 * </p> | |
237 * | |
238 * @return the array of grayed elements | |
239 * | |
240 * @see #setGrayedElements | |
241 */ | |
242 public Object[] getGrayedElements() { | |
243 ArraySeq!(Object) result = new ArraySeq!(Object); | |
244 internalCollectGrayed(result, getControl()); | |
245 return result.toArray(); | |
246 } | |
247 | |
248 /* (non-Javadoc) | |
249 * Method declared on StructuredViewer. | |
250 */ | |
43
ea8ff534f622
Fix override and super aliases
Frank Benoit <benoit@tionex.de>
parents:
39
diff
changeset
|
251 protected override void handleDoubleSelect(SelectionEvent event) { |
10 | 252 |
253 if (lastClickedItem !is null) { | |
254 TreeItem item = lastClickedItem; | |
255 Object data = item.getData(); | |
256 if (data !is null) { | |
257 bool state = item.getChecked(); | |
258 setChecked(data, !state); | |
259 fireCheckStateChanged(new CheckStateChangedEvent(this, data, | |
260 !state)); | |
261 } | |
262 lastClickedItem = null; | |
263 } else { | |
264 super.handleDoubleSelect(event); | |
265 } | |
266 } | |
267 | |
268 /* (non-Javadoc) | |
269 * Method declared on StructuredViewer. | |
270 */ | |
43
ea8ff534f622
Fix override and super aliases
Frank Benoit <benoit@tionex.de>
parents:
39
diff
changeset
|
271 protected override void handleSelect(SelectionEvent event) { |
10 | 272 |
273 lastClickedItem = null; | |
274 if (event.detail is DWT.CHECK) { | |
275 TreeItem item = cast(TreeItem) event.item; | |
276 lastClickedItem = item; | |
277 super.handleSelect(event); | |
278 | |
279 Object data = item.getData(); | |
280 if (data !is null) { | |
281 fireCheckStateChanged(new CheckStateChangedEvent(this, data, | |
282 item.getChecked())); | |
283 } | |
284 } else { | |
285 super.handleSelect(event); | |
286 } | |
287 } | |
288 | |
289 /** | |
290 * Gathers the checked states of the given widget and its | |
291 * descendents, following a pre-order traversal of the tree. | |
292 * | |
293 * @param result a writable list of elements (element type: <code>Object</code>) | |
294 * @param widget the widget | |
295 */ | |
296 private void internalCollectChecked(Seq!(Object) result, Widget widget) { | |
297 Item[] items = getChildren(widget); | |
298 for (int i = 0; i < items.length; i++) { | |
299 Item item = items[i]; | |
300 if ( null !is cast(TreeItem)item && (cast(TreeItem) item).getChecked()) { | |
301 Object data = item.getData(); | |
302 if (data !is null) { | |
303 result.append(data); | |
304 } | |
305 } | |
306 internalCollectChecked(result, item); | |
307 } | |
308 } | |
309 | |
310 /** | |
311 * Gathers the grayed states of the given widget and its | |
312 * descendents, following a pre-order traversal of the tree. | |
313 * | |
314 * @param result a writable list of elements (element type: <code>Object</code>) | |
315 * @param widget the widget | |
316 */ | |
317 private void internalCollectGrayed(Seq!(Object) result, Widget widget) { | |
318 Item[] items = getChildren(widget); | |
319 for (int i = 0; i < items.length; i++) { | |
320 Item item = items[i]; | |
321 if (null !is cast(TreeItem)item && (cast(TreeItem) item).getGrayed()) { | |
322 Object data = item.getData(); | |
323 if (data !is null) { | |
324 result.append(data); | |
325 } | |
326 } | |
327 internalCollectGrayed(result, item); | |
328 } | |
329 } | |
330 | |
331 /** | |
332 * Sets the checked state of all items to correspond to the given set of checked elements. | |
333 * | |
334 * @param checkedElements the set (element type: <code>Object</code>) of elements which are checked | |
335 * @param widget the widget | |
336 */ | |
337 private void internalSetChecked(CustomHashtable checkedElements, | |
338 Widget widget) { | |
339 Item[] items = getChildren(widget); | |
340 for (int i = 0; i < items.length; i++) { | |
341 TreeItem item = cast(TreeItem) items[i]; | |
342 Object data = item.getData(); | |
343 if (data !is null) { | |
344 bool checked = checkedElements.containsKey(data); | |
345 if (checked !is item.getChecked()) { | |
346 item.setChecked(checked); | |
347 } | |
348 } | |
349 internalSetChecked(checkedElements, item); | |
350 } | |
351 } | |
352 | |
353 /** | |
354 * Sets the grayed state of all items to correspond to the given set of grayed elements. | |
355 * | |
356 * @param grayedElements the set (element type: <code>Object</code>) of elements which are grayed | |
357 * @param widget the widget | |
358 */ | |
359 private void internalSetGrayed(CustomHashtable grayedElements, Widget widget) { | |
360 Item[] items = getChildren(widget); | |
361 for (int i = 0; i < items.length; i++) { | |
362 TreeItem item = cast(TreeItem) items[i]; | |
363 Object data = item.getData(); | |
364 if (data !is null) { | |
365 bool grayed = grayedElements.containsKey(data); | |
366 if (grayed !is item.getGrayed()) { | |
367 item.setGrayed(grayed); | |
368 } | |
369 } | |
370 internalSetGrayed(grayedElements, item); | |
371 } | |
372 } | |
373 | |
374 /* (non-Javadoc) | |
375 * Method declared on Viewer. | |
376 */ | |
43
ea8ff534f622
Fix override and super aliases
Frank Benoit <benoit@tionex.de>
parents:
39
diff
changeset
|
377 protected override void preservingSelection(Runnable updateCode) { |
10 | 378 |
379 int n = getItemCount(getControl()); | |
380 CustomHashtable checkedNodes = newHashtable(n * 2 + 1); | |
381 CustomHashtable grayedNodes = newHashtable(n * 2 + 1); | |
382 | |
383 gatherState(checkedNodes, grayedNodes, getControl()); | |
384 | |
385 super.preservingSelection(updateCode); | |
386 | |
387 applyState(checkedNodes, grayedNodes, getControl()); | |
388 } | |
389 | |
390 /* (non-Javadoc) | |
391 * Method declared on ICheckable. | |
392 */ | |
393 public void removeCheckStateListener(ICheckStateListener listener) { | |
394 checkStateListeners.remove(cast(Object)listener); | |
395 } | |
396 | |
397 /* (non-Javadoc) | |
398 * Method declared on ICheckable. | |
399 */ | |
400 public bool setChecked(Object element, bool state) { | |
401 Assert.isNotNull(element); | |
402 Widget widget = internalExpand(element, false); | |
403 if ( auto ti = cast(TreeItem) widget ) { | |
404 ti.setChecked(state); | |
405 return true; | |
406 } | |
407 return false; | |
408 } | |
409 | |
410 /** | |
411 * Sets the checked state for the children of the given item. | |
412 * | |
413 * @param item the item | |
414 * @param state <code>true</code> if the item should be checked, | |
415 * and <code>false</code> if it should be unchecked | |
416 */ | |
417 private void setCheckedChildren(Item item, bool state) { | |
418 createChildren(item); | |
419 Item[] items = getChildren(item); | |
420 if (items !is null) { | |
421 for (int i = 0; i < items.length; i++) { | |
422 Item it = items[i]; | |
423 if (it.getData() !is null && (null !is cast(TreeItem)it )) { | |
424 TreeItem treeItem = cast(TreeItem) it; | |
425 treeItem.setChecked(state); | |
426 setCheckedChildren(treeItem, state); | |
427 } | |
428 } | |
429 } | |
430 } | |
431 | |
432 /** | |
433 * Sets which elements are checked in this viewer's tree. | |
434 * The given list contains the elements that are to be checked; | |
435 * all other elements are to be unchecked. | |
436 * Does not fire events to check state listeners. | |
437 * <p> | |
438 * This method is typically used when restoring the interesting | |
439 * state of a viewer captured by an earlier call to <code>getCheckedElements</code>. | |
440 * </p> | |
441 * | |
442 * @param elements the array of checked elements | |
443 * @see #getCheckedElements | |
444 */ | |
445 public void setCheckedElements(Object[] elements) { | |
446 assertElementsNotNull(elements); | |
447 CustomHashtable checkedElements = newHashtable(elements.length * 2 + 1); | |
448 for (int i = 0; i < elements.length; ++i) { | |
449 Object element = elements[i]; | |
450 // Ensure item exists for element | |
451 internalExpand(element, false); | |
452 checkedElements.put(element, element); | |
453 } | |
454 Control tree = getControl(); | |
455 tree.setRedraw(false); | |
456 internalSetChecked(checkedElements, tree); | |
457 tree.setRedraw(true); | |
458 } | |
459 | |
460 /** | |
461 * Sets the grayed state for the given element in this viewer. | |
462 * | |
463 * @param element the element | |
464 * @param state <code>true</code> if the item should be grayed, | |
465 * and <code>false</code> if it should be ungrayed | |
466 * @return <code>true</code> if the gray state could be set, | |
467 * and <code>false</code> otherwise | |
468 */ | |
469 public bool setGrayed(Object element, bool state) { | |
470 Assert.isNotNull(element); | |
471 Widget widget = internalExpand(element, false); | |
472 if ( auto ti = cast(TreeItem) widget ) { | |
473 ti.setGrayed(state); | |
474 return true; | |
475 } | |
476 return false; | |
477 } | |
478 | |
479 /** | |
480 * Check and gray the selection rather than calling both | |
481 * setGrayed and setChecked as an optimization. | |
482 * Does not fire events to check state listeners. | |
483 * @param element the item being checked | |
484 * @param state a bool indicating selection or deselection | |
485 * @return bool indicating success or failure. | |
486 */ | |
487 public bool setGrayChecked(Object element, bool state) { | |
488 Assert.isNotNull(element); | |
489 Widget widget = internalExpand(element, false); | |
490 if (auto item = cast(TreeItem)widget ) { | |
491 item.setChecked(state); | |
492 item.setGrayed(state); | |
493 return true; | |
494 } | |
495 return false; | |
496 } | |
497 | |
498 /** | |
499 * Sets which elements are grayed in this viewer's tree. | |
500 * The given list contains the elements that are to be grayed; | |
501 * all other elements are to be ungrayed. | |
502 * <p> | |
503 * This method is typically used when restoring the interesting | |
504 * state of a viewer captured by an earlier call to <code>getGrayedElements</code>. | |
505 * </p> | |
506 * | |
507 * @param elements the array of grayed elements | |
508 * | |
509 * @see #getGrayedElements | |
510 */ | |
511 public void setGrayedElements(Object[] elements) { | |
512 assertElementsNotNull(elements); | |
513 CustomHashtable grayedElements = newHashtable(elements.length * 2 + 1); | |
514 for (int i = 0; i < elements.length; ++i) { | |
515 Object element = elements[i]; | |
516 // Ensure item exists for element | |
517 internalExpand(element, false); | |
518 grayedElements.put(element, element); | |
519 } | |
520 Control tree = getControl(); | |
521 tree.setRedraw(false); | |
522 internalSetGrayed(grayedElements, tree); | |
523 tree.setRedraw(true); | |
524 } | |
525 | |
526 /** | |
527 * Sets the grayed state for the given element and its parents | |
528 * in this viewer. | |
529 * | |
530 * @param element the element | |
531 * @param state <code>true</code> if the item should be grayed, | |
532 * and <code>false</code> if it should be ungrayed | |
533 * @return <code>true</code> if the element is visible and the gray | |
534 * state could be set, and <code>false</code> otherwise | |
535 * @see #setGrayed | |
536 */ | |
537 public bool setParentsGrayed(Object element, bool state) { | |
538 Assert.isNotNull(element); | |
539 Widget widget = internalExpand(element, false); | |
540 if (auto item = cast(TreeItem) widget ) { | |
541 item.setGrayed(state); | |
542 item = item.getParentItem(); | |
543 while (item !is null) { | |
544 item.setGrayed(state); | |
545 item = item.getParentItem(); | |
546 } | |
547 return true; | |
548 } | |
549 return false; | |
550 } | |
551 | |
552 /** | |
553 * Sets the checked state for the given element and its visible | |
554 * children in this viewer. | |
555 * Assumes that the element has been expanded before. To enforce | |
556 * that the item is expanded, call <code>expandToLevel</code> | |
557 * for the element. | |
558 * Does not fire events to check state listeners. | |
559 * | |
560 * @param element the element | |
561 * @param state <code>true</code> if the item should be checked, | |
562 * and <code>false</code> if it should be unchecked | |
563 * @return <code>true</code> if the checked state could be set, | |
564 * and <code>false</code> otherwise | |
565 */ | |
566 public bool setSubtreeChecked(Object element, bool state) { | |
567 Widget widget = internalExpand(element, false); | |
568 if (auto item = cast(TreeItem) widget ) { | |
569 item.setChecked(state); | |
570 setCheckedChildren(item, state); | |
571 return true; | |
572 } | |
573 return false; | |
574 } | |
575 | |
576 /** | |
577 * Sets to the given value the checked state for all elements in this viewer. | |
578 * Does not fire events to check state listeners. | |
70
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
43
diff
changeset
|
579 * Assumes that the element has been expanded before. To enforce |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
43
diff
changeset
|
580 * that the item is expanded, call <code>expandToLevel</code> |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
43
diff
changeset
|
581 * for the element. |
10 | 582 * |
583 * @param state <code>true</code> if the element should be checked, | |
584 * and <code>false</code> if it should be unchecked | |
70
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
43
diff
changeset
|
585 * @deprecated as this method only checks or unchecks visible items |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
43
diff
changeset
|
586 * is is recommended that {@link #setSubtreeChecked(Object, bool)} |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
43
diff
changeset
|
587 * is used instead. |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
43
diff
changeset
|
588 * @see #setSubtreeChecked(Object, bool) |
10 | 589 * |
590 * @since 3.2 | |
591 */ | |
592 public void setAllChecked(bool state) { | |
593 setAllChecked(state, getTree().getItems()); | |
594 | |
595 } | |
596 | |
597 /** | |
70
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
43
diff
changeset
|
598 * Set the checked state of the visible items and their children to state. |
10 | 599 * @param state |
600 * @param items | |
70
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
43
diff
changeset
|
601 * @deprecated |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
43
diff
changeset
|
602 * @see #setAllChecked(bool) |
10 | 603 */ |
604 private void setAllChecked(bool state, TreeItem[] items) { | |
605 for (int i = 0; i < items.length; i++) { | |
606 items[i].setChecked(state); | |
607 TreeItem[] children = items[i].getItems(); | |
608 setAllChecked(state, children); | |
609 } | |
610 } | |
611 } |