item.closeRect.x = rightEdge - BUTTON_SIZE - item.marginRight();
item.closeRect.x = rightEdge - BUTTON_SIZE - item.marginRight(true);
boolean setItemLocation() {	if (items.length == 0) return false;	Point size = getSize();	int y = onBottom ? Math.max(borderBottom, size.y - borderBottom - tabHeight) : borderTop;	boolean changed = false;	if (single) {		int defaultX = size.x + 10; // off screen		for (int i = 0; i < items.length; i++) {			if (items[i].x != defaultX) changed = true;			items[i].x = defaultX; 			}		if (selectedIndex > -1) {			CTabItem item = items[selectedIndex];			int oldX = item.x, oldY = item.y;			int tabWidth = size.x - borderLeft - borderRight - minRect.width - maxRect.width - chevronRect.width;			int indent = Math.max(0, (tabWidth-item.width)/2);			if (rightAnchor != SWT.DEFAULT) {				int indentWithAnchor = rightAnchor - item.width;				indent = Math.max(indent, indentWithAnchor - borderLeft);			}			item.x = borderLeft + indent; 			item.y = y;			if (showClose || item.showClose) {				int rightEdge = Math.min(item.x + item.width, getRightItemEdge());				item.closeRect.x = rightEdge - BUTTON_SIZE - item.marginRight();				item.closeRect.y = onBottom ? size.y - borderBottom - tabHeight + (tabHeight - BUTTON_SIZE)/2: borderTop + (tabHeight - BUTTON_SIZE)/2;			}			if (item.x != oldX || item.y != oldY) changed = true;		}	} else {		int x = -1;		for (int i = firstIndex - 1; i >= 0; i--) { 			// if the first visible tab is not the first tab			CTabItem item = items[i];			x -= item.width; 			if (!changed && (item.x != x || item.y != y) ) changed = true;			// layout tab items from right to left thus making them invisible			item.x = x;			item.y = y;			item.closeRect.x = item.x + item.width - BUTTON_SIZE - item.marginRight();			if (!simple && i == selectedIndex) item.closeRect.x -= CURVE_INDENT;			item.closeRect.y = onBottom ? size.y - borderBottom - tabHeight + (tabHeight - BUTTON_SIZE)/2: borderTop + (tabHeight - BUTTON_SIZE)/2;		}				x = 0;		for (int i = firstIndex; i < items.length; i++) {			// continue laying out remaining, visible items left to right 			CTabItem item = items[i];			item.x = x;			item.y = y;			if (i == selectedIndex) {				int extra = simple ? 0 : CURVE_INDENT;				int rightEdge = Math.min(item.x + item.width - extra, getRightItemEdge() - extra);				item.closeRect.x = rightEdge - BUTTON_SIZE - item.marginRight();			} else {				item.closeRect.x = item.x + item.width - BUTTON_SIZE - item.marginRight();			}			item.closeRect.y = onBottom ? size.y - borderBottom - tabHeight + (tabHeight - BUTTON_SIZE)/2: borderTop + (tabHeight - BUTTON_SIZE)/2;			x = x + item.width;		}		CTabItem item = items[items.length - 1];		if (item.isShowing()) {			setLastIndex(items.length - 1);			changed = true;		}	}	return changed;}