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