if (setItemSize()) changed = true; if (setItemLocation()) changed = true; } else { if (setItemSize()) changed = true; if (setItemLocation()) changed = true; if (!item.showing) { if (priority[idx] >= priority[0]) { int maxWidth = getRightItemEdge() - borderLeft; if (!single && !simple) maxWidth -= curveWidth - 2*curveIndent; int width = items[priority[idx]].width; while (idx > 1) { width += items[priority[idx-1]].width; if (width > maxWidth) break; idx--; } } int[] newPriority = new int[priority.length]; System.arraycopy(priority, idx, newPriority, 0, priority.length - idx); System.arraycopy(priority, 0, newPriority, priority.length - idx, idx); priority = newPriority; if (setItemLocation()) changed = true; }
public void showItem (CTabItem item) {	checkWidget();	if (item == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);	if (item.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);	int index = indexOf(item);	int idx = -1;	for (int i = 0; i < priority.length; i++) {		if (priority[i] == index) {			idx = i;			break;		}	}	boolean changed = false;	boolean oldShowChevron = showChevron;	if (mru) {		int[] newPriority = new int[priority.length];		System.arraycopy(priority, 0, newPriority, 1, idx);		System.arraycopy(priority, idx+1, newPriority, idx+1, priority.length - idx - 1);		newPriority[0] = index;		priority = newPriority;		if (setItemSize()) changed = true;		if (setItemLocation()) changed = true;	} else {		if (setItemSize()) changed = true;		if (setItemLocation()) changed = true;		if (!item.showing) {			if (priority[idx] >= priority[0]) {				int maxWidth = getRightItemEdge() - borderLeft;				if (!single && !simple) maxWidth -= curveWidth - 2*curveIndent;				int width = items[priority[idx]].width;				while (idx > 1) {					width += items[priority[idx-1]].width;					if (width > maxWidth) break;					idx--;				}			}			int[] newPriority = new int[priority.length];			System.arraycopy(priority, idx, newPriority, 0, priority.length - idx);			System.arraycopy(priority, 0, newPriority, priority.length - idx, idx);			priority = newPriority;			if (setItemLocation()) changed = true;		}	}	setButtonBounds();	if (showChevron != oldShowChevron) changed = true;	if (changed && toolTipShell != null) {		Point pt = getDisplay().getCursorLocation();		pt = toControl(pt);		if (!updateToolTip(pt.x, pt.y)) hideToolTip();	}	if (changed) redrawTabs();}