void layoutItems() { if (isDisposed()) return;
boolean layoutItems() { if (isDisposed()) return false;
 void layoutItems() {	if (isDisposed()) return;	Rectangle area = super.getClientArea();	int tabHeight = getTabHeight();	shortenedTabs = false;	if (items.length > 0) {		int[] widths = new int[items.length];		int totalWidth = 0;		GC gc = new GC(this);		for (int i = 0; i < items.length; i++) {			widths[i] = items[i].preferredWidth(gc);			totalWidth += widths[i];		}		gc.dispose();		if (totalWidth < (area.width - borderLeft - borderRight) ) {			topTabIndex = 0;		} else {						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;				}			}			if (averageWidth > MIN_TAB_WIDTH * tabHeight) {				for (int i = 0; i < items.length; i++) {					if (widths[i] > averageWidth) {						widths[i] = averageWidth;					}				}				topTabIndex = 0;				shortenedTabs = true;			}		}		int x = area.x;		int y = area.y + borderTop;		if (onBottom) {			y = Math.max(0, area.y + area.height - borderBottom - tabHeight);		}		for (int i = topTabIndex - 1; i>=0; i--) { 			// if the first visible tab is not the first tab			CTabItem tab = items[i];			tab.width = widths[i];			tab.height = getTabHeight();			x -= tab.width; 			// layout tab items from right to left thus making them invisible			tab.x = x;			tab.y = y;		}				x = area.x + borderLeft;		for (int i=topTabIndex; i<items.length; i++) {			// continue laying out remaining, visible items left to right 			CTabItem tab = items[i];			tab.x = x;			tab.y = y;			tab.height = tabHeight;			tab.width = widths[i];			x = x + tab.width;		}	}		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	}		// resize the scrollbar and close butotns	layoutButtons();}