if (itemCount == 0) { focusIndex = -1; } else { if (focusIndex == index && focusIndex == itemCount) { focusIndex = index - 1; items [focusIndex].redraw (true); } }
void destroyItem (ExpandItem item) {	int index = 0;	while (index < itemCount) {		if (items [index] == item) break;		index++;	}	if (index == itemCount) return;	System.arraycopy (items, index + 1, items, index, --itemCount - index);	items [itemCount] = null;	if (itemCount == 0) {		focusIndex = -1;	} else {		if (focusIndex == index && focusIndex == itemCount) {			focusIndex = index - 1;			items [focusIndex].redraw (true);		}	}	item.redraw (true);	layoutItems (index, true);}