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