for (int i = 0; i < items.length; i++) { TreeItem item = items [i]; width = Math.max (width, item.calculateWidth (0, gc)); if (item._getExpanded ()) { width = Math.max (width, calculateWidth (item.getItems (), gc));
for (int i=0; i<ids.length; i++) { TreeItem item = _getItem (ids [i], false); if (item != null) { width = Math.max (width, item.calculateWidth (0, gc)); if (item._getExpanded ()) { width = Math.max (width, calculateWidth (item.childIds, gc)); }
int calculateWidth (TreeItem [] items, GC gc) {	int width = 0;	for (int i = 0; i < items.length; i++) {		TreeItem item = items [i];		width = Math.max (width, item.calculateWidth (0, gc));		if (item._getExpanded ()) {			width = Math.max (width, calculateWidth (item.getItems (), gc));		}	}	return width;}