if (area.width == 0 || area.height == 0 || items.length == 0) return changed;
if (area.width <= 0 || area.height <= 0 || items.length == 0) return changed;
boolean setItemBounds() {	boolean changed = false;	if (isDisposed()) return changed;	Rectangle area = super.getClientArea();		int tabHeight = getTabHeight();	xClient = area.x + borderLeft + marginWidth;	if (onBottom) {		yClient = area.y + borderTop + marginHeight; 	} else {		yClient = area.y + borderTop + tabHeight + 1 + marginHeight; 		// +1 is for the line at the bottom of the tabs	}		if (area.width == 0 || area.height == 0 || items.length == 0) return changed;		int[] widths = new int[items.length];	GC gc = new GC(this);	for (int i = 0; i < items.length; i++) {		widths[i] = items[i].preferredWidth(gc);	}	gc.dispose();	int oldAverageWidth = 0;	int averageWidth = (area.width - borderLeft - borderRight) / items.length;	while (averageWidth > oldAverageWidth) {		int width = area.width - borderLeft - borderRight;		int count = items.length;		for (int i = 0; i < items.length; i++) {			if (widths[i] < averageWidth) {				width -= widths[i];				count--;			}		}		oldAverageWidth = averageWidth;		if (count > 0) {			averageWidth = width / count;		}	}	averageWidth = Math.max(averageWidth, MIN_TAB_WIDTH * tabHeight);	for (int i = 0; i < items.length; i++) {		if (widths[i] > averageWidth) {			widths[i] = averageWidth;		}	}		int totalWidth = 0;	for (int i = 0; i < items.length; i++) { 		CTabItem tab = items[i];		if (tab.height != tabHeight || tab.width != widths[i]) changed = true;		tab.height = tabHeight;		tab.width = widths[i];		totalWidth += widths[i];	}		if (setItemLocation()) changed = true;		int areaWidth = area.x + area.width - borderRight;	if (totalWidth <= areaWidth) {		// if all items can be displayed, show all items		if (topTabIndex != 0) {			topTabIndex = 0;			setItemLocation();			changed = true;		}	} else {		// Is there a gap after last item showing		CTabItem lastItem = items[items.length -1];		if (lastItem.x + lastItem.width < areaWidth) {			int scrollWidth = arrowBar.getSize().x;			int maxWidth = areaWidth;			if (scroll_leftVisible() || scroll_rightVisible()) {				maxWidth -=  scrollWidth;			}			while (topTabIndex > 0 && maxWidth - lastItem.x - lastItem.width > items[topTabIndex - 1].width) {				topTabIndex--;				setItemLocation();				changed = true;				maxWidth = areaWidth;				if (scroll_leftVisible() || scroll_rightVisible()) {					maxWidth -=  scrollWidth;				}			}		}	}	return changed;}