if (showClose) { inactiveCloseBar.setVisible(false); inactiveItem = null; if (arrowBar.isVisible()) { Rectangle arrowRect = arrowBar.getBounds(); arrowRect.width += borderRight; closeBar.setVisible(!arrowRect.contains(closeBar.getLocation())); } else { closeBar.setVisible(true); } }
public void setSelection(int index) {	checkWidget();	if (index < 0 || index >= items.length) return;	if (selectedIndex == index) return;		if (showClose) {		inactiveCloseBar.setVisible(false);		inactiveItem = null;		if (arrowBar.isVisible()) {			Rectangle arrowRect = arrowBar.getBounds();			arrowRect.width += borderRight;			closeBar.setVisible(!arrowRect.contains(closeBar.getLocation()));		} else {			closeBar.setVisible(true);		}	}		int oldIndex = selectedIndex;	selectedIndex = index;		Control control = items[index].control;	if (control != null && !control.isDisposed()) {		control.setBounds(getClientArea());		control.setVisible(true);	}		if (oldIndex != -1) {		control = items[oldIndex].control;		if (control != null && !control.isDisposed()) {			control.setVisible(false);		}			}	ensureVisible();		redrawTabArea(-1);}