if (focusItem.index < anchorItem.index) { deselectItem (focusItem); redrawItem (focusItem.index, true); }
void onArrowDown (int stateMask) {	if ((stateMask & (SWT.SHIFT | SWT.CTRL)) == 0) {		/* Down Arrow with no modifiers */		int newFocusIndex = focusItem.index + 1;		if (newFocusIndex == itemsCount) return; 	/* at bottom */		selectItem (items [newFocusIndex], false);		setFocusItem (items [newFocusIndex], true);		redrawItem (newFocusIndex, true);		showItem (items [newFocusIndex]);		Event newEvent = new Event ();		newEvent.item = items [newFocusIndex];		postEvent (SWT.Selection, newEvent);		return;	}	if ((style & SWT.SINGLE) != 0) {		if ((stateMask & SWT.CTRL) != 0) {			/* CTRL+Down Arrow, CTRL+Shift+Down Arrow */			Rectangle clientArea = getClientArea ();			int visibleItemCount = (clientArea.height - getHeaderHeight ()) / itemHeight;			if (itemsCount <= topIndex + visibleItemCount) return;	/* at bottom */			update ();			topIndex++;			getVerticalBar ().setSelection (topIndex);			GC gc = new GC (this);			gc.copyArea (				0, 0,				clientArea.width, clientArea.height,				0, -itemHeight);			gc.dispose ();			return;		}		/* Shift+Down Arrow */		int newFocusIndex = focusItem.index + 1;		if (newFocusIndex == itemsCount) return; 	/* at bottom */		selectItem (items [newFocusIndex], false);		setFocusItem (items [newFocusIndex], true);		redrawItem (newFocusIndex, true);		showItem (items [newFocusIndex]);		Event newEvent = new Event ();		newEvent.item = items [newFocusIndex];		postEvent (SWT.Selection, newEvent);		return;	}	/* SWT.MULTI */	if ((stateMask & SWT.CTRL) != 0) {		if ((stateMask & SWT.SHIFT) != 0) {			/* CTRL+Shift+Down Arrow */			Rectangle clientArea = getClientArea ();			int visibleItemCount = (clientArea.height - getHeaderHeight ()) / itemHeight;			if (itemsCount <= topIndex + visibleItemCount) return;	/* at bottom */			update ();			topIndex++;			getVerticalBar ().setSelection (topIndex);			GC gc = new GC (this);			gc.copyArea (				0, 0,				clientArea.width, clientArea.height,				0, -itemHeight);			gc.dispose ();			return;		}		/* CTRL+Down Arrow */		int focusIndex = focusItem.index; 		if (focusIndex == itemsCount - 1) return;	/* at bottom */		TableItem newFocusItem = items [focusIndex + 1];		setFocusItem (newFocusItem, true);		redrawItem (newFocusItem.index, true);		showItem (newFocusItem);		return;	}	/* Shift+Down Arrow */	int newFocusIndex = focusItem.index + 1;	if (newFocusIndex == itemsCount) return; 	/* at bottom */	if (anchorItem == null) anchorItem = focusItem;	selectItem (items [newFocusIndex], true);	setFocusItem (items [newFocusIndex], true);	redrawItem (newFocusIndex, true);	showItem (items [newFocusIndex]);	Event newEvent = new Event ();	newEvent.item = items [newFocusIndex];	postEvent (SWT.Selection, newEvent);}