Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 305739 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/jface/viewers/AbstractTreeViewer.java (-1 / +19 lines)
Lines 761-766 Link Here
761
	 *            the widget
761
	 *            the widget
762
	 */
762
	 */
763
	protected void createChildren(final Widget widget) {
763
	protected void createChildren(final Widget widget) {
764
		createChildren(widget, true);
765
	}
766
	
767
	/**
768
	 * Creates all children for the given widget.
769
	 * <p>
770
	 * The default implementation of this framework method assumes that
771
	 * <code>widget.getData()</code> returns the element corresponding to the
772
	 * node. Note: the node is not visually expanded! You may have to call
773
	 * <code>parent.setExpanded(true)</code>.
774
	 * </p>
775
	 *
776
	 * @param widget
777
	 *            the widget
778
	 * @param materialize 
779
	 * 			  true if children are expected to be fully materialized
780
	 */
781
	void createChildren(final Widget widget, boolean materialize) {
764
		boolean oldBusy = isBusy();
782
		boolean oldBusy = isBusy();
765
		setBusy(true);
783
		setBusy(true);
766
		try {
784
		try {
Lines 1708-1714 Link Here
1708
					&& !isExpandable((Item) widget, null, widget.getData())) {
1726
					&& !isExpandable((Item) widget, null, widget.getData())) {
1709
				return;
1727
				return;
1710
			}
1728
			}
1711
			createChildren(widget);
1729
			createChildren(widget, false);
1712
			if (widget instanceof Item) {
1730
			if (widget instanceof Item) {
1713
				setExpanded((Item) widget, true);
1731
				setExpanded((Item) widget, true);
1714
			}
1732
			}
(-)src/org/eclipse/jface/viewers/TreeViewer.java (-3 / +7 lines)
Lines 610-616 Link Here
610
		}
610
		}
611
	}
611
	}
612
612
613
	protected void createChildren(Widget widget) {
613
	void createChildren(Widget widget, boolean materialize) {
614
		if (contentProviderIsLazy) {
614
		if (contentProviderIsLazy) {
615
			Object element = widget.getData();
615
			Object element = widget.getData();
616
			if (element == null && widget instanceof TreeItem) {
616
			if (element == null && widget instanceof TreeItem) {
Lines 632-643 Link Here
632
			// touch all children to make sure they are materialized
632
			// touch all children to make sure they are materialized
633
			for (int i = 0; i < children.length; i++) {
633
			for (int i = 0; i < children.length; i++) {
634
				if (children[i].getData() == null) {
634
				if (children[i].getData() == null) {
635
					virtualLazyUpdateWidget(widget, i);
635
					if (materialize) {
636
						virtualLazyUpdateWidget(widget, i);
637
					} else {
638
						((TreeItem)children[i]).clearAll(true);
639
					}
636
				}
640
				}
637
			}
641
			}
638
			return;
642
			return;
639
		}
643
		}
640
		super.createChildren(widget);
644
		super.createChildren(widget, materialize);
641
	}
645
	}
642
646
643
	protected void internalAdd(Widget widget, Object parentElement,
647
	protected void internalAdd(Widget widget, Object parentElement,

Return to bug 305739